+
    :i5$                         R t ^ RIHtHt ^ RIHtHtHt ^ RIH	t	H
t
 ^ RIHt ^ RIt^ RIHt ^ RIt^ RIt]]] ! R R]4      4       4       4       t ! R	 R
]4      t]R8X  d   ]P.                  ! 4        R# R# )z8Tests for gdb interacting with the DWARF numba generates)TestCase
linux_only)	needs_gdbskip_unless_pexpectGdbMIDriver)patchMock)	datamodelN)typeofc                   X   a  ] tR t^t o RR/tR tR tR tR tR t	R t
R	 tR
 tRtV tR# )TestGDBDwarf	NUMBA_OPT0c                h    \        \        RR7      pVP                  4       pVP                  4        V# )z6Returns True if gdb has NumPy support, False otherwiseF)debug)r   __file__supports_numpyquit)selfdriver	has_numpys   &  X/var/www/html/photoedit/myenv/lib/python3.14/site-packages/numba/tests/test_gdb_dwarf.py_gdb_has_numpyTestGDBDwarf._gdb_has_numpy   s+    XU4))+	    c                N    R V 2pV P                  VRRV P                  R7       R# )znumba.tests.gdb.Testtest)test_module
test_class	test_nameenvvarsN)subprocess_test_runner_NUMBA_OPT_0_ENV)r   test_modthemods   && r   _subprocess_test_runner$TestGDBDwarf._subprocess_test_runner   s3    #H:.##/5.4,0,A,A 	$ 	Cr   c                (    V P                  R 4       R# )
test_basicNr&   r   s   &r   r)   TestGDBDwarf.test_basic&   s    $$\2r   c                (    V P                  R 4       R# )test_array_argNr*   r+   s   &r   r.   TestGDBDwarf.test_array_arg)   s    $$%56r   c                (    V P                  R 4       R# )test_conditional_breakpointNr*   r+   s   &r   r1   (TestGDBDwarf.test_conditional_breakpoint,   s    $$%BCr   c                (    V P                  R 4       R# )test_break_on_symbolNr*   r+   s   &r   r4   !TestGDBDwarf.test_break_on_symbol/   s    $$%;<r   c                (    V P                  R 4       R# )test_break_on_symbol_versionNr*   r+   s   &r   r7   )TestGDBDwarf.test_break_on_symbol_version2   s    $$%CDr   c                z    V P                  4       '       g   R pV P                  V4       V P                  R4       R# )z"Cannot find gdb with NumPy supporttest_pretty_printN)r   skipTestr&   )r   _msgs   & r   r:   TestGDBDwarf.test_pretty_print5   s1    ""$$7DMM$$$%89r    N)__name__
__module____qualname____firstlineno__r#   r   r&   r)   r.   r1   r4   r7   r:   __static_attributes____classdictcell____classdict__s   @r   r   r      sB      $S)C37D=E: :r   r   c                   \   a  ] tR t^=t o R tR tR tR tR tR t	R t
R tR	 tR
 tRtV tR# )TestGDBPrettyPrinterLogicc                   a R \        4       R\        4       /p\        P                  ! RV4      V n        V P                  P	                  4        ^ RIp ! R R4      pV! 4       oVP                  ! R/ RV3R l/B  R# )	gdbzgdb.printingzsys.modulesNc                   &   a  ] tR t^Tt o R tRtV tR# )9TestGDBPrettyPrinterLogic.setUp.<locals>.SelectedInferiorc                f    \         P                  V,          P                  V4      pVP                  # N)ctc_charfrom_addressraw)r   dataextentbufs   &&& r   read_memoryETestGDBPrettyPrinterLogic.setUp.<locals>.SelectedInferior.read_memoryV   s$    yy6)77=wwr   r>   N)r?   r@   rA   rB   rV   rC   rD   rE   s   @r   SelectedInferiorrL   T   s      r   rX   selected_inferiorc                     < S # rN   r>   )sis   r   <lambda>1TestGDBPrettyPrinterLogic.setUp.<locals>.<lambda>[   s    2r   r>   )r   r   dictpatched_sysstartrJ   configure_mock)r   mock_modulesrJ   rX   r[   s   &   @r   setUpTestGDBPrettyPrinterLogic.setUpC   so    
 tv&0 ::m\B  		 	 ?1:>?r   c                :    V P                   P                  4        R # rN   )r_   stopr+   s   &r   tearDown"TestGDBPrettyPrinterLogic.tearDown]   s    r   c                  a
aa ^ RI Hp  ! R R4      o ! V3R lR4      o ! V3R lR4      o
 ! V
3R lR	4      p\        P                  p\        P                  P                  V\        V4      4      pVP                  4       p\        V4       R
VP                  4        R2pV! W4      pVP                  V4      p	V	P                  4       P                  4       # )    )gdb_print_extensionc                   <   a  ] tR t^mt o R t]R 4       tR tRtV t	R# ):TestGDBPrettyPrinterLogic.get_gdb_repr.<locals>.DISubrangec                    Wn         W n        R # rN   _lo_hir   lohis   &&&r   __init__CTestGDBPrettyPrinterLogic.get_gdb_repr.<locals>.DISubrange.__init__n   s    r   c                    V # rN   r>   r+   s   &r   type?TestGDBPrettyPrinterLogic.get_gdb_repr.<locals>.DISubrange.typer   s    r   c                2    V P                   V P                  3# rN   ro   r+   s   &r   range@TestGDBPrettyPrinterLogic.get_gdb_repr.<locals>.DISubrange.rangev   s    xx))r   rq   rp   N)
r?   r@   rA   rB   ru   propertyrx   r{   rC   rD   rE   s   @r   
DISubrangerm   m   s(       * *r   r   c                   4   <a  ] tR t^yt o R tV3R ltRtV tR# )ATestGDBPrettyPrinterLogic.get_gdb_repr.<locals>.DW_TAG_array_typec                "    WuV n         V n        R # rN   ro   rr   s   &&&r   ru   JTestGDBPrettyPrinterLogic.get_gdb_repr.<locals>.DW_TAG_array_type.__init__z   s    %'"$(r   c                @   < S! V P                   V P                  4      .# rN   ro   )r   r   s   &r   fieldsHTestGDBPrettyPrinterLogic.get_gdb_repr.<locals>.DW_TAG_array_type.fields}   s    "488TXX688r   r}   N)r?   r@   rA   rB   ru   r   rC   rD   )rF   r   s   @r   DW_TAG_array_typer   y   s     ,9 9r   r   c                   D   <a  ] tR t^t o V3R lt]R 4       tR tRtV t	R# )CTestGDBPrettyPrinterLogic.get_gdb_repr.<locals>.DIDerivedType_tuplec                P   < S! ^ \        V4      ^,
          4      V n        Wn        R# )rj   N)len_type_tuple)r   	the_tupler   s   &&r   ru   LTestGDBPrettyPrinterLogic.get_gdb_repr.<locals>.DIDerivedType_tuple.__init__   s    .q#i.12DE
'r   c                    V P                   # rN   )r   r+   s   &r   rx   HTestGDBPrettyPrinterLogic.get_gdb_repr.<locals>.DIDerivedType_tuple.type   s    zz!r   c                (    V P                   V,          # rN   )r   r   items   &&r   __getitem__OTestGDBPrettyPrinterLogic.get_gdb_repr.<locals>.DIDerivedType_tuple.__getitem__   s    {{4((r   )r   r   N)
r?   r@   rA   rB   ru   r~   rx   r   rC   rD   )rF   r   s   @r   DIDerivedType_tupler      s(     ( " ") )r   r   c                      <a  ] tR t^t o R tR t]R 4       t]R 4       t]V3R l4       t	]V3R l4       t
]R 4       tRtV tR	# )
ETestGDBPrettyPrinterLogic.get_gdb_repr.<locals>.DICompositeType_Arrayc                    Wn         W n        R # rN   _arr	_type_str)r   arrtype_strs   &&&r   ru   NTestGDBPrettyPrinterLogic.get_gdb_repr.<locals>.DICompositeType_Array.__init__   s    	!)r   c                    \        W4      # rN   )getattrr   s   &&r   r   QTestGDBPrettyPrinterLogic.get_gdb_repr.<locals>.DICompositeType_Array.__getitem__   s    t**r   c                B    V P                   P                  P                  # rN   )r   ctypesrS   r+   s   &r   rS   JTestGDBPrettyPrinterLogic.get_gdb_repr.<locals>.DICompositeType_Array.data   s    yy'',,,r   c                .    V P                   P                  # rN   )r   itemsizer+   s   &r   r   NTestGDBPrettyPrinterLogic.get_gdb_repr.<locals>.DICompositeType_Array.itemsize   s    yy)))r   c                <   < S! V P                   P                  4      # rN   )r   shaper   r   s   &r   r   KTestGDBPrettyPrinterLogic.get_gdb_repr.<locals>.DICompositeType_Array.shape   s    *499??;;r   c                <   < S! V P                   P                  4      # rN   )r   stridesr   s   &r   r   MTestGDBPrettyPrinterLogic.get_gdb_repr.<locals>.DICompositeType_Array.strides   s    *499+<+<==r   c                    V P                   # rN   )r   r+   s   &r   rx   JTestGDBPrettyPrinterLogic.get_gdb_repr.<locals>.DICompositeType_Array.type   s    ~~%r   r   N)r?   r@   rA   rB   ru   r   r~   rS   r   r   r   rx   rC   rD   )rF   r   s   @r   DICompositeType_Arrayr      ss     *+ - - * * < < > > & &r   r   z ())
numba.miscrk   r	   default_managermodels
ArrayModelr
   get_data_typestructure_reprNumbaArrayPrinter	to_stringstrip)r   arrayrk   r   dmmarray_model	data_typer   fake_gdb_arrprinterr   r   r   s   &&        @@@r   get_gdb_repr&TestGDBPrettyPrinterLogic.get_gdb_repra   s     	3
	* 
	*	9 	9
	) 
	)	& 	&< ''&&11#ve}E--/	Um_By'?'?'A&B!D,U=%77E  "((**r   c                p    V P                  V4      pV P                  \        V4      \        V4      4       R # rN   )r   assertEqualstr)r   r   gdb_printeds   && r   checkTestGDBPrettyPrinterLogic.check   s+    ''.[)3u:6r   c                2   ^p^p\         P                  \         P                  \         P                  \         P                  \         P
                  3 FA  p\         P                  ! W!,          VR7      P                  W!4      pV P                  V4       KC  	  R# )   dtypeN)	npint8uint16int64float32
complex128arangereshaper   )r   nmdtr   s   &    r   *test_np_array_printer_simple_numeric_typesDTestGDBPrettyPrinterLogic.test_np_array_printer_simple_numeric_types   s^    77BIIrxxR]]KB))AE,44Q:CJJsO Lr   c           
        ^p\         P                  P                  ^ 4       \        V4       EFG  p\         P                  P	                  ^^\         P                  P	                  ^^4      R7      p\         P
                  ! \         P                  ! V4      4      P                  V4      p. pV F  p\         P                  P	                  ^ V4      p\         P                  P	                  V^,           \        V^,           V^,           4      4      p\         P                  P	                  ^^4      p	\        WxV	4      p
VP                  V
4       K  	  V\        V4      ,          pV P                  V4       EKJ  	  R# )   )highsizeN)r   randomseedr{   randintr   prodr   maxsliceappendtupler   )r   n_tests_r   tmpslicesxr`   rf   stepstrdr   s   &           r   2test_np_array_printer_simple_numeric_types_stridedLTestGDBPrettyPrinterLogic.test_np_array_printer_simple_numeric_types_strided   s   
		qwAII%%abryy7H7HA7N%OE))BGGEN+33E:CF		))!Q/ yy((C	1q54IJyy((A.U$/d#  eFm$CJJsO!  r   c                p   ^p^p\         P                  ! R\         P                  3R\         P                  3.RR7      p\         P                  ! R\         P                  3R\         P                  3.RR7      pW43 F  p\         P                  ! W!,          VR7      P                  W!4      p\         P                  ! W!,          VR,          R7      P                  W!4      VR&   ^d\         P                  ! W!,          VR,          R7      P                  W!4      ,          VR&   V P                  V4       K  	  R# )r   r   yTalignFr   N)r   r   int16float64emptyr   r   r   )r   r   r   aligned	unalignedr   r   s   &      r   -test_np_array_printer_simple_structured_dtypeGTestGDBPrettyPrinterLogic.test_np_array_printer_simple_structured_dtype   s    ((S"((Oc2::->?tLHHsBHHoRZZ/@AO	&B((15+33A9Cyybg6>>qDCHRYYquBsG<DDQJJCHJJsO	 'r   c                V    \         P                  ! R .4      pV P                  V4       R# )abcdeN)r   r   r   )r   r   s   & r   test_np_array_printer_chr_array9TestGDBPrettyPrinterLogic.test_np_array_printer_chr_array   s    hhy!

3r   c                J   ^p^p\         P                  ! R	R\         P                  3.RR7      p\         P                  ! W!,          VR7      P	                  W!4      pV P                  V4      pV P                  RV4       V P                  RV4       V P                  RV4       R# )
r   r   Tr   r   array[Exception:Unsupported sub-typez[unichr x 5]N)r   z<U5)r   r   r   zerosr   r   assertInr   r   r   r   r   reps   &     r   -test_np_array_printer_unichr_structured_dtypeGTestGDBPrettyPrinterLogic.test_np_array_printer_unichr_structured_dtype   s    XX|c2::%67tDhhquB'//5$(#.,c2nc*r   c                l   ^p^p\         P                  ! R\         P                  R
3R\         P                  3.RR7      p\         P                  ! W!,          VR7      P                  W!4      pV P                  V4      pV P                  RV4       V P                  RV4       V P                  RV4       R	# )r   r   r   Tr   r   r  r  znestedarray(int16N)   )r   r   r   r   r  r   r   r  r  s   &     r   3test_np_array_printer_nested_array_structured_dtypeMTestGDBPrettyPrinterLogic.test_np_array_printer_nested_array_structured_dtype   s    XXRXXt,sBJJ.?@MhhquB'//5$(#.,c2)3/r   )r_   N)r?   r@   rA   rB   rc   rg   r   r   r   r   r   r   r  r  rC   rD   rE   s   @r   rH   rH   =   s?     @4 Q+f7.

+
0 
0r   rH   __main__)__doc__numba.tests.supportr   r   numba.tests.gdb_supportr   r   r   unittest.mockr   r   
numba.corer	   numpyr   numbar
   r   rO   unittestr   rH   r?   mainr>   r   r   <module>r     sv    > 4 O O %       
+:8 +:   +:\D0 D0N zMMO r   