%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python2.7/test/
Upload File :
Create Path :
Current File : //usr/local/lib/python2.7/test/test_gdb.pyc

ó
Nêáac@sýddlZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZmZyddl
Z
Wnek
r¯eZ
nXd„Zeƒ\ZZZedkröejdeeefƒ‚nejjdƒrejdƒ‚nejjejjejƒd	ƒZd
„ZeƒZd„Zejƒrxejdƒ‚ned
ƒ\Z Z!e r£ejdƒ‚ndejgZ"edejƒ\Z!Z#de#krødZ$eje$e#j%ƒƒ‚nd„Z&d„Z'e'ƒZ(dej)fd„ƒYZ*ej+e&ƒdƒde*fd„ƒYƒZ,ej+e&ƒdƒde*fd„ƒYƒZ-de*fd„ƒYZ.de*fd„ƒYZ/de*fd „ƒYZ0d!e*fd"„ƒYZ1d#„Z2e3d$krùe2ƒndS(%iÿÿÿÿN(ttest_support(trun_unittesttfindfilecCsÃyDtjdddgdtjdtjdtƒ}|jƒd}Wn tk
rftjdƒ‚nXtj	d	|ƒ}|dkr˜td
|ƒ‚n|t|j
dƒƒt|j
dƒƒfS(
Ntgdbs-nxs	--versiontstdouttstderrtuniversal_newlinesisCouldn't find gdb on the paths^GNU gdb.*?\b(\d+)\.(\d+)sunable to parse GDB version: %rii(t
subprocesstPopentPIPEtTruetcommunicatetOSErrortunittesttSkipTesttretsearchtNonet	Exceptiontinttgroup(tproctversiontmatch((s)/usr/local/lib/python2.7/test/test_gdb.pytget_gdb_versions			
isFgdb versions before 7.0 didn't support python embedding. Saw %s.%s:
%stsunoss&test doesn't work very well on Solariss
python-gdb.pycCsEtjdƒ}|stS|jƒ}d|koDtd„|DƒƒS(NtCFLAGSs-mcetcss.|]$}|jdƒo%|jdƒVqdS(s-fcf-protections=nones=returnN(s=nones=return(t
startswithtendswith(t.0tflag((s)/usr/local/lib/python2.7/test/test_gdb.pys	<genexpr>Fs(t	sysconfigtget_config_vartFalsetsplittany(tcflagstflags((s)/usr/local/lib/python2.7/test/test_gdb.pytcet_protection>s	c
Os¤|r%tjjƒ}|j|ƒnd}d
}ttfdkrZ|ddtf7}ntj	||dtj
d	tj
d
tj
d|ƒjƒ\}}||fS(skRuns gdb in batch mode with the additional arguments given by *args.

    Returns its (stdout, stderr)
    Rs--batchs-nxiis-iexsadd-auto-load-safe-path tstdinRRtenvN(Rs--batchs-nx(ii(tostenvirontcopytupdateRtgdb_major_versiontgdb_minor_versiontcheckout_hook_pathRRR	R(targstenv_varsR(tbase_cmdtoutterr((s)/usr/local/lib/python2.7/test/test_gdb.pytrun_gdbNs	's3test_gdb only works on source builds at the moment.s9--eval-command=python import sys; print(sys.version_info)s*gdb not built with embedded python supports--argssauto-loading has been declineds3gdb security settings prevent use of custom hooks: cCsOtjƒd}d}x,|jƒD]}|jdƒr#|}q#q#W|dkS(Nt	PY_CFLAGSts-Os-O0s-Og(R7s-O0s-Og(Rtget_config_varsR"R(R$t	final_opttopt((s)/usr/local/lib/python2.7/test/test_gdb.pytpython_is_optimizedts
cCs^tdƒ\}}tjd|ƒ}|s<tjdƒ‚n|jdƒjdƒ}d|kS(Ns+--eval-command=python print(dir(gdb.Frame))s.*\[(.*)\].*s1Unable to parse output from gdb.Frame.select testis, s'select'(R5RRR
RRR"(Rt_tmt
gdb_frame_dir((s)/usr/local/lib/python2.7/test/test_gdb.pytgdb_has_frame_select|st
DebuggerTestscBsPeZdZdddded„Zded„Zd„Zd„Zd„Z	RS(s(Test that the debugger can debug Python.tPyObject_PrintcCsTdd|ddg}ttfdkr8|dg7}n|ratrT|dg7}n||7}n
|d	g7}d
ddg}|g|D]}d
|^q‡7}|dtjg7}|sÇ|dg7}n|rà|d|g7}n|rö||g7}ntdd|Œ\}	}
x!|
jƒD]}tj|IJqWd|
krPtj	dƒ‚n|	S(sû
        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
        sset breakpoint pending yessbreak %ssset print address offtruniisset print entry-values notnextt	backtraceRs--batchs-nxs--eval-command=%ss--argss-Ss-ctPYTHONHASHSEEDt0sPC not savedsKgdb cannot walk the frame object because the Program Counter is not present(ii(
R-R.tCET_PROTECTIONtsyst
executableR5t
splitlinesRR
R(tselftsourcetscriptt
breakpointtcmds_after_breakpointtimport_sitetcommandsR0tcmdR3R4tline((s)/usr/local/lib/python2.7/test/test_gdb.pytget_stack_trace‹s6
	

!
cCs{|pdg}|j|ddd|d|ƒ}tjd|tjƒ}|sh|jd||fƒn|jdƒ|fS(	Nsbacktrace 1RNRARORPs6.*#0\s+PyObject_Print\s+\(\s*op\=\s*(.*?),\s+fp=.*\).*sUnexpected gdb output: %r
%si(RTRRtDOTALLtfailR(RKRLRORPt
gdb_outputR=((s)/usr/local/lib/python2.7/test/test_gdb.pytget_gdb_reprìs		cCs*|j|j|ƒdd||fƒdS(s9Ensure that the given "actual" string ends with "exp_end"tmsgs%r did not end with %rN(t
assertTrueR(RKtactualtexp_end((s)/usr/local/lib/python2.7/test/test_gdb.pytassertEndsWithscCs9tj||tjƒ}|j|dd||fƒdS(NRYs%r did not match %r(RRRURZ(RKR[tpatternR=((s)/usr/local/lib/python2.7/test/test_gdb.pytassertMultilineMatchesscCs
tdƒS(Ns
gdb_sample.py(R(RK((s)/usr/local/lib/python2.7/test/test_gdb.pytget_sample_scriptsN(
t__name__t
__module__t__doc__RR!RTRXR]R_R`(((s)/usr/local/lib/python2.7/test/test_gdb.pyR@‡s_		s&Python was compiled with optimizationstPrettyPrintTestscBs:eZd„Zd!d„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d„Zd	„Zd
„Z
d„Zd„Zd
„Zd„Zd„Zd„Zd!d!d„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z!d„Z"d „Z#RS("cCs&|jdƒ}|jd|kƒdS(Nsprint 42RA(RTRZ(RKRW((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_getting_backtracescCs<|jdt|ƒ|ƒ\}}|j|t|ƒƒdS(Nsprint (RXtreprtassertEqual(RKtvalROtgdb_reprRW((s)/usr/local/lib/python2.7/test/test_gdb.pyt
assertGdbReprscCsL|jdƒ|jdƒ|jdƒ|jtjƒ|jtjƒdS(s2Verify the pretty-printing of various "int" valuesi*iiùÿÿÿN(RjRHtmaxint(RK((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_int"s



cCs8|jdƒ|jdƒ|jdƒ|jdƒdS(s3Verify the pretty-printing of various "long" valuesllJ)£lÿÿÿÿlüÿÿÿIú5N(Rj(RK((s)/usr/local/lib/python2.7/test/test_gdb.pyt	test_long*s


cCs+|jtƒ|jtƒ|jdƒdS(s2Verify the pretty-printing of True, False and NoneN(RjR
R!R(RK((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_singletons1s

cCs2|jiƒ|jidd6ƒ|jdƒdS(s*Verify the pretty-printing of dictionariestbartfoos{'foo': 'bar', 'douglas':42}N(Rj(RK((s)/usr/local/lib/python2.7/test/test_gdb.pyt
test_dicts7s
cCs$|jgƒ|jtdƒƒdS(s#Verify the pretty-printing of listsiN(Rjtrange(RK((s)/usr/local/lib/python2.7/test/test_gdb.pyt
test_lists=s
cCs8|jdƒ|jdƒ|jdƒ|jdƒdS(s%Verify the pretty-printing of stringsR7s(And now for something hopefully the sames7string with embedded NUL here  and then some more texts!this is byte 255:ÿ and byte 128:€N(Rj(RK((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_stringsBs


cCs.|jtƒƒ|jdƒ|jdƒdS(s$Verify the pretty-printing of tuplesiRpRotbazN(i(RpRoRu(Rjttuple(RK((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_tuplesIs
cCsE|jdƒ|jdƒ|jdƒ|jdƒ|jdƒdS(s,Verify the pretty-printing of unicode valuesuuhello worldu☠u文字化ã‘uð„¡N(Rj(RK((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_unicodeOs




cCsï|jtƒƒ|jdƒd}|j|jdƒƒ|j|jdƒƒ|jt|ƒddhƒ|jdƒd}|j|jdƒƒ|j|jdƒƒ|jt|ƒdd	hƒ|jd
ƒ\}}|j|dƒdS(
s"Verify the pretty-printing of setssprint set(['a', 'b'])isset([s])tatbsprint set([4, 5])iis"s = set(['a','b'])
s.pop()
print ss
set(['b'])N(RjtsetRXRZRRRgteval(RKtrepRiRW((s)/usr/local/lib/python2.7/test/test_gdb.pyt	test_setsgscCsÊ|jtƒƒ|jdƒd}|j|jdƒƒ|j|jdƒƒ|jt|ƒddhƒ|jdƒd}|j|jdƒƒ|j|jdƒƒ|jt|ƒdd	hƒd
S(s(Verify the pretty-printing of frozensetssprint frozenset(['a', 'b'])isfrozenset([s])RyRzsprint frozenset([4, 5])iiN(Rjt	frozensetRXRZRRRgR|(RKR}((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_frozensetszscCsN|jdƒ\}}|j|dƒ|jdƒ\}}|j|dƒdS(NsR
try:
    raise RuntimeError("I am an error")
except RuntimeError, e:
    print e
s)exceptions.RuntimeError('I am an error',)s>
try:
    a = 1 // 0
except ZeroDivisionError, e:
    print e
sCexceptions.ZeroDivisionError('integer division or modulo by zero',)(RXRg(RKRiRW((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_exceptions†s		cCsB|jdƒ\}}tjd|ƒ}|j|dd|ƒdS(s5Verify the pretty-printing of classic class instancess:
class Foo:
    pass
foo = Foo()
foo.an_int = 42
print foos(<Foo\(an_int=42\) at remote 0x[0-9a-f]+>RYs%Unexpected classic-class rendering %rN(RXRRRZ(RKRiRWR=((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_classic_classœs
cCsB|jdƒ\}}tjd|ƒ}|j|dd|ƒdS(s7Verify the pretty-printing of new-style class instancessB
class Foo(object):
    pass
foo = Foo()
foo.an_int = 42
print foos(<Foo\(an_int=42\) at remote 0x[0-9a-f]+>RYs'Unexpected new-style class rendering %rN(RXRRRZ(RKRiRWR=((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_modern_class¨s
cCsB|jdƒ\}}tjd|ƒ}|j|dd|ƒdS(s<Verify the pretty-printing of an instance of a list subclasssQ
class Foo(list):
    pass
foo = Foo()
foo += [1, 2, 3]
foo.an_int = 42
print foos(<Foo\(an_int=42\) at remote 0x[0-9a-f]+>RYs'Unexpected new-style class rendering %rN(RXRRRZ(RKRiRWR=((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_subclassing_list´s
cCsB|jdƒ\}}tjd|ƒ}|j|dd|ƒdS(s=Verify the pretty-printing of an instance of a tuple subclasssJ
class Foo(tuple):
    pass
foo = Foo((1, 2, 3))
foo.an_int = 42
print foos(<Foo\(an_int=42\) at remote 0x[0-9a-f]+>RYs'Unexpected new-style class rendering %rN(RXRRRZ(RKRiRWR=((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_subclassing_tupleÁs
c
Cs«|r|dg}n	dg}|j|d|ƒ\}}|rX|t|ƒkrXdSn|rod|d}nd}tj||ƒ}	|	s§|jd||fƒndS(sÔ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
        representationRDRONt<s at remote 0x[0-9a-f]+>s<.* at remote 0x[0-9a-f]+>s$Unexpected gdb representation: %r
%s(RXRfRRRV(
RKRLt
corruptiontexpvaluetexptypeRORiRWR^R=((s)/usr/local/lib/python2.7/test/test_gdb.pyt
assertSaneÏs		cCs5|jddddgƒ\}}|j|dƒdS(s2Ensure that a NULL PyObject* is handled gracefullysprint 42ROsset variable op=0RDt0x0N(RXRg(RKRiRW((s)/usr/local/lib/python2.7/test/test_gdb.pyt
test_NULL_ptrðscCs|jddƒdS(s?Ensure that a PyObject* with NULL ob_type is handled gracefullysprint 42sset op->ob_type=0N(RŠ(RK((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_NULL_ob_typeús	cCs|jddddƒdS(sDEnsure that a PyObject* with a corrupt ob_type is handled gracefullysprint 42sset op->ob_type=0xDEADBEEFRˆi*N(RŠ(RK((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_corrupt_ob_typeÿs	cCs|jddddƒdS(sDEnsure that a PyObject* with a type with corrupt tp_flags is handledsprint 42sset op->ob_type->tp_flags=0x0Rˆi*N(RŠ(RK((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_corrupt_tp_flagss	cCs|jddddƒdS(sCEnsure that a PyObject* with a type with corrupt tp_name is handledsprint 42s#set op->ob_type->tp_name=0xDEADBEEFRˆi*N(RŠ(RK((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_corrupt_tp_names	cCs|jddddƒdS(sBEnsure that a PyInstanceObject with with a NULL in_dict is handleds:
class Foo:
    pass
foo = Foo()
foo.an_int = 42
print foos(set ((PyInstanceObject*)op)->in_dict = 0R‰tFooN(RŠ(RK((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_NULL_instance_dictscCsH|jddtƒ\}}tjd|ƒ}|j|dd|ƒdS(sAEnsure that the new-style class _Helper in site.py can be handledsprint __builtins__.helpRPs<_Helper at remote 0x[0-9a-f]+>RYsUnexpected rendering %rN(RXR
RRRZ(RKRiRWR=((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_builtins_helpscCsN|jdƒ\}}|j|dƒ|jdƒ\}}|j|dƒdS(sbEnsure that a reference loop involving a list doesn't lead proxyval
        into an infinite loop:s%a = [3, 4, 5] ; a.append(a) ; print as[3, 4, 5, [...]]s/a = [3, 4, 5] ; b = [a] ; a.append(b) ; print as[3, 4, 5, [[...]]]N(RXRg(RKRiRW((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_selfreferential_list&scCs)|jdƒ\}}|j|dƒdS(sbEnsure that a reference loop involving a dict doesn't lead proxyval
        into an infinite loop:s/a = {} ; b = {'bar':a} ; a['foo'] = b ; print as{'foo': {'bar': {...}}}N(RXRg(RKRiRW((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_selfreferential_dict3scCs?|jdƒ\}}|jtjd|ƒd||fƒdS(Ns<
class Foo:
    pass
foo = Foo()
foo.an_attr = foo
print foos/<Foo\(an_attr=<\.\.\.>\) at remote 0x[0-9a-f]+>s$Unexpected gdb representation: %r
%s(RXRZRR(RKRiRW((s)/usr/local/lib/python2.7/test/test_gdb.pyt'test_selfreferential_old_style_instance;scCsz|jdƒ\}}|jtjd|ƒd||fƒ|jdƒ\}}|jtjd|ƒd||fƒdS(NsD
class Foo(object):
    pass
foo = Foo()
foo.an_attr = foo
print foos/<Foo\(an_attr=<\.\.\.>\) at remote 0x[0-9a-f]+>s$Unexpected gdb representation: %r
%ssT
class Foo(object):
    pass
a = Foo()
b = Foo()
a.an_attr = b
b.an_attr = a
print asV<Foo\(an_attr=<Foo\(an_attr=<\.\.\.>\) at remote 0x[0-9a-f]+>\) at remote 0x[0-9a-f]+>(RXRZRR(RKRiRW((s)/usr/local/lib/python2.7/test/test_gdb.pyt'test_selfreferential_new_style_instanceHscCsI|jdƒ\}}|j|dƒ|jt|ƒdtdƒƒdS(s)Verify that very long output is truncatedsprint range(1000)s[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)is...(truncated)N(RXRgtlen(RKRiRW((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_truncationcs
	cCs)|jdƒ\}}|j|dƒdS(Ns	print lens<built-in function len>(RXRg(RKRiRW((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_builtin_functionscCs?|jdƒ\}}|jtjd|ƒd||fƒdS(Ns&import sys; print sys.stdout.readliness@<built-in method readlines of file object at remote 0x[0-9a-f]+>s$Unexpected gdb representation: %r
%s(RXRZRR(RKRiRW((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_builtin_methodƒs
cCsN|jdddddgƒ}|jtjd|tjƒd||fƒdS(Ns<
def foo(a, b, c):
    pass

foo(3, 4, 5)
print foo.__code__RNRAROs;print (PyFrameObject*)(((PyCodeObject*)op)->co_zombieframe)sK.*\s+\$1 =\s+Frame 0x[0-9a-f]+, for file <string>, line 3, in foo \(\)\s+.*s$Unexpected gdb representation: %r
%s(RTRZRRRU(RKRW((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_framesŠs	N($RaRbReRRjRlRmRnRqRsRtRwRxR~R€RR‚RƒR„R…RŠRŒRRŽRRR’R“R”R•R–R—R™RšR›Rœ(((s)/usr/local/lib/python2.7/test/test_gdb.pyRdsB															
	!	
						
	
		
				tPyListTestscBs,eZd„Zd„Zd„Zd„ZRS(cCs|j||ƒdS(N(R](RKtexpectedR[((s)/usr/local/lib/python2.7/test/test_gdb.pyt
assertListingœscCs5|jd|jƒddgƒ}|jd|ƒdS(s'Verify that the "py-list" command worksRMROspy-lists‘   5    
   6    def bar(a, b, c):
   7        baz(a, b, c)
   8    
   9    def baz(*args):
 >10        print(42)
  11    
  12    foo(1, 2, 3)
N(RTR`RŸ(RKtbt((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_basic_commandŸs	cCs5|jd|jƒddgƒ}|jd|ƒdS(s7Verify the "py-list" command with one absolute argumentRMROs	py-list 9sL   9    def baz(*args):
 >10        print(42)
  11    
  12    foo(1, 2, 3)
N(RTR`RŸ(RKR ((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_one_abs_arg®s	cCs5|jd|jƒddgƒ}|jd|ƒdS(s8Verify the "py-list" command with two absolute argumentsRMROspy-list 1,3sR   1    # Sample script for use by test_gdb.py
   2    
   3    def foo(a, b, c):
N(RTR`RŸ(RKR ((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_two_abs_args¹s	(RaRbRŸR¡R¢R£(((s)/usr/local/lib/python2.7/test/test_gdb.pyR™s			tStackNavigationTestscBs³eZejedƒejeƒdƒd„ƒƒZejedƒd„ƒZejedƒejeƒdƒd„ƒƒZ	ejedƒejeƒdƒd„ƒƒZ
RS(s$test requires py-up/py-down commandss&Python was compiled with optimizationscCs5|jd|jƒddgƒ}|j|dƒdS(s%Verify that the "py-up" command worksRMROspy-upsn^.*
#[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(RTR`R_(RKR ((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_pyup_commandÄs	cCs5|jd|jƒddgƒ}|j|dƒdS(s7Verify handling of "py-down" at the bottom of the stackRMROspy-downs$Unable to find a newer python frame
N(RTR`R](RKR ((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_down_at_bottomÑs	cCs9|jd|jƒddgdƒ}|j|dƒdS(s2Verify handling of "py-up" at the top of the stackRMROspy-upis%Unable to find an older python frame
N(RTR`R](RKR ((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_up_at_topÙs	cCs8|jd|jƒdddgƒ}|j|dƒdS(s$Verify "py-up" followed by "py-down"RMROspy-upspy-downsØ^.*
#[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\)\)
    print\(42\)
$N(RTR`R_(RKR ((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_up_then_downãs	(RaRbR
t
skipUnlesstHAS_PYUP_PYDOWNtskipIfR;R¥R¦R§R¨(((s)/usr/local/lib/python2.7/test/test_gdb.pyR¤Ãst	PyBtTestscBsòeZejeƒdƒd„ƒZejeƒdƒd„ƒZejedƒejeƒdƒd„ƒƒZ	ejeƒdƒejedƒd„ƒƒZ
ejeƒdƒejedƒd„ƒƒZejeƒdƒd„ƒZRS(s&Python was compiled with optimizationscCs5|jd|jƒddgƒ}|j|dƒdS(s%Verify that the "py-bt" command worksRMROspy-bts^.*
Traceback \(most recent call first\):
  File ".*gdb_sample.py", line 10, in baz
    print\(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(RTR`R_(RKR ((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_btós	cCs5|jd|jƒddgƒ}|j|dƒdS(s*Verify that the "py-bt-full" command worksRMROs
py-bt-fulls>^.*
#[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(RTR`R_(RKR ((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_bt_fulls	s*Python was compiled without thread supportcCsZd}|j|ddgƒ}|jd|ƒ|j|ddgƒ}|jd|ƒdS(sBVerify that "py-bt" indicates threads that are waiting for the GILsP
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
print 42

ROsthread apply all py-btsWaiting for the GILsthread apply all py-bt-fullN(RTtassertIn(RKRRRW((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_threadsscCsfd}|j|ddddgƒ}|jd|ƒ|j|ddddgƒ}|jd|ƒdS(	s?Verify that "py-bt" indicates if a thread is garbage-collectingsTfrom gc import collect
print 42
def foo():
    collect()
def bar():
    foo()
bar()
ROsbreak update_refstcontinuespy-btsGarbage-collectings
py-bt-fullN(RTR¯(RKRRRW((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_gc:s	cCsid}|j|dddddgƒ}|jd|ƒ|j|ddddgƒ}|jd	|ƒd
S(sAVerify that "py-bt" displays invocations of PyCFunction instancessLfrom time import gmtime
def foo():
    gmtime(1)
def bar():
    foo()
bar()
RNttime_gmtimeROR spy-bts<built-in function gmtimes
py-bt-fulls#1 <built-in function gmtimeN(RTR¯(RKRRRW((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_pycfunctionVscCsgtjdƒ}ddg}tr1|jdƒn|jdƒ|j|d|ƒ}|j|dƒdS(NsÔ
            class MyList(list):
                def __init__(self):
                    super(MyList, self).__init__()   # wrapper_call()

            print("first break point")
            l = MyList()
        sbreak wrapper_callR±RCspy-btROs1<method-wrapper u?'__init__' of MyList object at (ttextwraptdedentRGtappendRTtassertRegexpMatches(RKRRRORW((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_wrapper_callus	
		(
RaRbR
R«R;R­R®R©tthreadR°R²R´R¹(((s)/usr/local/lib/python2.7/test/test_gdb.pyR¬òs$	!		tPyPrintTestscBs’eZejeƒdƒd„ƒZejedƒejeƒdƒd„ƒƒZejeƒdƒd„ƒZ	ejeƒdƒd„ƒZ
RS(s&Python was compiled with optimizationscCs5|jd|jƒddgƒ}|j|dƒdS(s(Verify that the "py-print" command worksRMROs
py-print argss".*\nlocal 'args' = \(1, 2, 3\)\n.*N(RTR`R_(RKR ((s)/usr/local/lib/python2.7/test/test_gdb.pyR¡s	s$test requires py-up/py-down commandscCs>|jd|jƒdddddgƒ}|j|dƒdS(NRMROspy-ups
py-print cs
py-print bs
py-print as3.*\nlocal 'c' = 3\nlocal 'b' = 2\nlocal 'a' = 1\n.*(RTR`R_(RKR ((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_print_after_up™s	cCs5|jd|jƒddgƒ}|j|dƒdS(NRMROspy-print __name__s&.*\nglobal '__name__' = '__main__'\n.*(RTR`R_(RKR ((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_printing_global¢s	cCs5|jd|jƒddgƒ}|j|dƒdS(NRMROspy-print lens/.*\nbuiltin 'len' = <built-in function len>\n.*(RTR`R_(RKR ((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_printing_builtinªs	(RaRbR
R«R;R¡R©RªR¼R½R¾(((s)/usr/local/lib/python2.7/test/test_gdb.pyR»st
PyLocalsTestscBsVeZejeƒdƒd„ƒZejedƒejeƒdƒd„ƒƒZRS(s&Python was compiled with optimizationscCs5|jd|jƒddgƒ}|j|dƒdS(NRMROs	py-localss.*\nargs = \(1, 2, 3\)\n.*(RTR`R_(RKR ((s)/usr/local/lib/python2.7/test/test_gdb.pyR¡³s	s$test requires py-up/py-down commandscCs8|jd|jƒdddgƒ}|j|dƒdS(NRMROspy-ups	py-localss.*\na = 1\nb = 2\nc = 3\n.*(RTR`R_(RKR ((s)/usr/local/lib/python2.7/test/test_gdb.pyttest_locals_after_up»s	(	RaRbR
R«R;R¡R©RªRÀ(((s)/usr/local/lib/python2.7/test/test_gdb.pyR¿²s
cCsXtjr;dttfGHx tjƒD]}d|GHq%Wntttt	t
ttƒdS(NsGDB version %s.%s:t is    (
RtverboseR-R.tgdb_versionRJRRdRR¤R¬R»R¿(RS((s)/usr/local/lib/python2.7/test/test_gdb.pyt	test_mainÄs	t__main__(4tlocaleR)RRRHRRµR
ttestRttest.test_supportRRRºtImportErrorRRRÃR-R.RtplatformRtpathtjointdirnameRIR/R&RGR5tis_python_buildt
gdbpy_versionR<RRtgdbpy_errorsRYtrstripR;R?RªtTestCaseR@R«RdRR¤R¬R»R¿RÄRa(((s)/usr/local/lib/python2.7/test/test_gdb.pyt<module>sl

				
		
					ÿ„	(/#	


Zerion Mini Shell 1.0