HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.10/test/__pycache__/test_gdb.cpython-310.opt-2.pyc
o

�iҦ�@s ddlZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZmZdd�Z
e
�\ZZZedkrFe�deeef��e��sOe�d��d	e��vr_ejd
kr_e�d��e�d�ped
e�d�pkdvrre�d��ej�ej�ej�d�ZdZdd�Ze�Zdd�Zed�\ZZes�e�d��edej�\ZZ de vr�dZ!e�e!e �"���dd�Z#e#�Z$dZ%e�&e	j'd�Gd d!�d!ej(��Z)Gd"d#�d#e)�Z*e�&e�d$�Gd%d&�d&e)��Z+Gd'd(�d(e)�Z,Gd)d*�d*e)�Z-Gd+d,�d,e)�Z.Gd-d.�d.e)�Z/d/d0�Z0e1d1k�re�2�dSdS)2�N)�support)�findfile�python_is_optimizedc	Cs�z@gd�}tj|tjtjdd�}|�|��\}}Wd�n1s#wY|jr?tdd�|��d|j�d|�d|����WntyLt�	d	��wt
�d
|�}|dur]td|��|t|�
d��t|�
d
��fS)N)�gdb�-nxz	--versionT)�stdout�stderr�universal_newlineszCommand � z failed with exit code z	: stdout=z stderr=zCouldn't find gdb on the pathz ^(?:GNU|HP) gdb.*?\b(\d+)\.(\d+)zunable to parse GDB version: %r��)�
subprocess�Popen�PIPE�communicate�
returncode�	Exception�join�OSError�unittest�SkipTest�re�search�int�group)�cmd�proc�versionr�match�r�*/usr/local/lib/python3.10/test/test_gdb.py�get_gdb_versions4������
�r!�zFgdb versions before 7.0 didn't support python embedding. Saw %s.%s:
%sz3test_gdb only works on source builds at the moment.ZClang�darwinzDtest_gdb doesn't work correctly when python is built with LLVM clangZPGO_PROF_USE_FLAGZxxxZPY_CORE_CFLAGS�z&test_gdb is not reliable on PGO buildsz
python-gdb.pyZ123cCs4t�d�}|s	dS|��}d|votdd�|D��S)NZCFLAGSFz-mcetcss&�|]}|�d�o|�d�VqdS)z-fcf-protection)z=nonez=returnN)�
startswith�endswith)�.0�flagrrr �	<genexpr>Qs�
�

�z!cet_protection.<locals>.<genexpr>)�	sysconfig�get_config_var�split�any)Zcflags�flagsrrr �cet_protectionIs
��r/cOs�	|rtj��}|�|�nd}d}ttfdkr |ddtf7}tj||tj	tj	tj	|d�}|�|�
�\}}Wd�n1sBwY|�dd�|�dd�fS)N)rz--batchr�r"�z-iexzadd-auto-load-safe-path )�stdinrr�envzutf-8�replace)�os�environ�copy�update�gdb_major_version�gdb_minor_version�checkout_hook_pathr
rrr�decode)�argsZenv_varsr3Zbase_cmdr�out�errrrr �run_gdbYs$

��r@z9--eval-command=python import sys; print(sys.version_info)z*gdb not built with embedded python support�--argszauto-loading has been declinedz3gdb security settings prevent use of custom hooks: cCs>td�\}}t�d|�}|st�d��|�d��d�}d|vS)Nz+--eval-command=python print(dir(gdb.Frame))z.*\[(.*)\].*z1Unable to parse output from gdb.Frame.select testrz, z'select')r@rrrrrr,)r�_�mZ
gdb_frame_dirrrr �gdb_has_frame_selects
rD�
builtin_idznot useful for PGOc@sJeZdZ	ddedddfdd�Z		d
dd�Zdd�Zd	d
�Zdd�ZdS)�
DebuggerTestsNFc
Cs	dd|ddg}ttfdkr|dg7}|r"tr|dg7}||7}n|dg7}d	d
�|D�}|dtjg7}|�t���|sC|dg7}|rL|d
|g7}n|rS||g7}t|dt	i�\}	}
|sl|
�
�D]	}t|tjd�qbd|
vrut
�d��dD]}||	vr�t
�|�d���qw|	S)Nzset breakpoint pending yeszbreak %szset print address off�runr0zset print entry-values no�next�	backtracecSsg|]}d|�qS)z--eval-command=%sr)r'rrrr �
<listcomp>�sz1DebuggerTests.get_stack_trace.<locals>.<listcomp>rAz-Sz-c�PYTHONHASHSEED)�filezPC not savedzKgdb cannot walk the frame object because the Program Counter is not present)z!(frame information optimized out)z*Unable to read information on python framez found in gdb output)r9r:�CET_PROTECTION�sys�
executable�extendr
�_args_from_interpreter_flagsr@rK�
splitlines�printrrr)
�self�source�script�
breakpoint�cmds_after_breakpoint�import_site�
ignore_stderr�commandsr=r>r?�line�patternrrr �get_stack_trace�sF
�



