+
    Bi(                     h   ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIH	t	 ]P                  ! R4      ;'       g    Rt] P                  P                  ] P                  P                  ]P                  4      R4      t] P                  P                  ] P                  P                  ]4      R4      tRtRtR tRtR	^ R
R/R ltR t]! 4       w  tt]R8  d*   ]P4                  ! R]^ ,           R]^,           R] 24      hR t]! 4        R t]! 4       tR t ! R R]P>                  4      t R# )    N)supportgdbzpython-gdb.pyzgdb_sample.py
builtin_id123c                      \         P                  P                  4        U Uu/ uF   w  rV P                  R 4      '       d   K  WbK"  	  upp # u upp i )PYTHON)osenvironitems
startswith)namevalues     )/usr/lib/python3.14/test/test_gdb/util.pyclean_environmentr      sF    +-::+;+;+= .+=KD??8, DK+= . . .s   AAexitcodecheckTc                2   \        4       pV'       d   VP                  V4       \        RR.p\        R8  d   VP	                  RR\
         234       VP	                  V4       \        P                  ! V\        P                  \        P                  \        P                  RRVR7      pVP                  pVP                  pV'       dM   VP                  V 8w  d<   \        P                  ! V4      p	\        V	 RVP                   R	V  R
V: RV: 2	4      hWx3# )zRuns 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-nxz--init-eval-commandzadd-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PIPEr   r   
returncodeshlexjoin	Exception)
r   r   argsenv_varsr   cmdprocr   r   cmd_texts
   $$*,      r   run_gdbr0   !   s   
 
C

8  C f

)./A.BCE 	FJJt>>oo 2D [[F[[FH,::c?8*$;DOO;L M..6Z 8""( ,""(- . 	.
     c                  H    \        R 4      w  r\        P
                  ! RT 4      pTf   \        RT ,          4      hT p\        TP                  ^4      4      p\        TP                  ^4      4      pYV3pYG3#   \         d   p\        P                  ! RT 24      hRp?ii ; i)z	--versionz'Couldn't find gdb program on the path: Nz ^(?:GNU|HP) gdb.*?\b(\d+)\.(\d+)zunable to parse gdb version: %r)	r0   OSErrorunittestSkipTestresearchr*   intgroup)r   r   excmatchversion_textmajorminorversions           r   get_gdb_versionr@   K   s    Q - II96BE}9FBCCLAEAEnG""%  Q "I# OPPQs   A8 8B!BB!zIgdb versions before 7.0 didn't support python embedding. Saw gdb version .z:
c                     \        R R\        P                  RR7      w  rRV9   d   \        P                  ! RV: 24      hV '       g   \        P                  ! RV: 24      hRV 9   d   \        P                  ! R4      hR	# )
z9--eval-command=python import sys; print(sys.version_info)--argsF)r   zauto-loading has been declinedz;gdb security settings prevent use of custom hooks; stderr: z4gdb not built with embedded python support; stderr: zmajor=2zgdb built with Python 2N)r0   sys
executabler4   r5   )r   r   s     r   check_usable_gdbrF   j   s     C#..NF
 (61j"# 	# j"# 	# F 9:: r1   c                      \         P                  ! R 4      p V '       g   R# V P                  4       pRV9   ;'       d5    \        ;QJ d    R V 4       F  '       g   K   R# 	  R# ! R V 4       4      # )CFLAGSFz-mcetc              3      "   T F4  pVP                  R 4      ;'       d    VP                  R4      '       * x  K6  	  R# 5i)z-fcf-protectionN)z=nonez=return)r   endswith).0flags   & r   	<genexpr>!cet_protection.<locals>.<genexpr>   sC      ' % __%67 A A!]]+?@@A %s   >>T)	sysconfigget_config_varsplitany)cflagsflagss     r   cet_protectionrU      st    %%h/FLLNE  ' ' ' %'(( ' %' '(r1   c                     \         P                  '       dt   \        R \        ^ ,           R\        ^,           R24       \        P                  4        F  p \        RV ,           4       K  	  \        R\         24       \        4        R# R# )zgdb version rA   :z
    path: Nz    )r   verboseprintr!   GDB_VERSION_TEXT
splitlinesr    )lines    r   setup_moduler]      sd    [^,Ak!n-=Q?@$//1D'D.! 2
;-() r1   c                   @   a  ] tR t^t o RtRR]RRR3R ltR tRtV t	R# )DebuggerTestsz(Test that the debugger can debug Python.NFc                   RRV,          RR.p\         R8  d   VR.,          pV'       d    \        '       d   VR.,          pWt,          pM
VR.,          pV Uu. uF  pRV,          NK  	  p	pV	R	\        P                  .,          p	V	P	                  \
        P                  ! 4       4       V'       g   V	R
.,          p	V'       d   V	RV.,          p	MV'       d
   W.,          p	\        V	R\        / w  rV'       g3   VP                  4        F  p\        V\        P                  R7       K   	  RV9   d   \        P                  ! R4      hR F#  pW9   g   K  \        P                  ! V: R24      h	  V
# u upi )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
zset breakpoint pending yeszbreak %szset print address offr%   zset print entry-values nonext	backtracez--eval-command=%srC   z-Sz-cPYTHONHASHSEED)filezPC not savedzKgdb cannot walk the frame object because the Program Counter is not presentz found in gdb outputr   )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 ?? ())r!   CET_PROTECTIONrD   rE   r"   r$   _args_from_interpreter_flagsr0   rc   r[   rY   r   r4   r5   )selfsourcescript
breakpointcmds_after_breakpointimport_siteignore_stderrcommandsr-   r+   outerrr\   patterns   &&&&&&&       r   get_stack_traceDebuggerTests.get_stack_trace   sh   : )# $
. & 455H ~
 VH$-H%H
 6>>Xc#c))X>! 	!J;;=>TFNDT6N"DHD D@@(d, ) S ## %3 4 4
G$ ~''7+5I(JKK'
* 
m ?s   E3c                    \         P                  ! W!\         P                  4      pV'       g   V P                  V: R V: 2R7       R# R# )z did not match )msgN)r6   r;   DOTALLfail)rg   actualrq   ms   &&& r   assertMultilineMatches$DebuggerTests.assertMultilineMatches  s1    HHWbii0II67CID r1    )
__name__
__module____qualname____firstlineno____doc__BREAKPOINT_FNrr   rz   __static_attributes____classdictcell__)__classdict__s   @r   r_   r_      s,     2%)$#0.2$)&+	zxE Er1   r_   )r   r   )r   r   )!r	   r6   r(   shutilr$   rD   rO   r4   testr   whichr    pathr)   dirnamerE   r#   __file__SAMPLE_SCRIPTr   rc   r   r!   r0   r@   rZ   r5   rF   rU   re   r]   TestCaser_   r|   r1   r   <module>r      s>   	 	    
    ll5!**U WW\\"''//#.."A"13  RWW__X6H. 'A 'T 'T#. !0 1  +


&q>*!KN+;3
	 ;,  
(  !CEH%% CEr1   