+
     þÎj  ã                   óŒ  € R t ^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RI	H
t
  ]! RR7       Rt]
! 4       t]P                  P                  R4      tR	t]P$                  ! ]]4      tR
t]P$                  ! ]]4      t ^ RItRtRt]P$                  ! ]]4      t ! R R]4      tR#   ] d    RtRt L`i ; i  ] d    Rt L>i ; i)z'Helpers for running gdb related testingN)Úconfig)Ú_confirm_gdb)Úcollect_gdbinfoF)Úneed_ptrace_attachTÚ3z;functioning gdb with correct ptrace permissions is requiredz gdb with python 3 support neededzpexpect module needed for testc                   ó¸   a € ] tR t^&t o RtRR ltR tR tR tR t	R t
R	 tRR
 ltR tR tR tR tR tRR ltRR ltRR ltRR ltRR ltR tR tRtV tR# )ÚGdbMIDriverzg
Driver class for the GDB machine interface:
https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI.html
Nc                ó  € \         '       g   R p\        V4      h\        '       g   Rp\        V4      h\        P                  V n        \        P                  V n        W n	        Wn
        W0n        W@n        V P                  4        R# )z[This driver requires the pexpect module. This can be obtained via:

$ conda install pexpectzWThis driver requires a gdb binary. This can be obtained via the system package manager.N)Ú_HAVE_PEXPECTÚRuntimeErrorÚ	_HAVE_GDBr   Ú
GDB_BINARYÚ_gdb_binaryÚsysÚ
executableÚ_pythonÚ_debugÚ
_file_nameÚ_timeoutÚ
_init_cmdsÚ_drive)ÚselfÚ	file_nameÚdebugÚtimeoutÚ	init_cmdsÚmsgs   &&&&& ÚM/opt/data/home/.local/lib/python3.14/site-packages/numba/tests/gdb_support.pyÚ__init__ÚGdbMIDriver.__init__+   sf   € ß‹}ð>ˆCä˜sÓ#Ð#ß‹yð>ˆCä˜sÓ#Ð#Ü!×,Ñ,ˆÔÜ—~‘~ˆŒØŒØ#ŒØŒØ#ŒØ�‰Žó    c                óè  € \         P                  P                  V P                  4      '       g   Q hV P                  RR.pV P
                  e   V\        V P
                  4      ,          pVRV P                  V P                  .,          p\        P                  ! RP                  V4      4      V n        V P                  '       d,   \        P                  P                  V P                  n        R# R# )z0This function sets up the caputured gdb instancez--interpreterÚmiNz--argsÚ )ÚosÚpathÚisfiler   r   r   Úlistr   ÚpexpectÚspawnÚjoinÚ	_capturedr   r   ÚstdoutÚbufferÚlogfile©r   Úcmds   & r   r   ÚGdbMIDriver._drive<   s£   € ä�w‰w�~‰~˜dŸo™o×.Ò.Ð.Ð.Ø×Ñ °$Ð7ˆØ�?‰?Ò&Ø”4˜Ÿ™Ó(Õ(ˆCØ�˜$Ÿ,™,¨¯©Ð8Õ8ˆÜ Ÿš s§x¡x°£}Ó5ˆŒØ�;�;ˆ;Ü%(§Z¡Z×%6Ñ%6ˆD�N‰NÖ"ñ r    c                ó(   € RV P                  4       9   # )zTReturns True if the underlying gdb implementation has python support
False otherwiseÚpython)Úlist_features©r   s   &r   Úsupports_pythonÚGdbMIDriver.supports_pythonG   s   € ð ˜4×-Ñ-Ó/Ñ/Ð/r    c                ó¨   € V P                  4       '       g   R# RpV P                  RV4       RV P                  P                  P	                  4       9   # )zuReturns True if the underlying gdb implementation has NumPy support
(and by extension Python support) False otherwiseFzGpython from __future__ import print_function;import numpy; print(numpy)Úconsolezmodule 'numpy' from)r6   Úinterpreter_execr+   ÚbeforeÚdecoder/   s   & r   Úsupports_numpyÚGdbMIDriver.supports_numpyL   sK   € ð ×#Ñ#×%Ò%Ùð,ˆà×Ñ˜i¨Ô-Ø&¨$¯.©.×*?Ñ*?×*FÑ*FÓ*HÑHÐHr    c                óÆ   €  V P                   P                  WP                  R 7       R#   \        P                  P
                   d   pRT R2p\        T4      ThRp?ii ; i))r   zExpected value did not arrive: Ú.N)r+   Úexpectr   r(   Ú
exceptionsÚTIMEOUTÚ
ValueError)r   rA   Úer   s   &&  r   Ú_captured_expectÚGdbMIDriver._captured_expectW   sV   € ð	)Ø�N‰N×!Ñ! &·-±-Ð!Ö@øÜ×!Ñ!×)Ñ)ô 	)Ø3°F°8¸1Ð=ˆCÜ˜S“/ qÐ(ûð	)ús   ‚&* ªA Á	AÁA c                ó|   € V P                   P                  pVP                  R4      pW9   g   Q RV RV R24       hR# )z=Asserts that the current output string contains the expected.úutf-8údecoded=ú