�


�zDebuggerTests.get_stack_tracecCsP|pdg}|j|t||d�}t�d|tj�}|s!|�d||f�|�d�|fS)Nzbacktrace 1)rWrXrYzS#0\s+builtin_id\s+\(self\=.*,\s+v=\s*(.*?)?\)\s+at\s+\S*[A-Za-z]+/[A-Za-z0-9_-]+\.czUnexpected gdb output: %r
%sr)r^�
BREAKPOINT_FNrr�DOTALL�failr)rTrUrXrY�
gdb_outputrCrrr �get_gdb_repr�s
��	zDebuggerTests.get_gdb_reprcCs"	|j|�|�d||fd�dS)Nz%r did not end with %r��msg)�
assertTruer&)rT�actualZexp_endrrr �assertEndsWith!s

�zDebuggerTests.assertEndsWithcCs0t�||tj�}|s|jd||fd�dSdS)Nz%r did not match %rrd)rrr`ra)rTrgr]rCrrr �assertMultilineMatches&s�z$DebuggerTests.assertMultilineMatchescCstd�S)Nz
gdb_sample.py)r�rTrrr �get_sample_script+szDebuggerTests.get_sample_script)NF)	�__name__�
__module__�__qualname__r_r^rcrhrirkrrrr rF�s
�m
�$rFc@s�eZdZdd�Zd<dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd<d d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�ZdS)=�PrettyPrintTestscCs|�d�}|�t|v�dS)N�id(42))r^rfr_�rTrbrrr �test_getting_backtrace/s
z'PrettyPrintTests.test_getting_backtraceNcCsB|�dt|�d�\}}|st|�}|�||d|||f�dS)Nzid(�)z1%r did not equal expected %r; full output was:
%s)rc�ascii�repr�assertEqual)rT�valZexp_repr�gdb_reprrbrrr �
assertGdbRepr3s��zPrettyPrintTests.assertGdbReprcCs8	|�d�|�d�|�d�|�d�|�d�dS)N�*ri����lJ)�l�����I�5�ryrjrrr �test_int=s



zPrettyPrintTests.test_intcCs$	|�d�|�d�|�d�dS)NTFr{rjrrr �test_singletonsEs

z PrettyPrintTests.test_singletonscCs2	|�i�|�ddid�|�ddd�d�dS)N�foo�barz{'foo': 'bar'}rz)r~Zdouglasz{'foo': 'bar', 'douglas': 42}r{rjrrr �
test_dictsKs
zPrettyPrintTests.test_dictscCs"	|�g�|�ttd���dS)N�)ry�list�rangerjrrr �
test_listsRs
zPrettyPrintTests.test_listscCsT	|�d�|�d�|�d�|�d�|�d�|�tdd�td�D���dS)	N�s(And now for something hopefully the sames7string with embedded NUL here  and then some more texts7this is a tab:	 this is a slash-N:
 this is a slash-R:
s!this is byte 255:� and byte 128:�cSsg|]}|�qSrr)r'�brrr rJcsz/PrettyPrintTests.test_bytes.<locals>.<listcomp>�)ry�bytesr�rjrrr �
test_bytesWs




 zPrettyPrintTests.test_bytescsz	tdd�\}}|���|s�std|������fdd�}��d���d���d�|d	�|d
�|td��dS)Nz--eval-commandz:python import locale; print(locale.getpreferredencoding())zFunable to determine the preferred encoding of embedded Python in GDB: csBz|���Wnty��|t|��YdSw��|�dS�N)�encode�UnicodeEncodeErrorryrt)�text��encodingrTrr �
check_reprus�z1PrettyPrintTests.test_strings.<locals>.check_reprr$z(And now for something hopefully the samez7string with embedded NUL here  and then some more textu☠u文字化けi!�)r@�rstrip�RuntimeErrorry�chr)rTr>r?r�rr�r �test_stringses&���


zPrettyPrintTests.test_stringscCs*	|�t�d�|�dd�|�d�dS)Nz())rz(1,))r~rZbaz)ry�tuplerjrrr �test_tuples�szPrettyPrintTests.test_tuplescCs�	ttfdkr|�d�|�t�d�|�tdg�d�tjjs4|�tddg�d�|�tgd��d	�|�d
�\}}|�	|d�dS)N�r"�z.pretty-printing of sets needs gdb 7.3 or laterzset()�az{'a'}r�z
{'a', 'b'}�r1r��z	{4, 5, 6}z&s = set(['a','b'])
s.remove('a')
id(s)z{'b'})
r9r:�skipTestry�setrNr.�ignore_environmentrcrv�rTrxrbrrr �	test_sets�s
zPrettyPrintTests.test_setscCsp	ttfdkr|�d�|�t�d�|�tdg�d�tjjs6|�tddg�d�|�tgd��d	�dSdS)
Nr�z4pretty-printing of frozensets needs gdb 7.3 or laterzfrozenset()r�zfrozenset({'a'})r�zfrozenset({'a', 'b'})r�zfrozenset({4, 5, 6}))r9r:r�ry�	frozensetrNr.r�rjrrr �test_frozensets�s
�z PrettyPrintTests.test_frozensetscCs8|�d�\}}|�|d�|�d�\}}|�|d�dS)NzR
try:
    raise RuntimeError("I am an error")
except RuntimeError as e:
    id(e)
zRuntimeError('I am an error',)z=
try:
    a = 1 / 0
except ZeroDivisionError as e:
    id(e)
z&ZeroDivisionError('division by zero',)�rcrvr�rrr �test_exceptions�s��z PrettyPrintTests.test_exceptionscC�2	|�d�\}}t�d|�}|j|d|d�dS)Nz8
class Foo:
    pass
foo = Foo()
foo.an_int = 42
id(foo)�*<Foo\(an_int=42\) at remote 0x-?[0-9a-f]+>�'Unexpected new-style class rendering %rrd�rcrrrf�rTrxrbrCrrr �test_modern_class�s
�z"PrettyPrintTests.test_modern_classcCr�)NzO
class Foo(list):
    pass
foo = Foo()
foo += [1, 2, 3]
foo.an_int = 42
id(foo)r�r�rdr�r�rrr �test_subclassing_list�s
�z&PrettyPrintTests.test_subclassing_listcCr�)NzH
class Foo(tuple):
    pass
foo = Foo((1, 2, 3))
foo.an_int = 42
id(foo)r�r�rdr�r�rrr �test_subclassing_tuple�s
�z'PrettyPrintTests.test_subclassing_tuplec	Csf	|r|dg}ndg}|j||d�\}}|r||krdSd}t�||�}|s1|�d||f�dSdS)NrI�rXz<.* at remote 0x-?[0-9a-f]+>�$Unexpected gdb representation: %r
%s)rcrrra)	rTrUZ
corruption�expreprrXrxrbr]rCrrr �
assertSane�s$
��
��zPrettyPrintTests.assertSanecCs(	|jdddgd�\}}|�|d�dS)Nrpzset variable v=0rIr�Z0x0r�r�rrr �
test_NULL_ptrs���zPrettyPrintTests.test_NULL_ptrcCs	|�dd�dS)Nrpzset v->ob_type=0�r�rjrrr �test_NULL_ob_types�z"PrettyPrintTests.test_NULL_ob_typecC�	|jdddd�dS)Nrpzset v->ob_type=0xDEADBEEF�42�r�r�rjrrr �test_corrupt_ob_type�

�z%PrettyPrintTests.test_corrupt_ob_typecCr�)Nrpzset v->ob_type->tp_flags=0x0r�r�r�rjrrr �test_corrupt_tp_flags%r�z&PrettyPrintTests.test_corrupt_tp_flagscCr�)Nrpz"set v->ob_type->tp_name=0xDEADBEEFr�r�r�rjrrr �test_corrupt_tp_name+r�z%PrettyPrintTests.test_corrupt_tp_namecCsH	tjjr
|�d�|jddd�\}}t�d|�}|j|d|d�dS)Nz(need site module, but -S option was usedzid(__builtins__.help)T)rYz!<_Helper at remote 0x-?[0-9a-f]+>zUnexpected rendering %rrd)rNr.�no_siter�rcrrrfr�rrr �test_builtins_help1s

�z#PrettyPrintTests.test_builtins_helpcCs:	|�d�\}}|�|d�|�d�\}}|�|d�dS)Nz#a = [3, 4, 5] ; a.append(a) ; id(a)z[3, 4, 5, [...]]z-a = [3, 4, 5] ; b = [a] ; a.append(b) ; id(a)z[3, 4, 5, [[...]]]r�r�rrr �test_selfreferential_list?s��z*PrettyPrintTests.test_selfreferential_listcCs 	|�d�\}}|�|d�dS)Nz-a = {} ; b = {'bar':a} ; a['foo'] = b ; id(a)z{'foo': {'bar': {...}}}r�r�rrr �test_selfreferential_dictJs�z*PrettyPrintTests.test_selfreferential_dictcC�.|�d�\}}|�t�d|�d||f�dS)Nz:
class Foo:
    pass
foo = Foo()
foo.an_attr = foo
id(foo)�1<Foo\(an_attr=<\.\.\.>\) at remote 0x-?[0-9a-f]+>r��rcrfrrr�rrr �'test_selfreferential_old_style_instanceRs�
���z8PrettyPrintTests.test_selfreferential_old_style_instancecCsX|�d�\}}|�t�d|�d||f�|�d�\}}|�t�d|�d||f�dS)NzB
class Foo(object):
    pass
foo = Foo()
foo.an_attr = foo
id(foo)r�r�zR
class Foo(object):
    pass
a = Foo()
b = Foo()
a.an_attr = b
b.an_attr = a
id(a)zZ<Foo\(an_attr=<Foo\(an_attr=<\.\.\.>\) at remote 0x-?[0-9a-f]+>\) at remote 0x-?[0-9a-f]+>r�r�rrr �'test_selfreferential_new_style_instance_s$�
����
	���z8PrettyPrintTests.test_selfreferential_new_style_instancecCs8	|�d�\}}|�|d�|�t|�dtd��dS)Nzid(list(range(1000)))a[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226...(truncated)iz...(truncated))rcrv�lenr�rrr �test_truncationzs�

�z PrettyPrintTests.test_truncationcCr�)Nz$import sys; id(sys.stdout.readlines)zO<built-in method readlines of _io.TextIOWrapper object at remote 0x-?[0-9a-f]+>r�r�r�rrr �test_builtin_method�s
���z$PrettyPrintTests.test_builtin_methodcCs6|jdddgd�}|�t�d|tj�d||f�dS)Nz:
def foo(a, b, c):
    pass

foo(3, 4, 5)
id(foo.__code__)rEz:print (PyFrameObject*)(((PyCodeObject*)v)->co_zombieframe))rWrXzM.*\s+\$1 =\s+Frame 0x-?[0-9a-f]+, for file <string>, line 3, in foo \(\)\s+.*r�)r^rfrrr`rqrrr �test_frames�s�
	�
�zPrettyPrintTests.test_framesr�) rlrmrnrrryr|r}r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrr ro.s<

,


ro�&Python was compiled with optimizationsc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�PyListTestscCs|�||�dSr�)rh)rTZexpectedrgrrr �
assertListing�szPyListTests.assertListingcC�&	|j|��dgd�}|�d|�dS)Nzpy-list�rVrXz�   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)
�r^rkr��rT�btrrr �test_basic_command�s
��zPyListTests.test_basic_commandcCr�)Nz	py-list 9r�zI   9    def baz(*args):
 >10        id(42)
  11    
  12    foo(1, 2, 3)
r�r�rrr �test_one_abs_arg�s
��zPyListTests.test_one_abs_argcCr�)Nzpy-list 1,3r�zR   1    # Sample script for use by test_gdb.py
   2    
   3    def foo(a, b, c):
r�r�rrr �test_two_abs_args�s
��zPyListTests.test_two_abs_argsN)rlrmrnr�r�r�r�rrrr r��s
r�c@sxeZdZe�ed�e�e�d�dd���Ze�ed�dd��Z	e�ed�dd��Z
e�ed�e�e�d�d	d
���ZdS)�StackNavigationTests�$test requires py-up/py-down commandsr�cCs(	|j|��ddgd�}|�|d�dS)N�py-upr�zp^.*
#[0-9]+ Frame 0x-?[0-9a-f]+, for file .*gdb_sample.py, line 7, in bar \(a=1, b=2, c=3\)
    baz\(a, b, c\)
$�r^rkrir�rrr �test_pyup_command��
��z&StackNavigationTests.test_pyup_commandcC�&	|j|��dgd�}|�|d�dS)N�py-downr�z$Unable to find a newer python frame
�r^rkrhr�rrr �test_down_at_bottom�s
��z(StackNavigationTests.test_down_at_bottomcCs*	|j|��dgdd�}|�|d�dS)Nr�r�r�z%Unable to find an older python frame
r�r�rrr �test_up_at_top�s
��z#StackNavigationTests.test_up_at_topcCs(	|j|��gd�d�}|�|d�dS)N)r�r�r�r�z�^.*
#[0-9]+ Frame 0x-?[0-9a-f]+, for file .*gdb_sample.py, line 7, in bar \(a=1, b=2, c=3\)
    baz\(a, b, c\)
#[0-9]+ Frame 0x-?[0-9a-f]+, for file .*gdb_sample.py, line 10, in baz \(args=\(1, 2, 3\)\)
    id\(42\)
$r�r�rrr �test_up_then_down�r�z&StackNavigationTests.test_up_then_downN)rlrmrnr�
skipUnless�HAS_PYUP_PYDOWN�skipIfrr�r�r�r�rrrr r��s
�





�r�c@s�eZdZe�e�d�dd��Ze�e�d�dd��Zdd�Ze�e�d�dd	��Z	e�e�d�d
d��Z
e�e�d�dd
��ZdS)�	PyBtTestsr�cCr�)N�py-btr�aF^.*
Traceback \(most recent call first\):
  <built-in method id of module object .*>
  File ".*gdb_sample.py", line 10, in baz
    id\(42\)
  File ".*gdb_sample.py", line 7, in bar
    baz\(a, b, c\)
  File ".*gdb_sample.py", line 4, in foo
    bar\(a, b, c\)
  File ".*gdb_sample.py", line 12, in <module>
    foo\(1, 2, 3\)
