Your IP : 216.73.216.213


Current Path : /opt/alt/python311/lib64/python3.11/test/test_gdb/__pycache__/
Upload File :
Current File : //opt/alt/python311/lib64/python3.11/test/test_gdb/__pycache__/test_misc.cpython-311.pyc

�

�0�iX���ddlZddlZddlmZddlmZmZmZmZd�Z	d�Z
e
��Zeje��d��Gd�d	e����Z
d
ZGd�de��ZGd
�de��ZGd�de��ZdS)�N)�python_is_optimized�)�run_gdb�setup_module�
DebuggerTests�
SAMPLE_SCRIPTc�"�t��dS�N)r���>/opt/alt/python311/lib64/python3.11/test/test_gdb/test_misc.py�setUpModulers���N�N�N�N�Nrc���td��\}}tjd|��}|stjd|�d|�d����|�d���d��}d|vS)	Nz+--eval-command=python print(dir(gdb.Frame))z.*\[(.*)\].*z9Unable to parse output from gdb.Frame.select test
stdout=z
stderr=�
rz, z'select')r�re�match�unittest�SkipTest�group�split)�stdout�stderr�m�
gdb_frame_dirs    r
�gdb_has_frame_selectrs����J�K�K�N�F�F�
���&�)�)�A��$���
#��
#�
#��
#�
#�
#�$�$�	$��G�G�A�J�J�$�$�T�*�*�M���&�&r�&Python was compiled with optimizationsc�&�eZdZd�Zd�Zd�Zd�ZdS)�PyListTestsc�2�|�||��dSr
)�assertEndsWith)�self�expected�actuals   r
�
assertListingzPyListTests.assertListings�����F�H�-�-�-�-�-rc�l�|�tdg���}|�d|��dS)z'Verify that the "py-list" command workszpy-list��script�cmds_after_breakpointz�   5    
   6    def bar(a, b, c):
   7        baz(a, b, c)
   8    
   9    def baz(*args):
 >10        id(42)
  11    
  12    foo(1, 2, 3)
N��get_stack_tracerr$�r!�bts  r
�test_basic_commandzPyListTests.test_basic_command!sS��
�
!�
!��9B��"�E�E��	
���4��	�	�	�	�	rc�l�|�tdg���}|�d|��dS)z7Verify the "py-list" command with one absolute argumentz	py-list 9r&zI   9    def baz(*args):
 >10        id(42)
  11    
  12    foo(1, 2, 3)
Nr)r+s  r
�test_one_abs_argzPyListTests.test_one_abs_arg0sS��
�
!�
!��9D�
�"�G�G��	
���4��		�	�	�	�	rc�l�|�tdg���}|�d|��dS)z8Verify the "py-list" command with two absolute argumentszpy-list 1,3r&zO   1    # Sample script for use by test_gdb
   2    
   3    def foo(a, b, c):
Nr)r+s  r
�test_two_abs_argszPyListTests.test_two_abs_args;sS��
�
!�
!��9F��"�I�I��	
���9��	�	�	�	�	rN)�__name__�
__module__�__qualname__r$r-r/r1rrr
rrsP������.�.�.�
�
�
�	�	�	�����rrz�

from _testcapi import pyobject_vectorcall

def foo(a, b, c):
    bar(a, b, c)

def bar(a, b, c):
    pyobject_vectorcall(baz, (a, b, c), None)

def baz(*args):
    id(42)

foo(1, 2, 3)

