Sindbad~EG File Manager

Current Path : /proc/2568807/root/usr/local/lib/python3.12/test/__pycache__/
Upload File :
Current File : //proc/2568807/root/usr/local/lib/python3.12/test/__pycache__/test_lltrace.cpython-312.opt-1.pyc

�

'Μg�����ddlZddlZddlZddlmZddlmZddlmZd�Z	ejejd�Gd�dej��Z
ed	k(rej�yy)
�N)�support)�	os_helper)�assert_python_okc�j�g}td�D]}|j|��d}d}t||�y)Nrzthis isz
an example)�range�append�print)�x�i�ys   �./usr/local/lib/python3.12/test/test_lltrace.py�exampler	s3��
�A�
�1�X��	�������A��A�	�!�Q�K�zlltrace requires Py_DEBUGc�$�eZdZd�Zd�Zd�Zd�Zy)�TestLLTracec�\�tj|�j�}ttj
dd��5}|j
tjtj
�|j|�ddd�ttj
�\}}}|j|d�|j|d�|jd�}tjr6td�t|�td�t|�t�|S#1swY��xYw)N�wzutf-8)�encodingrrz

--- code ---z
--- stdout ---)�textwrap�dedent�strip�openr�TESTFN�
addCleanup�unlink�writer�assertEqual�decoder�verboser	)�self�code�fd�status�stdout�stderr�results       r
�run_codezTestLLTrace.run_codes������t�$�*�*�,��
�)�"�"�C�'�
:�b��O�O�I�,�,�i�.>�.>�?��H�H�T�N�;�"2�)�2B�2B�!C����������%������#����w�'���?�?��$�%��$�K��$�%��&�M��G��
�;�
:�s
�AD"�"D+c�j�|jd�}|jd|�|jd|�|jd|�|jd|�|jd|�|jd|�|jd|�|jd	|�|jd
|�y)Na�
            def dont_trace_1():
                a = "a"
                a = 10 * a
            def trace_me():
                for i in range(3):
                    +i
            def dont_trace_2():
                x = 42
                y = -x
            dont_trace_1()
            __lltrace__ = 1
            trace_me()
            del __lltrace__
            dont_trace_2()
        �GET_ITER�FOR_ITER�CALL_INTRINSIC_1�POP_TOP�	BINARY_OP�UNARY_NEGATIVEz'trace_me' in module '__main__'�dont_trace_1z'dont_trace_2' in module)r'�assertIn�assertNotIn�r r$s  r
�test_lltracezTestLLTrace.test_lltrace&s������ �
�� 	
�
�
�j�&�)��
�
�j�&�)��
�
�(�&�1��
�
�i��(�����f�-����)�6�2��
�
�7��@������0����3�V�<rc�|�|jd�}|jd|�|jd|�|jd|�|jd|�tjtd��D�cic]}|j
|��}}|j
�D]�}|jd�\}}}|s�t|�}|j�}t|�d	k(r|\}}	t|	�}	n|\}d}	|j||j|�|j||j|	���ycc}w)
Nz
            from test import test_lltrace
            test_lltrace.__lltrace__ = 1
            test_lltrace.example()
        z''example' in module 'test.test_lltrace'�
LOAD_CONSTr*zthis is an exampleT)�adaptive�:�)r'r0�dis�get_instructionsr�offset�
splitlines�	partition�int�split�lenr�opname�arg)
r r$r�	instr_map�liner;�colon�opname_opargrA�opargs
          r
�test_lltrace_different_modulez)TestLLTrace.test_lltrace_different_moduleBs+����� �
��
	
�
�
�?��H��
�
�l�F�+��
�
�j�&�)��
�
�*�F�3�+.�*>�*>�w�QU�*V�W�*V�Q�Q�X�X�q�[�*V�	�W��%�%�'�D�*.�.�.��*=�'�F�E�<�����[�F�'�-�-�/�L��<� �A�%� ,�
����E�
��(�	�������Y�v�.�5�5�v�>����Y�v�.�2�2�E�:�(��Xs�7D9c�J�|jd�}|jd|�y)Nz�
            import code

            console = code.InteractiveConsole()
            console.push('__lltrace__ = 1')
            console.push('a = [1, 2, 3]')
            console.push('a[0] = 1')
            print('unreachable if bug exists')
        zunreachable if bug exists)r'r0r2s  r
�1test_lltrace_does_not_crash_on_subscript_operatorz=TestLLTrace.test_lltrace_does_not_crash_on_subscript_operator^s(��
��� �
��	
�
�
�1�6�:rN)�__name__�
__module__�__qualname__r'r3rHrJ�rr
rrs���"=�8;�8;rr�__main__)r9r�unittest�testr�test.supportr�test.support.script_helperrr�
skipUnless�Py_DEBUG�TestCaserrK�mainrNrr
�<module>rXsr��
����"�7������W�%�%�'B�C�Y;�(�#�#�Y;�D�Y;�v�z���H�M�M�O�r

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists