+
    :i                        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   &&&&& U/var/www/html/photoedit/myenv/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    ww~~doo....$7??&4((C$,,88 sxx}5;;;%(ZZ%6%6DNN" 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    	)NN!!&--!@!!)) 	)3F81=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?    %%--("Nhwi{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^     %%--(%%'*,@	XJa@@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dC((((C($q11Bfc****Cxq/!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>?fc****&34dC((((vQ/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    :6Aa%%!y.88 7&|nAi[*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     	!%%--(HH.8}BBB}HHJ1v{BBB{t||C$**3//r    )r+   r   r   r   r   r   r   )Fx   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3L
 E	40	)##L$7M
 ())-> _0& _0-  IL  Ms#   -B& >B7 &B43B47	CC