expected=Ú)N)r+   Úafterr<   )r   ÚexpectedÚoutputÚdecodeds   &&  r   Úassert_outputÚGdbMIDriver.assert_output^   s?   € à—‘×%Ñ%ˆØ—-‘- Ó(ˆØÔ"ÐN h¨w¨i°{À8À*ÈAÐ$NÓNÒ"r    c                óÚ   € V P                   P                  pVP                  R4      pVP                  4       ^ ,          p\        P
                  ! W4      pV'       g   Q RV RV R24       hR# )zCAsserts that the current output string contains the expected
regex.rI   rJ   rK   rL   N)r+   rM   r<   Ú
splitlinesÚreÚmatch)r   rN   rO   rP   Údone_strÚfounds   &&    r   Úassert_regex_outputÚGdbMIDriver.assert_regex_outputd   s^   € ð —‘×%Ñ%ˆØ—-‘- Ó(ˆØ×%Ñ%Ó'¨Õ*ˆÜ—’˜Ó,ˆßÐ@˜  	¨°X°J¸aÐ@Ó@Šur    c                ó^   € V P                   P                  V4       V P                  V4       R # )N)r+   ÚsendlinerF   )r   ÚcommandrA   s   &&&r   Ú_run_commandÚGdbMIDriver._run_commandm   s"   € Ø�‰×Ñ Ô(Ø×Ñ˜fÖ%r    c                ó,   € V P                  RRR7       R# )zgdb command ~= 'run'z	-exec-runú\^running.*\r\n©rA   N©r^   r5   s   &r   ÚrunÚGdbMIDriver.runq   s   € à×Ñ˜+Ð.@ÐÖAr    c                ó,   € V P                  RRR7       R# )zgdb command ~= 'continue'z-exec-continuera   rb   Nrc   r5   s   &r   ÚcontÚGdbMIDriver.contu   s   € à×ÑÐ*Ð3EÐÖFr    c                ó`   € V P                  RRR7       V P                  P                  4        R# )zgdb command ~= 'quit'z	-gdb-exitrb   N)r^   r+   Ú	terminater5   s   &r   ÚquitÚGdbMIDriver.quity   s%   € à×Ñ˜+¨lÐÔ;Ø�‰× Ñ Ö"r    c                ó,   € V P                  RRR7       R# )zgdb command ~= 'next'z
-exec-nextú\*stopped,.*\r\nrb   Nrc   r5   s   &r   ÚnextÚGdbMIDriver.next~   ó   € à×Ñ˜,Ð/BÐÖCr    c                ó,   € V P                  RRR7       R# )zgdb command ~= 'step'z
-exec-steprn   rb   Nrc   r5   s   &r   ÚstepÚGdbMIDriver.step‚   rq   r    c                ó6  € Ve   Ve   \        R4      hRpVe   VRV R2,          pVe3   \        V\        4      '       g   Q hVRV P                   RV R2,          pVe&   \        V\        4      '       g   Q hVRV R2,          pV P                  VR	R
7       R# )zgdb command ~= 'break'Nz%Can only supply one of line or symbolz-break-insert z-c "z" z-f Ú:r#   z\^donerb   )rD   Ú
isinstanceÚintr   Ústrr^   )r   ÚlineÚsymbolÚ	conditionÚbps   &&&& r   Úset_breakpointÚGdbMIDriver.set_breakpoint†   s¬   € àÒ Ò 2ÜÐDÓEÐEØˆØÒ Ø�D˜˜ 2Ð&Õ&ˆBØÒÜ˜d¤C×(Ò(Ð(Ð(Ø�C˜Ÿ™Ð(¨¨$¨¨qÐ1Õ1ˆBØÒÜ˜f¤c×*Ò*Ð*Ð*Ø�C˜�x˜q�/Õ!ˆBØ×Ñ˜" YÐÖ/r    c                ó  € V P                  R4       V P                  R4       Ve.   \        V\        4      '       g   Q hV P                  RV R24       Ve0   \        V\        4      '       g   Q hV P                  RV R24       R# R# )z%Checks that a breakpoint has been hitrn   z!*stopped,reason="breakpoint-hit",Nzbkptno="Ú"zline=")rF   rQ   rw   rx   )r   Únumberrz   s   &&&r   Úcheck_hit_breakpointÚ GdbMIDriver.check_hit_breakpoint•   s…   € à×ÑÐ1Ô2Ø×ÑÐ>Ô?ØÒÜ˜f¤c×*Ò*Ð*Ð*Ø×Ñ ¨&¨°Ð3Ô4ØÒÜ˜d¤C×(Ò(Ð(Ð(Ø×Ñ ¨ v¨QÐ/Ö0ñ r    c                ó–   € WV3 F"  p\        V\        4      '       d
   VR9   d   K"  Q h	  RV RV RV 2pV P                  VRR7       R# )zgdb command ~= 'info args'z-stack-list-arguments r#   ú\^done,.*\r\nrb   N©é    é   é   ©rw   rx   r^   )r   Úprint_valuesÚ	low_frameÚ
high_frameÚxr0   s   &&&&  r   Ústack_list_argumentsÚ GdbMIDriver.stack_list_arguments    sV   € à¨:Ó6ˆAÜ˜a¤×%Ò%¨!¨y®.Ð8Ð8ñ 7à& | n°A°i°[ÀÀ*ÀÐNˆØ×Ñ˜#Ð&6ÐÖ7r    c                ót   € \        V\        4      '       d   VR9   g   Q hRV 2pV P                  VRR7       R# )zgdb command ~= 'info locals'z-stack-list-variables r†   rb   Nr‡   r‹   )r   rŒ   r0   s   && r   Ústack_list_variablesÚ GdbMIDriver.stack_list_variables§   s<   € ä˜,¬×,Ò,°ÀÔ1JÐJÐJØ& | nÐ5ˆØ×Ñ˜#Ð&6ÐÖ7r    c                óz   € Vf   \        R4      hVf   \        R4      hRV RV R2pV P                  VRR7       R# )	z!gdb command ~= 'interpreter-exec'Nzinterpreter cannot be Nonezcommand cannot be Nonez-interpreter-exec z "r�   z\^(done|error).*\r\nrb   )rD   r^   )r   Úinterpreterr]   r0   s   &&& r   r:   ÚGdbMIDriver.interpreter_exec­   sM   € àÒÜÐ9Ó:Ð:ØŠ?ÜÐ5Ó6Ð6Ø" ; -¨r°'°¸!Ð<ˆØ×Ñ˜#Ð&=ÐÖ>r    c                ó0   € R pV P                  VRR7       R# )z-list-featuresr†   rb   Nrc   r/   s   & r   Ú_list_features_rawÚGdbMIDriver._list_features_raw¶   s   € ØˆØ×Ñ˜#Ð&6ÐÖ7r    c                óR  € V P                  4        V P                  P                  pVP                  R4      p\        P
                  ! RV4      pVf   Q R4       hVP                  4       p\        V4      ^8X  g   Q R4       hV^ ,          P                  RR4      P                  R4      # )zENo equivalent gdb command? Returns a list of supported gdb
features.
rI   z.*features=\[(.*)\].*z"No match found for features stringz$Invalid number of match groups foundr�   Ú Ú,)
r™   r+   rM   r<   rU   rV   ÚgroupsÚlenÚreplaceÚsplit)r   rO   rP   ÚmÚgs   &    r   r4   ÚGdbMIDriver.list_featuresº   s�   € ð 	×ÑÔ!Ø—‘×%Ñ%ˆØ—-‘- Ó(ˆÜ�HŠHÐ.°Ó8ˆØŠ}ÐBÐBÓBˆ}Ø�H‰H‹JˆÜ�1‹v˜Œ{ÐBÐBÓBˆ{Ø��t�|‰|˜C Ó$×*Ñ*¨3Ó/Ð/r    )r+   r   r   r   r   r   r   )Féx   N)rœ   )NNN)NN)r‰   rˆ   rˆ   )r‰   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   r6   r=   rF   rQ   rY   r^   rd   rg   rk   ro   rs   r~   rƒ   r�   r“   r:   r™   r4   Ú__static_attributes__Ú__classdictcell__)Ú__classdict__s   @r   r   r   &   sz   ø‡ € ñôò"	7ò0ò
	Iò)òOòAô&òBòGò#ò
DòDô0ô	1ô8ô8ô?ò8÷0ð 0r    r   )rª   r$   rU   r   ÚunittestÚ
numba.corer   Únumba.misc.gdb_hookr   Únumba.misc.numba_gdbinfor   r   Ú	_gdb_infoÚpy_verÚ
startswithÚ_GDB_HAS_PY3Ú	ExceptionÚ_msgÚ
skipUnlessÚ	needs_gdbÚneeds_gdb_py3r(   r
   ÚImportErrorÚskip_unless_pexpectÚobjectr   © r    r   Ú<module>r¿      sã   ðÙ -Û 	Û 	Û 
Û Ý Ý ,Ý 4ðÙ EÕ*Ø€IÙÓ!€IØ×#Ñ#×.Ñ.¨sÓ3€Lð
 E€Ø×Ò 	¨4Ó0€	à)€Ø×#Ò# L°$Ó7€ðÛØ€Mð
 (€Ø×)Ò)¨-¸Ó>Ð ô_0�&ö _0øð- ô Ø€IØ‚Lðûð ô Ø‚Mðús#   ¦-B& Á>B7 Â&B4Â3B4Â7	CÃC