Your IP : 216.73.216.213


Current Path : /opt/alt/python33/lib64/python3.3/test/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/test/__pycache__/test_gdb.cpython-33.pyo

�
��fs�c@s.ddlZddlZddlZddlZddlZddlZddlZyddlZWnek
r~e	ZYnXddl
mZmZm
Z
y.ejddgdej�j�\ZZWn!ek
r�ejd��YnXejde�Zeejd��Zeejd	��Zed
krWejdejdd
���nej�rvejd��nejjejjej �d�Z!dd�Z"e"d�\Z#Ze#r�ejd��ndej gZ$e"dej �\ZZ%de%kr&dZ&eje&e%j'���ndd�Z(e(�Z)dd�Z*e*�Z+dZ,Gdd�dej-�Z.Gdd�de.�Z/ej0e
�d �Gd!d"�d"e.��Z1Gd#d$�d$e.�Z2Gd%d&�d&e.�Z3Gd'd(�d(e.�Z4Gd)d*�d*e.�Z5d+d,�Z6e7d-kr*e6�ndS(.iN(urun_unittestufindfileupython_is_optimizedugdbu	--versionustdoutuCouldn't find gdb on the paths^GNU gdb [^\d]*(\d+)\.(\d)iiiu=gdb versions before 7.0 didn't support python embedding Saw:
uasciiureplaceu3test_gdb only works on source builds at the moment.u
python-gdb.pycOs�|r%tjj�}|j|�nd}d
}ttfdkrZ|ddtf7}ntj	||dtj
dtj
d	|�j�\}}|jd
d�|jd
d�fS(u�Runs gdb in --batch mode with the additional arguments given by *args.

    Returns its (stdout, stderr) decoded from utf-8 using the replace handler.
    ugdbu--batchiiu-iexuadd-auto-load-safe-path ustdoutustderruenvuutf-8ureplaceN(ugdbu--batch(ii(
uosuenvironucopyuupdateuNoneugdb_major_versionugdb_minor_versionucheckout_hook_pathu
subprocessuPopenuPIPEucommunicateudecode(uargsuenv_varsuenvubase_cmduoutuerr((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyurun_gdb+s'urun_gdbu9--eval-command=python import sys; print(sys.version_info)u*gdb not built with embedded python supportu--argsuauto-loading has been declinedu3gdb security settings prevent use of custom hooks: cCs^td�\}}tjd|�}|s<tjd��n|jd�jd�}d|kS(Nu+--eval-command=python print(dir(gdb.Frame))u.*\[(.*)\].*u1Unable to parse output from gdb.Frame.select testiu, u'select'(urun_gdbureumatchuunittestuSkipTestugroupusplit(ustdoutu_umu
gdb_frame_dir((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyugdb_has_frame_selectJsugdb_has_frame_selectcCsCd}tjdd|gdtj�}|j�\}}d|kS(Nu(--eval-command=set auto-load safe-path /ugdbu--batchustderrs"on" or "off" expected.(u
subprocessuPopenuPIPEucommunicate(ucmdupu_ustderr((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyugdb_has_autoload_safepathUs
ugdb_has_autoload_safepathu
builtin_idcBsk|EeZdZdZddedd
dd�Zdd
dd�Zdd�Z	dd	�Z
d
d�ZdS(u
DebuggerTestsu(Test that the debugger can debug Python.cCswdd|ddg}tr(dg}ng}|rA||7}n
|dg7}ddg}|d	d
�|D�7}|dd
�|D�7}|dtjg7}|s�|d
g7}n|r�|d|g7}n|r�||g7}ntdd|�\}	}
|
j�}g}d|ddddddf}
|
d7}
x-|D]%}|j|
�s:|j|�q:q:W|j|g�|	S(u�
        Run 'python -c SOURCE' under gdb with a breakpoint.

        Support injecting commands after the breakpoint is reached

        Returns the stdout from gdb

        cmds_after_breakpoint: if provided, a list of strings: gdb commands
        uset breakpoint pending yesubreak %suset print entry-values nourunuset auto-load safe-path /u	backtraceugdbu--batchcSsg|]}d|�qS(u--init-eval-command=%s((u.0ucmd((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyu
<listcomp>�s	u1DebuggerTests.get_stack_trace.<locals>.<listcomp>cSsg|]}d|�qS(u--eval-command=%s((u.0ucmd((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyu
<listcomp>�s	u--argsu-Su-cuPYTHONHASHSEEDu0uFunction "%s" not defined.uLwarning: no loadable sections found in added symbol-file system-supplied DSOupwarning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.uLwarning: Cannot initialize thread debugging library: Debugger service failedu@warning: Could not load shared library symbols for linux-vdso.sou@warning: Could not load shared library symbols for linux-gate.sou5Do you need "set solib-search-path" or "set sysroot"?uwarning: Unable to openuMissing separate debuginfo foruTry: yum --disablerepo=uUndefined set print command(uwarning: Unable to openuMissing separate debuginfo foruTry: yum --disablerepo=uUndefined set print command(uHAS_AUTOLOAD_SAFEPATHusysu
executableurun_gdbu
splitlinesu
startswithuappenduassertEqual(uselfusourceuscriptu
breakpointucmds_after_breakpointuimport_siteucommandsu
init_commandsuargsuoutuerruerrlinesuunexpected_errlinesuignore_patternsuline((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyuget_stack_tracehsP	


	
uDebuggerTests.get_stack_tracec	Cs{|pdg}|j|dtd|d|�}tjd|tj�}|sh|jd||f�n|jd�|fS(Nubacktrace 1u
breakpointucmds_after_breakpointuimport_siteuO.*#0\s+builtin_id\s+\(self\=.*,\s+v=\s*(.*?)\)\s+at\s+\S*Python/bltinmodule.c.*uUnexpected gdb output: %r
%si(uget_stack_traceu
BREAKPOINT_FNureumatchuDOTALLufailugroup(uselfusourceucmds_after_breakpointuimport_siteu
gdb_outputum((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyuget_gdb_repr�s		uDebuggerTests.get_gdb_reprcCs*|j|j|�dd||f�dS(u9Ensure that the given "actual" string ends with "exp_end"umsgu%r did not end with %rN(u
assertTrueuendswith(uselfuactualuexp_end((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyuassertEndsWith�suDebuggerTests.assertEndsWithcCs?tj||tj�}|s;|jdd||f�ndS(Numsgu%r did not match %r(ureumatchuDOTALLufail(uselfuactualupatternum((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyuassertMultilineMatches�su$DebuggerTests.assertMultilineMatchescCs
td�S(Nu
gdb_sample.py(ufindfile(uself((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyuget_sample_script�suDebuggerTests.get_sample_scriptNF(u__name__u
__module__u__qualname__u__doc__uNoneu
BREAKPOINT_FNuFalseuget_stack_traceuget_gdb_repruassertEndsWithuassertMultilineMatchesuget_sample_script(u
__locals__((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyu
DebuggerTestsdsnu
DebuggerTestscBsv|EeZdZdd�Zd;dd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd;dd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Z d;S(<uPrettyPrintTestscCs&|jd�}|jt|k�dS(Nuid(42)(uget_stack_traceu
assertTrueu
BREAKPOINT_FN(uselfu
gdb_output((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyutest_getting_backtracesu'PrettyPrintTests.test_getting_backtracecCs\|jdt|�d�\}}|s8t|�}n|j||d|||f�dS(Nuid(u)u1%r did not equal expected %r; full output was:
%s(uget_gdb_repruasciiurepruassertEqual(uselfuvaluexp_reprugdb_repru
gdb_output((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyu
assertGdbReprs#uPrettyPrintTests.assertGdbReprcCsE|jd�|jd�|jd�|jd�|jd�dS(	u0Verify the pretty-printing of various int valuesi*iilJ)�l�I�5Ni����l�����I�5(u
assertGdbRepr(uself((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyutest_ints




uPrettyPrintTests.test_intcCs+|jd�|jd�|jd�dS(u2Verify the pretty-printing of True, False and NoneNTF(u
assertGdbRepruTrueuFalseuNone(uself((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyutest_singletonss

u PrettyPrintTests.test_singletonscCsC|ji�|jidd6�|jidd6dd6d�dS(u*Verify the pretty-printing of dictionariesubarufooi*udouglasu{'foo': 'bar', 'douglas': 42}N(u
assertGdbRepr(uself((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyu
test_dictss
uPrettyPrintTests.test_dictscCs*|jg�|jttd���dS(u#Verify the pretty-printing of listsiN(u
assertGdbReprulisturange(uself((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyu
test_lists&s
uPrettyPrintTests.test_listscCsk|jd�|jd�|jd�|jd�|jd�|jtdd�td�D���d	S(
u#Verify the pretty-printing of bytesss(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|]}|�qS(((u.0ub((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyu
<listcomp>7s	u/PrettyPrintTests.test_bytes.<locals>.<listcomp>i�N(u
assertGdbReprubytesurange(uself((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyu
test_bytes+s




uPrettyPrintTests.test_bytescsptj����fdd�}�jd��jd��jd�|d�|d�|td��d	S(
u-Verify the pretty-printing of unicode stringscsSy|j��d}Wn(tk
rA�j|t|��YnX�j|�dS(NT(uencodeuTrueuUnicodeEncodeErroru
assertGdbRepruascii(utextu	printable(uencodinguself(u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyu
check_repr<s


u1PrettyPrintTests.test_strings.<locals>.check_repruu(And now for something hopefully the sameu7string with embedded NUL here  and then some more textu☠u文字化けi!�N(ulocaleugetpreferredencodingu
assertGdbRepruchr(uselfu
check_repr((uencodinguselfu2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyutest_strings9s	




uPrettyPrintTests.test_stringscCs1|jt��|jdd�|jd�dS(	u$Verify the pretty-printing of tuplesiu(1,)ufooubarubazN(i(ufooubarubaz(u
assertGdbReprutuple(uself((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyutest_tuplesYsuPrettyPrintTests.test_tuplescCst|jt��|jtddg�d�|jtdddg�d�|jd�\}}|j|d	�d
S(u"Verify the pretty-printing of setsuaubu
{'a', 'b'}iiiu	{4, 5, 6}u s = set(['a','b'])
s.pop()
id(s)u{'b'}N(u
assertGdbReprusetuget_gdb_repruassertEqual(uselfugdb_repru
gdb_output((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyu	test_sets_suPrettyPrintTests.test_setscCsO|jt��|jtddg�d�|jtdddg�d�dS(	u(Verify the pretty-printing of frozensetsuaubufrozenset({'a', 'b'})iiiufrozenset({4, 5, 6})N(u
assertGdbRepru	frozenset(uself((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyutest_frozensetslsu PrettyPrintTests.test_frozensetscCsN|jd�\}}|j|d�|jd�\}}|j|d�dS(NuR
try:
    raise RuntimeError("I am an error")
except RuntimeError as e:
    id(e)
uRuntimeError('I am an error',)u=
try:
    a = 1 / 0
except ZeroDivisionError as e:
    id(e)
u&ZeroDivisionError('division by zero',)(uget_gdb_repruassertEqual(uselfugdb_repru
gdb_output((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyutest_exceptionsrs		u PrettyPrintTests.test_exceptionscCsB|jd�\}}tjd|�}|j|dd|�dS(u7Verify the pretty-printing of new-style class instancesu8
class Foo:
    pass
foo = Foo()
foo.an_int = 42
id(foo)u*<Foo\(an_int=42\) at remote 0x-?[0-9a-f]+>umsgu'Unexpected new-style class rendering %rN(uget_gdb_reprureumatchu
assertTrue(uselfugdb_repru
gdb_outputum((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyutest_modern_class�s
u"PrettyPrintTests.test_modern_classcCsB|jd�\}}tjd|�}|j|dd|�dS(u<Verify the pretty-printing of an instance of a list subclassuO
class Foo(list):
    pass
foo = Foo()
foo += [1, 2, 3]
foo.an_int = 42
id(foo)u*<Foo\(an_int=42\) at remote 0x-?[0-9a-f]+>umsgu'Unexpected new-style class rendering %rN(uget_gdb_reprureumatchu
assertTrue(uselfugdb_repru
gdb_outputum((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyutest_subclassing_list�s
u&PrettyPrintTests.test_subclassing_listcCsB|jd�\}}tjd|�}|j|dd|�dS(u=Verify the pretty-printing of an instance of a tuple subclassuH
class Foo(tuple):
    pass
foo = Foo((1, 2, 3))
foo.an_int = 42
id(foo)u*<Foo\(an_int=42\) at remote 0x-?[0-9a-f]+>umsgu'Unexpected new-style class rendering %rN(uget_gdb_reprureumatchu
assertTrue(uselfugdb_repru
gdb_outputum((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyutest_subclassing_tuple�s
u'PrettyPrintTests.test_subclassing_tuplec	Cs�|r|dg}n	dg}|j|d|�\}}|rR||krRdSnd}tj||�}|s�|jd||f�ndS(u�Run Python under gdb, corrupting variables in the inferior process
        immediately before taking a backtrace.

        Verify that the variable's representation is the expected failsafe
        representationu	backtraceucmds_after_breakpointNu<.* at remote 0x-?[0-9a-f]+>u$Unexpected gdb representation: %r
%s(uget_gdb_reprureumatchufail(	uselfusourceu
corruptionuexpreprucmds_after_breakpointugdb_repru
gdb_outputupatternum((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyu
assertSane�s		uPrettyPrintTests.assertSanecCs5|jddddg�\}}|j|d�dS(u2Ensure that a NULL PyObject* is handled gracefullyuid(42)ucmds_after_breakpointuset variable v=0u	backtraceu0x0N(uget_gdb_repruassertEqual(uselfugdb_repru
gdb_output((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyu
test_NULL_ptr�suPrettyPrintTests.test_NULL_ptrcCs|jdd�dS(u?Ensure that a PyObject* with NULL ob_type is handled gracefullyuid(42)uset v->ob_type=0N(u
assertSane(uself((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyutest_NULL_ob_type�s	u"PrettyPrintTests.test_NULL_ob_typecCs|jdddd�dS(uDEnsure that a PyObject* with a corrupt ob_type is handled gracefullyuid(42)uset v->ob_type=0xDEADBEEFuexprepru42N(u
assertSane(uself((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyutest_corrupt_ob_type�s	u%PrettyPrintTests.test_corrupt_ob_typecCs|jdddd�dS(uDEnsure that a PyObject* with a type with corrupt tp_flags is handleduid(42)uset v->ob_type->tp_flags=0x0uexprepru42N(u
assertSane(uself((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyutest_corrupt_tp_flags�s	u&PrettyPrintTests.test_corrupt_tp_flagscCs|jdddd�dS(uCEnsure that a PyObject* with a type with corrupt tp_name is handleduid(42)u"set v->ob_type->tp_name=0xDEADBEEFuexprepru42N(u
assertSane(uself((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyutest_corrupt_tp_name�s	u%PrettyPrintTests.test_corrupt_tp_namecCsH|jddd�\}}tjd|�}|j|dd|�dS(uAEnsure that the new-style class _Helper in site.py can be handleduid(__builtins__.help)uimport_siteu!<_Helper at remote 0x-?[0-9a-f]+>umsguUnexpected rendering %rNT(uget_gdb_repruTrueureumatchu
assertTrue(uselfugdb_repru
gdb_outputum((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyutest_builtins_help�su#PrettyPrintTests.test_builtins_helpcCsN|jd�\}}|j|d�|jd�\}}|j|d�dS(ubEnsure that a reference loop involving a list doesn't lead proxyval
        into an infinite loop:u#a = [3, 4, 5] ; a.append(a) ; id(a)u[3, 4, 5, [...]]u-a = [3, 4, 5] ; b = [a] ; a.append(b) ; id(a)u[3, 4, 5, [[...]]]N(uget_gdb_repruassertEqual(uselfugdb_repru
gdb_output((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyutest_selfreferential_list�su*PrettyPrintTests.test_selfreferential_listcCs)|jd�\}}|j|d�dS(ubEnsure that a reference loop involving a dict doesn't lead proxyval
        into an infinite loop:u-a = {} ; b = {'bar':a} ; a['foo'] = b ; id(a)u{'foo': {'bar': {...}}}N(uget_gdb_repruassertEqual(uselfugdb_repru
gdb_output((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyutest_selfreferential_dictsu*PrettyPrintTests.test_selfreferential_dictcCs?|jd�\}}|jtjd|�d||f�dS(Nu:
class Foo:
    pass
foo = Foo()
foo.an_attr = foo
id(foo)u1<Foo\(an_attr=<\.\.\.>\) at remote 0x-?[0-9a-f]+>u$Unexpected gdb representation: %r
%s(uget_gdb_repru
assertTrueureumatch(uselfugdb_repru
gdb_output((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyu'test_selfreferential_old_style_instancesu8PrettyPrintTests.test_selfreferential_old_style_instancecCsz|jd�\}}|jtjd|�d||f�|jd�\}}|jtjd|�d||f�dS(NuB
class Foo(object):
    pass
foo = Foo()
foo.an_attr = foo
id(foo)u1<Foo\(an_attr=<\.\.\.>\) at remote 0x-?[0-9a-f]+>u$Unexpected gdb representation: %r
%suR
class Foo(object):
    pass
a = Foo()
b = Foo()
a.an_attr = b
b.an_attr = a
id(a)uZ<Foo\(an_attr=<Foo\(an_attr=<\.\.\.>\) at remote 0x-?[0-9a-f]+>\) at remote 0x-?[0-9a-f]+>(uget_gdb_repru
assertTrueureumatch(uselfugdb_repru
gdb_output((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyu'test_selfreferential_new_style_instancesu8PrettyPrintTests.test_selfreferential_new_style_instancecCsI|jd�\}}|j|d�|jt|�dtd��dS(u)Verify that very long output is truncateduid(list(range(1000)))u[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)iu...(truncated)N(uget_gdb_repruassertEqualulen(uselfugdb_repru
gdb_output((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyutest_truncation4s
	u PrettyPrintTests.test_truncationcCs?|jd�\}}|jtjd|�d||f�dS(Nu$import sys; id(sys.stdout.readlines)uO<built-in method readlines of _io.TextIOWrapper object at remote 0x-?[0-9a-f]+>u$Unexpected gdb representation: %r
%s(uget_gdb_repru
assertTrueureumatch(uselfugdb_repru
gdb_output((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyutest_builtin_methodPs
u$PrettyPrintTests.test_builtin_methodcCsN|jdddddg�}|jtjd|tj�d||f�dS(Nu:
def foo(a, b, c):
    pass

foo(3, 4, 5)
id(foo.__code__)u
breakpointu
builtin_iducmds_after_breakpointu:print (PyFrameObject*)(((PyCodeObject*)v)->co_zombieframe)uM.*\s+\$1 =\s+Frame 0x-?[0-9a-f]+, for file <string>, line 3, in foo \(\)\s+.*u$Unexpected gdb representation: %r
%s(uget_stack_traceu
assertTrueureumatchuDOTALL(uselfu
gdb_output((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyutest_framesWs	uPrettyPrintTests.test_framesN(!u__name__u
__module__u__qualname__utest_getting_backtraceuNoneu
assertGdbReprutest_intutest_singletonsu
test_dictsu
test_listsu
test_bytesutest_stringsutest_tuplesu	test_setsutest_frozensetsutest_exceptionsutest_modern_classutest_subclassing_listutest_subclassing_tupleu
assertSaneu
test_NULL_ptrutest_NULL_ob_typeutest_corrupt_ob_typeutest_corrupt_tp_flagsutest_corrupt_tp_nameutest_builtins_helputest_selfreferential_listutest_selfreferential_dictu'test_selfreferential_old_style_instanceu'test_selfreferential_new_style_instanceutest_truncationutest_builtin_methodutest_frames(u
__locals__((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyuPrettyPrintTestss:
 



uPrettyPrintTestsu&Python was compiled with optimizationscBsD|EeZdZdd�Zdd�Zdd�Zdd�Zd	S(
uPyListTestscCs|j||�dS(N(uassertEndsWith(uselfuexpecteduactual((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyu
assertListingisuPyListTests.assertListingcCs5|jd|j�ddg�}|jd|�dS(u'Verify that the "py-list" command worksuscriptucmds_after_breakpointupy-listu�   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(uget_stack_traceuget_sample_scriptu
assertListing(uselfubt((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyutest_basic_commandls	uPyListTests.test_basic_commandcCs5|jd|j�ddg�}|jd|�dS(u7Verify the "py-list" command with one absolute argumentuscriptucmds_after_breakpointu	py-list 9uI   9    def baz(*args):
 >10        id(42)
  11    
  12    foo(1, 2, 3)
N(uget_stack_traceuget_sample_scriptu
assertListing(uselfubt((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyutest_one_abs_arg{s	uPyListTests.test_one_abs_argcCs5|jd|j�ddg�}|jd|�dS(u8Verify the "py-list" command with two absolute argumentsuscriptucmds_after_breakpointupy-list 1,3uR   1    # Sample script for use by test_gdb.py
   2    
   3    def foo(a, b, c):
N(uget_stack_traceuget_sample_scriptu
assertListing(uselfubt((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyutest_two_abs_args�s	uPyListTests.test_two_abs_argsN(u__name__u
__module__u__qualname__u
assertListingutest_basic_commandutest_one_abs_argutest_two_abs_args(u
__locals__((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyuPyListTestsfsuPyListTestscBs�|EeZdZejed�eje�d�dd���Zejed�dd��Z	ejed�dd��Z
ejed�eje�d�d	d
���ZdS(uStackNavigationTestsu$test requires py-up/py-down commandsu&Python was compiled with optimizationscCs5|jd|j�ddg�}|j|d�dS(u%Verify that the "py-up" command worksuscriptucmds_after_breakpointupy-upup^.*
#[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\)
$N(uget_stack_traceuget_sample_scriptuassertMultilineMatches(uselfubt((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyutest_pyup_command�s	u&StackNavigationTests.test_pyup_commandcCs5|jd|j�ddg�}|j|d�dS(u7Verify handling of "py-down" at the bottom of the stackuscriptucmds_after_breakpointupy-downu$Unable to find a newer python frame
N(uget_stack_traceuget_sample_scriptuassertEndsWith(uselfubt((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyutest_down_at_bottom�s	u(StackNavigationTests.test_down_at_bottomcCs9|jd|j�ddgd�}|j|d�dS(u2Verify handling of "py-up" at the top of the stackuscriptucmds_after_breakpointupy-upiu%Unable to find an older python frame
N(uget_stack_traceuget_sample_scriptuassertEndsWith(uselfubt((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyutest_up_at_top�s	u#StackNavigationTests.test_up_at_topcCs8|jd|j�dddg�}|j|d�dS(u$Verify "py-up" followed by "py-down"uscriptucmds_after_breakpointupy-upupy-downu�^.*
#[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\)
$N(uget_stack_traceuget_sample_scriptuassertMultilineMatches(uselfubt((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyutest_up_then_down�s	u&StackNavigationTests.test_up_then_downN(u__name__u
__module__u__qualname__uunittestu
skipUnlessuHAS_PYUP_PYDOWNuskipIfupython_is_optimizedutest_pyup_commandutest_down_at_bottomutest_up_at_toputest_up_then_down(u
__locals__((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyuStackNavigationTests�suStackNavigationTestscBs�|EeZdZeje�d�dd��Zeje�d�dd��Zeje	d�dd��Z
eje�d�eje	d�d	d
���Zeje�d�eje	d�dd���Zd
S(u	PyBtTestsu&Python was compiled with optimizationscCs5|jd|j�ddg�}|j|d�dS(u%Verify that the "py-bt" command worksuscriptucmds_after_breakpointupy-btu^.*
Traceback \(most recent call first\):
  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\)
N(uget_stack_traceuget_sample_scriptuassertMultilineMatches(uselfubt((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyutest_bt�s	uPyBtTests.test_btcCs5|jd|j�ddg�}|j|d�dS(u*Verify that the "py-bt-full" command worksuscriptucmds_after_breakpointu
py-bt-fullu>^.*
#[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\)
N(uget_stack_traceuget_sample_scriptuassertMultilineMatches(uselfubt((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyutest_bt_full�s	uPyBtTests.test_bt_fullu*Python was compiled without thread supportcCsZd}|j|ddg�}|jd|�|j|ddg�}|jd|�dS(uBVerify that "py-bt" indicates threads that are waiting for the GILuN
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)

ucmds_after_breakpointuthread apply all py-btuWaiting for the GILuthread apply all py-bt-fullN(uget_stack_traceuassertIn(uselfucmdu
gdb_output((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyutest_threads�suPyBtTests.test_threadscCsfd}|j|ddddg�}|jd|�|j|ddddg�}|jd|�dS(	u?Verify that "py-bt" indicates if a thread is garbage-collectinguRfrom gc import collect
id(42)
def foo():
    collect()
def bar():
    foo()
bar()
ucmds_after_breakpointubreak update_refsucontinueupy-btuGarbage-collectingu
py-bt-fullN(uget_stack_traceuassertIn(uselfucmdu
gdb_output((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyutest_gcs	uPyBtTests.test_gccCsid}|j|dddddg�}|jd|�|j|ddddg�}|jd	|�d
S(uAVerify that "py-bt" displays invocations of PyCFunction instancesuJfrom time import sleep
def foo():
    sleep(1)
def bar():
    foo()
bar()
u
breakpointu
time_sleepucmds_after_breakpointubtupy-btu<built-in method sleepu
py-bt-fullu#0 <built-in method sleepN(uget_stack_traceuassertIn(uselfucmdu
gdb_output((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyutest_pycfunctions	uPyBtTests.test_pycfunctionN(
u__name__u
__module__u__qualname__uunittestuskipIfupython_is_optimizedutest_btutest_bt_fullu
skipUnlessu_threadutest_threadsutest_gcutest_pycfunction(u
__locals__((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyu	PyBtTests�s	!		u	PyBtTestscBs�|EeZdZeje�d�dd��Zeje�d�ejed�dd���Z	eje�d�dd��Z
eje�d�d	d
��ZdS(uPyPrintTestsu&Python was compiled with optimizationscCs5|jd|j�ddg�}|j|d�dS(u(Verify that the "py-print" command worksuscriptucmds_after_breakpointu
py-print argsu".*\nlocal 'args' = \(1, 2, 3\)\n.*N(uget_stack_traceuget_sample_scriptuassertMultilineMatches(uselfubt((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyutest_basic_command>s	uPyPrintTests.test_basic_commandu$test requires py-up/py-down commandscCs>|jd|j�dddddg�}|j|d�dS(Nuscriptucmds_after_breakpointupy-upu
py-print cu
py-print bu
py-print au3.*\nlocal 'c' = 3\nlocal 'b' = 2\nlocal 'a' = 1\n.*(uget_stack_traceuget_sample_scriptuassertMultilineMatches(uselfubt((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyutest_print_after_upGs	u PyPrintTests.test_print_after_upcCs5|jd|j�ddg�}|j|d�dS(Nuscriptucmds_after_breakpointupy-print __name__u&.*\nglobal '__name__' = '__main__'\n.*(uget_stack_traceuget_sample_scriptuassertMultilineMatches(uselfubt((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyutest_printing_globalPs	u!PyPrintTests.test_printing_globalcCs5|jd|j�ddg�}|j|d�dS(Nuscriptucmds_after_breakpointupy-print lenuV.*\nbuiltin 'len' = <built-in method len of module object at remote 0x-?[0-9a-f]+>\n.*(uget_stack_traceuget_sample_scriptuassertMultilineMatches(uselfubt((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyutest_printing_builtinXs	u"PyPrintTests.test_printing_builtinN(u__name__u
__module__u__qualname__uunittestuskipIfupython_is_optimizedutest_basic_commandu
skipUnlessuHAS_PYUP_PYDOWNutest_print_after_uputest_printing_globalutest_printing_builtin(u
__locals__((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyuPyPrintTests=s!uPyPrintTestscBsh|EeZdZeje�d�dd��Zejed�eje�d�dd���Z	dS(u
PyLocalsTestsu&Python was compiled with optimizationscCs5|jd|j�ddg�}|j|d�dS(Nuscriptucmds_after_breakpointu	py-localsu.*\nargs = \(1, 2, 3\)\n.*(uget_stack_traceuget_sample_scriptuassertMultilineMatches(uselfubt((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyutest_basic_commandas	u PyLocalsTests.test_basic_commandu$test requires py-up/py-down commandscCs8|jd|j�dddg�}|j|d�dS(Nuscriptucmds_after_breakpointupy-upu	py-localsu.*\na = 1\nb = 2\nc = 3\n.*(uget_stack_traceuget_sample_scriptuassertMultilineMatches(uselfubt((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyutest_locals_after_upis	u"PyLocalsTests.test_locals_after_upN(
u__name__u
__module__u__qualname__uunittestuskipIfupython_is_optimizedutest_basic_commandu
skipUnlessuHAS_PYUP_PYDOWNutest_locals_after_up(u
__locals__((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyu
PyLocalsTests`s
u
PyLocalsTestscCsttttttt�dS(N(urun_unittestuPrettyPrintTestsuPyListTestsuStackNavigationTestsu	PyBtTestsuPyPrintTestsu
PyLocalsTests(((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyu	test_mainrsu	test_mainu__main__(8uosureu
subprocessusysu	sysconfiguunittestulocaleu_threaduImportErroruNoneutest.supporturun_unittestufindfileupython_is_optimizeduPopenuPIPEucommunicateugdb_versionu_uOSErroruSkipTestusearchugdb_version_numberuintugroupugdb_major_versionugdb_minor_versionudecodeuis_python_buildupathujoinudirnameu
executableucheckout_hook_pathurun_gdbu
gdbpy_versionucmdugdbpy_errorsumsgurstripugdb_has_frame_selectuHAS_PYUP_PYDOWNugdb_has_autoload_safepathuHAS_AUTOLOAD_SAFEPATHu
BREAKPOINT_FNuTestCaseu
DebuggerTestsuPrettyPrintTestsuskipIfuPyListTestsuStackNavigationTestsu	PyBtTestsuPyPrintTestsu
PyLocalsTestsu	test_mainu__name__(((u2/opt/alt/python33/lib64/python3.3/test/test_gdb.pyu<module>sj

	
				��e(-�#