r�r�rrr �test_bt�
��zPyBtTests.test_btcCr�)N�
py-bt-fullr�a>^.*
#[0-9]+ Frame 0x-?[0-9a-f]+, for file .*gdb_sample.py, line 7, in bar \(a=1, b=2, c=3\)
    baz\(a, b, c\)
#[0-9]+ Frame 0x-?[0-9a-f]+, for file .*gdb_sample.py, line 4, in foo \(a=1, b=2, c=3\)
    bar\(a, b, c\)
#[0-9]+ Frame 0x-?[0-9a-f]+, for file .*gdb_sample.py, line 12, in <module> \(\)
    foo\(1, 2, 3\)
r�r�rrr �test_bt_fullr�zPyBtTests.test_bt_fullcCsB	d}|j|dgd�}|�d|�|j|dgd�}|�d|�dS)NaN
from threading import Thread

class TestThread(Thread):
    # These threads would run forever, but we'll interrupt things with the
    # debugger
    def run(self):
        i = 0
        while 1:
             i += 1

t = {}
for i in range(4):
   t[i] = TestThread()
   t[i].start()

# Trigger a breakpoint on the main thread
id(42)

zthread apply all py-btr�zWaiting for the GILzthread apply all py-bt-full�r^�assertIn�rTrrbrrr �test_threads(s��zPyBtTests.test_threadscCsF	d}|j|gd�d�}|�d|�|j|gd�d�}|�d|�dS)NzRfrom gc import collect
id(42)
def foo():
    collect()
def bar():
    foo()
