+
    Bi                     b    ^ RI t ^ RIt^ RIHt ^ RIHt ^RIHtHtH	t	H
t
 R t ! R R]4      tR# )    N)support)python_is_optimized)setup_moduleDebuggerTestsCET_PROTECTIONSAMPLE_SCRIPTc                      \        4        R # )N)r        3/usr/lib/python3.14/test/test_gdb/test_backtrace.pysetUpModuler   	   s    Nr   c                     a  ] tR t^t o ]P
                  ! ]! 4       R4      R 4       t]P
                  ! ]! 4       R4      R 4       t]P
                  ! ]! 4       R4      ]	P                  ! 4       ]	P                  ! R4      R 4       4       4       t]P
                  ! ]! 4       R4      R 4       t]P
                  ! ]! 4       R4      R 4       tRtV tR	# )
	PyBtTestsz&Python was compiled with optimizationsc                Z    V P                  \        R.R7      pV P                  VR4       R# )z%Verify that the "py-bt" command works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\)
Nget_stack_tracer   assertMultilineMatchesselfbts   & r   test_btPyBtTests.test_bt   s6     !!9@	 " C##B%	r   c                Z    V P                  \        R.R7      pV P                  VR4       R# )z*Verify that the "py-bt-full" command works
py-bt-fullr   aD  ^.*
#[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\)
Nr   r   s   & r   test_bt_fullPyBtTests.test_bt_full"   s6     !!9E " H##B%	r   cpuc                    RpV P                  VR.R7      pV P                  RV4       V P                  VR.R7      pV P                  RV4       R# )zBVerify that "py-bt" indicates threads that are waiting for the GILaN  
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)

zthread apply all py-btr   zWaiting for the GILzthread apply all py-bt-fullNr   assertInr   cmd
gdb_outputs   &  r   test_threadsPyBtTests.test_threads2   sg    * ))#AY@Z * \
+Z8 ))#A^@_ * a
+Z8r   c                    RpV P                  V. ROR7      pV P                  RV4       V P                  V. ROR7      pV P                  RV4       R# )z?Verify that "py-bt" indicates if a thread is garbage-collectingzRfrom gc import collect
id(42)
def foo():
    collect()
def bar():
    foo()
bar()
r#   zGarbage-collectingN)break update_refscontinuer   )r,   r-   r   r$   r&   s   &  r   test_gcPyBtTests.test_gcV   sc     ))#@j * ,
 	*J7 ))#@o * ,
 	*J7r   c                    \         P                  ! R 4      pRR.p\        '       d   VP                  R4       VP                  R4       V P	                  VVR7      pV P                  VR4       R# )z
            class MyList(list):
                def __init__(self):
                    super(*[]).__init__()   # wrapper_call()

            id("first break point")
            l = MyList()
        zbreak wrapper_callr-   nextr   r#   z1<method-wrapper u?'__init__' of MyList object at N)textwrapdedentr   appendr   assertRegex)r   r'   r   r(   s   &   r   test_wrapper_callPyBtTests.test_wrapper_callp   sx     oo   "6z B> "((0$$W- ))#@U * W
M	Or   r
   N)__name__
__module____qualname____firstlineno__unittestskipIfr   r   r   r   requires_gil_enabledrequires_resourcer)   r.   r6   __static_attributes____classdictcell__)__classdict__s   @r   r   r      s     __(*=??$ __(*=?? __(*=?!!#u%9 & $?9@ __(*=?
8?
8* __(*=?O?Or   r   )r2   r<   testr   test.supportr   utilr   r   r   r   r   r   r
   r   r   <module>rF      s,       , L LzO zOr   