c�Z�eZdZejed��eje��d��d�����Zejed��d���Z	ejed��d���Z
ejed��eje��d��d�����ZdS)�StackNavigationTests�$test requires py-up/py-down commandsrc�n�|�tddg���}|�|d��dS)z%Verify that the "py-up" command works�py-up��sourcer(z�^.*
#[0-9]+ Frame 0x-?[0-9a-f]+, for file <string>, line 12, in baz \(args=\(1, 2, 3\)\)
#[0-9]+ <built-in method pyobject_vectorcall of module object at remote 0x[0-9a-f]+>
$N�r*�SAMPLE_WITH_C_CALL�assertMultilineMatchesr+s  r
�test_pyup_commandz&StackNavigationTests.test_pyup_commandXsT��
�
!�
!�);�9@�'�8J�"�L�L���#�#�B�%�	�	�	�	�	rc�l�|�tdg���}|�|d��dS)z7Verify handling of "py-down" at the bottom of the stack�py-downr&z$Unable to find a newer python frame
N�r*rr r+s  r
�test_down_at_bottomz(StackNavigationTests.test_down_at_bottomesS���
!�
!��9B��"�E�E�����B�C�	E�	E�	E�	E�	Erc�r�|�tdgdz���}|�|d��dS)z2Verify handling of "py-up" at the top of the stackr9�r&z%Unable to find an older python frame
NrBr+s  r
�test_up_at_topz#StackNavigationTests.test_up_at_topmsW���
!�
!��9@�	�A�
�"�G�G�����B�D�	F�	F�	F�	F�	Frc�n�|�tgd����}|�|d��dS)z$Verify "py-up" followed by "py-down")r9r9rAr:a^.*
#[0-9]+ Frame 0x-?[0-9a-f]+, for file <string>, line 12, in baz \(args=\(1, 2, 3\)\)
#[0-9]+ <built-in method pyobject_vectorcall of module object at remote 0x[0-9a-f]+>
#[0-9]+ Frame 0x-?[0-9a-f]+, for file <string>, line 12, in baz \(args=\(1, 2, 3\)\)
$Nr<r+s  r
�test_up_then_downz&StackNavigationTests.test_up_then_downusU��
�
!�
!�);�8U�8U�8U�"�W�W���#�#�B�%�	�	�	�	�	rN)r2r3r4r�
skipUnless�HAS_PYUP_PYDOWN�skipIfrr?rCrFrHrrr
r6r6Ws �������X���*P�Q�Q��X�_�(�(�*�*�=�?�?���?�?�R�Q���X���*P�Q�Q�E�E�R�Q�E��X���*P�Q�Q�F�F�R�Q�F��X���*P�Q�Q��X�_�(�(�*�*�=�?�?�	�	�?�?�R�Q�	�	�	rr6c�L�eZdZeje��d��d���Zeje��d��ejed��d�����Z	eje��d��d���Z
eje��d��d���ZdS)�PyPrintTestsrc�n�|�tddg���}|�|d��dS)z(Verify that the "py-print" command worksr9z
py-print argsr:z".*\nlocal 'args' = \(1, 2, 3\)\n.*Nr<r+s  r
r-zPyPrintTests.test_basic_command�sW���
!�
!�);�9@�/�8R�"�T�T���#�#�B�$I�	K�	K�	K�	K�	Krr7c�n�|�tgd����}|�|d��dS)N)r9r9z
py-print cz
py-print bz
py-print ar:z3.*\nlocal 'c' = 3\nlocal 'b' = 2\nlocal 'a' = 1\n.*r<r+s  r
�test_print_after_upz PyPrintTests.test_print_after_up�sX���
!�
!�);�8t�8t�8t�"�v�v���#�#�B�$Z�	\�	\�	\�	\�	\rc�n�|�tddg���}|�|d��dS)Nr9zpy-print __name__r&z&.*\nglobal '__name__' = '__main__'\n.*�r*rr>r+s  r
�test_printing_globalz!PyPrintTests.test_printing_global�sW���
!�
!��9@�BU�8V�"�X�X���#�#�B�$M�	O�	O�	O�	O�	Orc�n�|�tddg���}|�|d��dS)Nr9zpy-print lenr&zV.*\nbuiltin 'len' = <built-in method len of module object at remote 0x-?[0-9a-f]+>\n.*rRr+s  r
�test_printing_builtinz"PyPrintTests.test_printing_builtin�sV���
!�
!��9@�.�8Q�"�S�S���#�#�B�$}�	�	�	�	�	rN)r2r3r4rrKrr-rIrJrPrSrUrrr
rMrM�s(�������X�_�(�(�*�*�=�?�?�K�K�?�?�K��X�_�(�(�*�*�=�?�?��X���*P�Q�Q�\�\�R�Q�?�?�\��X�_�(�(�*�*�=�?�?�O�O�?�?�O��X�_�(�(�*�*�=�?�?���?�?���rrMc���eZdZeje��d��d���Zejed��eje��d��d�����Z	dS)�
PyLocalsTestsrc�n�|�tddg���}|�|d��dS)Nr9�	py-localsr&z.*\nargs = \(1, 2, 3\)\n.*rRr+s  r
r-z PyLocalsTests.test_basic_command�sV���
!�
!��9@�+�8N�"�P�P���#�#�B�$A�	C�	C�	C�	C�	Crr7c�n�|�tgd����}|�|d��dS)N)r9r9rYr&z<^.*
Locals for foo
a = 1
b = 2
c = 3
Locals for <module>
.*$rRr+s  r
�test_locals_after_upz"PyLocalsTests.test_locals_after_up�sT���
!�
!��8W�8W�8W�"�Y�Y���#�#�B�%�	�	�	�	�	rN)
r2r3r4rrKrr-rIrJr[rrr
rWrW�s��������X�_�(�(�*�*�=�?�?�C�C�?�?�C��X���*P�Q�Q��X�_�(�(�*�*�=�?�?�
�
�?�?�R�Q�
�
�
rrW)rr�test.supportr�utilrrrrrrrJrKrr=r6rMrWrrr
�<module>r^sl��	�	�	�	�����,�,�,�,�,�,�E�E�E�E�E�E�E�E�E�E�E�E����
'�
'�
'�'�&�(�(�����$�$�&�&�9�;�;�&�&�&�&�&�-�&�&�;�;�&�P��$*�*�*�*�*�=�*�*�*�X!�!�!�!�!�=�!�!�!�F�����M�����r