bar()
)�break update_refs�continuer�r�zGarbage-collecting)r�r�r�r�r�rrr �test_gcHs��zPyBtTests.test_gccCs�	dD]]\}}}dD]U}|�|�d|����At�d|�d|�d|�d��}|j||ddgd	d
�}|�d|��|�|j||dgd	d
�}|�d
|�d|��|�Wd�n1sZwYq
qdS)N))Zmeth_varargsr$r)Zmeth_varargs_keywordsr$r)Zmeth_oz[]r)Zmeth_noargsr$r)Z
meth_fastcallr$r)Zmeth_fastcall_keywordsr$r)Z	_testcapiz_testcapi.MethClassz_testcapi.MethClass()z_testcapi.MethStatic()�.zi
                        import _testcapi
                        def foo():
                            �(zy)
                        def bar():
                            foo()
                        bar()
                    r�r�T)rWrXrZz<built-in method r��#z <built-in method )ZsubTest�textwrap�dedentr^r�)rT�	func_namer=Zexpected_frame�objrrbrrr �test_pycfunctioncs@	��
�	�������zPyBtTests.test_pycfunctioncCsHt�d�}ddg}tr|�d�|�d�|j||d�}|�|d�dS)Nz�
            class MyList(list):
                def __init__(self):
                    super().__init__()   # wrapper_call()

            id("first break point")
            l = MyList()
        zbreak wrapper_callr�rHr�r�z1<method-wrapper u?'__init__' of MyList object at )r�r�rM�appendr^ZassertRegex)rTrrXrbrrr �test_wrapper_call�s


��zPyBtTests.test_wrapper_callN)rlrmrnrr�rr�r�r�r�r�r�rrrr r�s,�
�
 �
�
7�r�c@speZdZe�e�d�dd��Ze�e�d�e�ed�dd���Z	e�e�d�dd��Z
e�e�d�d	d
��ZdS)�PyPrintTestsr�cCs(	|j|��ddgd�}|�|d�dS)Nr�z
py-print argsr�z".*\nlocal 'args' = \(1, 2, 3\)\n.*r�r�rrr r��s
��zPyPrintTests.test_basic_commandr�cC�&|j|��gd�d�}|�|d�dS)N)r�r�z
py-print cz
py-print bz
py-print ar�z3.*\nlocal 'c' = 3\nlocal 'b' = 2\nlocal 'a' = 1\n.*r�r�rrr �test_print_after_up��
��z PyPrintTests.test_print_after_upcC�&|j|��ddgd�}|�|d�dS)Nr�zpy-print __name__r�z&.*\nglobal '__name__' = '__main__'\n.*r�r�rrr �test_printing_global��
��z!PyPrintTests.test_printing_globalcCr�)Nr�zpy-print lenr�zV.*\nbuiltin 'len' = <built-in method len of module object at remote 0x-?[0-9a-f]+>\n.*r�r�rrr �test_printing_builtin�r�z"PyPrintTests.test_printing_builtinN)rlrmrnrr�rr�r�r�r�r�rrrrr r��s$�
�
�
�r�c@sDeZdZe�e�d�dd��Ze�ed�e�e�d�dd���Z	dS)�
PyLocalsTestsr�cCr�)Nr��	py-localsr�z.*\nargs = \(1, 2, 3\)\n.*r�r�rrr r��r�z PyLocalsTests.test_basic_commandr�cCr�)N)r�r�rr�z.*\na = 1\nb = 2\nc = 3\n.*r�r�rrr �test_locals_after_up�r�z"PyLocalsTests.test_locals_after_upN)
rlrmrnrr�rr�r�r�rrrrr r�s�

�rcCs8tjrtdttf�t��D]
}td|�qdSdS)NzGDB version %s.%s:z    )r�verboserSr9r:�gdb_versionrR)r\rrr �setUpModule�s�r�__main__)3r5�platformrr
rNr*r�r�testrZtest.supportrrr!rr9r:rZis_python_buildZpython_compilerr+�pathr�dirnamerOr;rKr/rMr@Z
gdbpy_versionrBZgdbpy_errorsrer�rDr�r_r�ZPGOZTestCaserFror�r�r�r�rrrl�mainrrrr �<module>s~��

�
�

	"�(-=#
