Your IP : 216.73.216.213


Current Path : /opt/alt/python311/lib64/python3.11/test/test_gdb/__pycache__/
Upload File :
Current File : //opt/alt/python311/lib64/python3.11/test/test_gdb/__pycache__/test_backtrace.cpython-311.opt-2.pyc

�

�0�i{��h�ddlZddlZddlmZddlmZddlmZmZm	Z	m
Z
d�ZGd�de��ZdS)	�N)�support)�python_is_optimized�)�setup_module�
DebuggerTests�CET_PROTECTION�
SAMPLE_SCRIPTc�"�t��dS)N)r���C/opt/alt/python311/lib64/python3.11/test/test_gdb/test_backtrace.py�setUpModuler	s���N�N�N�N�Nrc��eZdZeje��d��d���Zeje��d��d���Zeje��d��ej	d��d�����Z
eje��d��d���Zeje��d��d���ZdS)	�	PyBtTestsz&Python was compiled with optimizationsc�n�	|�tdg���}|�|d��dS)N�py-bt��script�cmds_after_breakpointaL^.*
Traceback \(most recent call first\):
  <built-in method id of module object .*>
  File ".*gdb_sample.py", line 10, in baz
    id\(42\)
  File ".*gdb_sample.py", line 7, in bar
    baz\(a, b, c\)
  File ".*gdb_sample.py", line 4, in foo
    bar\(a=a, b=b, c=c\)
  File ".*gdb_sample.py", line 12, in <module>
    foo\(1, 2, 3\)
��get_stack_tracer	�assertMultilineMatches��self�bts  r
�test_btzPyBtTests.test_btsS��	0�
�
!�
!��9@�	�"�C�C���#�#�B�%�	�	�	�	�	rc�n�	|�tdg���}|�|d��dS)N�
py-bt-fullraD^.*
#[0-9]+ Frame 0x-?[0-9a-f]+, for file .*gdb_sample.py, line 7, in bar \(a=1, b=2, c=3\)
    baz\(a, b, c\)
#[0-9]+ Frame 0x-?[0-9a-f]+, for file .*gdb_sample.py, line 4, in foo \(a=1, b=2, c=3\)
    bar\(a=a, b=b, c=c\)
#[0-9]+ Frame 0x-?[0-9a-f]+, for file .*gdb_sample.py, line 12, in <module> \(\)
    foo\(1, 2, 3\)
rrs  r
�test_bt_fullzPyBtTests.test_bt_full"sS��	5�
�
!�
!��9E��"�H�H���#�#�B�%�	�	�	�	�	r�cpuc���	d}|�|dg���}|�d|��|�|dg���}|�d|��dS)NaN
from threading import Thread

class TestThread(Thread):
    # These threads would run forever, but we'll interrupt things with the
    # debugger
    def run(self):
        i = 0
        while 1:
             i += 1

t = {}
for i in range(4):
   t[i] = TestThread()
   t[i].start()

# Trigger a breakpoint on the main thread
id(42)

zthread apply all py-bt�rzWaiting for the GILzthread apply all py-bt-full�r�assertIn�r�cmd�
gdb_outputs   r
�test_threadszPyBtTests.test_threads2s���	M���*�)�)�#�AY�@Z�*�\�\�
��
�
�+�Z�8�8�8��)�)�#�A^�@_�*�a�a�
��
�
�+�Z�8�8�8�8�8rc���	d}|�|gd����}|�d|��|�|gd����}|�d|��dS)NzRfrom gc import collect
id(42)
def foo():
    collect()
def bar():
    foo()
bar()
)�break update_refs�continuerr"zGarbage-collecting)r*r+rr#r%s   r
�test_gczPyBtTests.test_gcUs���	J����)�)�#�@j�@j�@j�*�,�,�
�	
�
�
�*�J�7�7�7��)�)�#�@o�@o�@o�*�,�,�
�	
�
�
�*�J�7�7�7�7�7rc���tjd��}ddg}tr|�d��|�d��|�||���}|�|d��dS)Nz�
            class MyList(list):
                def __init__(self):
                    super(*[]).__init__()   # wrapper_call()

            id("first break point")
            l = MyList()
        zbreak wrapper_callr+�nextrr"z1<method-wrapper u?'__init__' of MyList object at )�textwrap�dedentr�appendr�assertRegex)rr&rr's    r
�test_wrapper_callzPyBtTests.test_wrapper_callos����o��
�
��"6�z� B���	1�
"�(�(��0�0�0��$�$�W�-�-�-��)�)�#�@U�*�W�W�
�����M�	O�	O�	O�	O�	OrN)
�__name__�
__module__�__qualname__�unittest�skipIfrrrr�requires_resourcer(r,r3rrr
rr
sW�������X�_�(�(�*�*�=�?�?���?�?��$�X�_�(�(�*�*�=�?�?���?�?���X�_�(�(�*�*�=�?�?��W��u�%�%�9�9�&�%�?�?�9�@�X�_�(�(�*�*�=�?�?�
8�8�?�?�
8�*�X�_�(�(�*�*�=�?�?�O�O�?�?�O�O�Orr)
r/r7�testr�test.supportr�utilrrrr	rrrrr
�<module>r=s�����������������,�,�,�,�,�,�L�L�L�L�L�L�L�L�L�L�L�L����yO�yO�yO�yO�yO�
�yO�yO�yO�yO�yOr