��
���Lc@s�dZddkZddkZddkZdddgZdefd��YZdfd��YZd�Zdfd ��YZ d
�Z
d�Zdefd
��YZd�Z
d�Zd�ZdS(sDebugger basicsi����NtBdbQuittBdbt
BreakpointcBseZdZRS(sException to give up completely(t__name__t
__module__t__doc__(((s/usr/lib/python2.6/bdb.pyR scBs�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z
d �Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zdd�Zd�Zd�Zd�Zd�Zd*d�Zd�Zd�Zdd*d*d�Zd�Zd�Zd�Zd�Z d�Z!d �Z"d!�Z#d"�Z$d#�Z%d$d%�Z&d*d*d&�Z'd*d*d'�Z(d(�Z)d)�Z*RS(+s�Generic Python debugger base class.
This class takes care of details of the trace facility;
a derived class should implement user interaction.
The standard debugger class (pdb.Pdb) is an example.
cCsh|_h|_dS(N(tbreakstfncache(tself((s/usr/lib/python2.6/bdb.pyt__init__s cCss|d|dd!djo|S|ii|�}|p5tii|�}tii|�}||i|<n|S(Nt<ii����t>(Rtgettostpathtabspathtnormcase(Rtfilenametcanonic((s/usr/lib/python2.6/bdb.pyRscCs3ddk}|i�d|_|idd�dS(Ni����(t linecachet
checkcachetNonetbotframet
_set_stopinfo(RR((s/usr/lib/python2.6/bdb.pytreset$s
cCs�|iodS|djo|i|�S|djo|i||�S|djo|i||�S|djo|i||�S|djo|iS|djo|iS|djo|iSdGt|�GH|iS( Ntlinetcalltreturnt exceptiontc_calltc_exceptiontc_returns*bdb.Bdb.dispatch: unknown debugging event:(tquittingt
dispatch_linet
dispatch_calltdispatch_returntdispatch_exceptionttrace_dispatchtrepr(Rtframeteventtarg((s/usr/lib/python2.6/bdb.pyR%*s$
cCsL|i|�p|i|�o%|i|�|io
t�qEn|iS(N(t stop_heret
break_heret user_lineR RR%(RR'((s/usr/lib/python2.6/bdb.pyR!>s
cCst|idjo|i|_|iS|i|�p
|i|�pdS|i||�|io
t�n|iS(N( RRtf_backR%R*tbreak_anywheret user_callR R(RR'R)((s/usr/lib/python2.6/bdb.pyR"Ds
cCsO|i|�p||ijo(|i||�|io
t�qHn|iS(N(R*treturnframetuser_returnR RR%(RR'R)((s/usr/lib/python2.6/bdb.pyR#Qs
cCs?|i|�o(|i||�|io
t�q8n|iS(N(R*tuser_exceptionR RR%(RR'R)((s/usr/lib/python2.6/bdb.pyR$Ws
cCs}||ijo&|idjotS|i|ijSx@|dj o2||ij o"||ijotS|i}q9WtS(Ni����(t stopframet
stoplinenotFalsetf_linenoRRtTrueR-(RR'((s/usr/lib/python2.6/bdb.pyR*ascCs�|i|ii�}||ijotS|i}||i|jo)|ii}||i|jotSnt|||�\}}|o<|i|_ |o$|i
o|it|i��nt
StSdS(N(Rtf_codetco_filenameRR5R6tco_firstlinenot effectivetnumbert currentbpt temporarytdo_cleartstrR7(RR'Rtlinenotbptflag((s/usr/lib/python2.6/bdb.pyR+ns cCs
td�dS(Ns)subclass of bdb must implement do_clear()(tNotImplementedError(RR)((s/usr/lib/python2.6/bdb.pyR?�scCs|i|ii�|ijS(N(RR8R9R(RR'((s/usr/lib/python2.6/bdb.pyR.�scCsdS(snThis method is called when there is the remote possibility
that we ever need to stop in this function.N((RR't
argument_list((s/usr/lib/python2.6/bdb.pyR/�scCsdS(s9This method is called when we stop or break at this line.N((RR'((s/usr/lib/python2.6/bdb.pyR,�scCsdS(s5This method is called when a return trap is set here.N((RR'treturn_value((s/usr/lib/python2.6/bdb.pyR1�scCs|\}}}dS(N((RR'texc_infotexc_typet exc_valuet
exc_traceback((s/usr/lib/python2.6/bdb.pyR2�sicCs(||_||_d|_||_dS(Ni(R3R0R R4(RR3R0R4((s/usr/lib/python2.6/bdb.pyR�s cCs|i|||id�dS(sxStop when the line with the line no greater than the current one is
reached or when returning from current frameiN(RR6(RR'((s/usr/lib/python2.6/bdb.pyt set_until�scCs|idd�dS(sStop after one line of code.N(RR(R((s/usr/lib/python2.6/bdb.pytset_step�scCs|i|d�dS(s2Stop on the next line in or below the given frame.N(RR(RR'((s/usr/lib/python2.6/bdb.pytset_next�scCs|i|i|�dS(s)Stop when returning from the given frame.N(RR-(RR'((s/usr/lib/python2.6/bdb.pyt
set_return�scCsu|djoti�i}n|i�x*|o"|i|_||_|i}q-W|i�ti |i�dS(spStart debugging from `frame`.
If frame is not specified, debugging starts from caller's frame.
N(
Rtsyst _getframeR-RR%tf_traceRRLtsettrace(RR'((s/usr/lib/python2.6/bdb.pyt set_trace�s
cCsr|i|idd�|ipNtid�ti�i}x/|o#||ij o|`|i}q?WndS(Ni����( RRRRRORRRPR-RQ(RR'((s/usr/lib/python2.6/bdb.pytset_continue�s
cCs/|i|_d|_d|_tid�dS(Ni(RR3RR0R RORR(R((s/usr/lib/python2.6/bdb.pytset_quit�s c
Cs�|i|�}ddk}|i||�}|pd||fS||ijog|i|<n|i|}||jo|i|�nt|||||�} dS(Ni����sLine %s:%d does not exist(RRtgetlineRtappendR(
RRRAR>tcondtfuncnameRRtlistRB((s/usr/lib/python2.6/bdb.pyt set_break�s
cCs�|i|�}||ijo d|S||i|jod||fSx&ti||fD]}|i�q`Wtii||f�p|i|i|�n|i|p|i|=ndS(NsThere are no breakpoints in %ssThere is no breakpoint at %s:%d(RRRtbplisttdeleteMethas_keytremove(RRRARB((s/usr/lib/python2.6/bdb.pytclear_break�s c Csuyt|�}Wnd|SXyti|}Wntj
od|SX|p d|S|i|i|i�dS(Ns"Non-numeric breakpoint number (%s)s#Breakpoint number (%d) out of rangesBreakpoint (%d) already deleted(tintRt
bpbynumbert
IndexErrorR`tfileR(RR)R<RB((s/usr/lib/python2.6/bdb.pytclear_bpbynumbers
cCs||i|�}||ijo d|SxC|i|D]4}ti||f}x|D]}|i�qVWq6W|i|=dS(NsThere are no breakpoints in %s(RRRR\R](RRRtblistRB((s/usr/lib/python2.6/bdb.pytclear_all_file_breakss cCsE|ipdSx&tiD]}|o|i�qqWh|_dS(NsThere are no breakpoints(RRRbR](RRB((s/usr/lib/python2.6/bdb.pytclear_all_breakss
cCs0|i|�}||ijo||i|jS(N(RR(RRRA((s/usr/lib/python2.6/bdb.pyt get_break!scCsK|i|�}||ijo(||i|joti||fpgS(N(RRRR\(RRRA((s/usr/lib/python2.6/bdb.pyt
get_breaks&scCs3|i|�}||ijo|i|SgSdS(N(RR(RR((s/usr/lib/python2.6/bdb.pytget_file_breaks,scCs|iS(N(R(R((s/usr/lib/python2.6/bdb.pytget_all_breaks3scCsg}|o|i|jo
|i}nxF|dj o8|i||if�||ijoPn|i}q-W|i�tdt |�d�}x4|dj o&|i|i|i
f�|i}q�W|djotdt |�d�}n||fS(Nii(ttb_framettb_nextRRWR6RR-treversetmaxtlent tb_lineno(Rtftttstackti((s/usr/lib/python2.6/bdb.pyt get_stack9s$
s: cCs<ddk}ddk}|\}}|i|ii�}d||f}|iio||ii}n|d}d|ijo|id} nd} | o||i| �}n|d}d|ijo.|id}
|d}||i|
�}n|i|||i �}|o|||i
�}n|S(Ni����s%s(%r)s<lambda>t__args__s()t
__return__s->(RR&RR8R9tco_nametf_localsRRVt f_globalststrip(Rtframe_linenotlprefixRR&R'RARtstargstrvR((s/usr/lib/python2.6/bdb.pytformat_stack_entryMs*
c
Bs�|djoddk}|i}n|djo
|}n|i�ei|i�e|ei �p|d}nz(y|||UWne
j
onXWdd|_eid�XdS(Ni����s
i(Rt__main__t__dict__RRORRR%t
isinstancettypestCodeTypeRR (RtcmdtglobalstlocalsR�((s/usr/lib/python2.6/bdb.pytrunis
cCs�|djoddk}|i}n|djo
|}n|i�ti|i�t|ti �p|d}nz.yt
|||�SWntj
onXWdd|_tid�XdS(Ni����s
i(
RR�R�RRORRR%R�R�R�tevalRR (RtexprR�R�R�((s/usr/lib/python2.6/bdb.pytruneval{s
cCs|i|||�dS(N(R�(RR�R�R�((s/usr/lib/python2.6/bdb.pytrunctx�sc Osk|i�ti|i�d}z-y|||�}Wntj
onXWdd|_tid�X|S(Ni(RRORRR%RRR (RtfuncR�tkwdstres((s/usr/lib/python2.6/bdb.pytruncall�s
N(+RRRR RRR%R!R"R#R$R*R+R?R.R/R,R1R2RRKRLRMRNRRSRTRUR[R`ReRgRhRiRjRkRlRwR�R�R�R�R�(((s/usr/lib/python2.6/bdb.pyR
sR
cCst�i�dS(N(RRS(((s/usr/lib/python2.6/bdb.pyRS�scBs\eZdZdZhZdgZdddd�Zd�Zd�Z d�Z
dd�ZRS( s�Breakpoint class
Implements temporary breakpoints, ignore counts, disabling and
(re)-enabling, and conditionals.
Breakpoints are indexed by number through bpbynumber and by
the file,line tuple using bplist. The former points to a
single instance of class Breakpoint. The latter points to a
list of such instances since there may be more than one
breakpoint per line.
iicCs�||_d|_||_||_||_||_d|_d|_d|_ t
i|_t
idt
_|i
i|�|ii||f�o|i||fi|�n|g|i||f<dS(Nii(RYRtfunc_first_executable_lineRdRR>RXtenabledtignorethitsRtnextR<RbRWR\R^(RRdRR>RXRY((s/usr/lib/python2.6/bdb.pyR �s cCsV|i|if}d|i|i<|i|i|�|i|p|i|=ndS(N(RdRRRbR<R\R_(Rtindex((s/usr/lib/python2.6/bdb.pyR]�s
cCs
d|_dS(Ni(R�(R((s/usr/lib/python2.6/bdb.pytenable�scCs
d|_dS(Ni(R�(R((s/usr/lib/python2.6/bdb.pytdisable�scCs|djo
ti}n|io
d}nd}|io|d}n|d}|d|i||i|ifIJ|io|d|ifIJn|i o|d|i IJn|i
o;|i
djo
d }nd
}|d|i
|fIJndS(Nsdel skeep syes sno s%-4dbreakpoint %s at %s:%ds stop only if %ss ignore next %d hitsiR�ts! breakpoint already hit %d time%s(RROtstdoutR>R�R<RdRRXR�R�(Rtouttdisptss((s/usr/lib/python2.6/bdb.pytbpprint�s(
N(RRRR�R\RRbR R]R�R�R�(((s/usr/lib/python2.6/bdb.pyR�s
cCsx|ip|i|ijotStS|ii|ijotS|ip|i|_n|i|ijotStS(s;Check whether we should break here because of `b.funcname`.(RYRR6R5R7R8RzR�(tbR'((s/usr/lib/python2.6/bdb.pyt
checkfuncname�s
cCs'ti||f}x
tdt|��D]�}||}|idjoq)nt||�pq)n|id|_|ip5|idjo|id|_q)q|dfSq)yXt |i|i
|i�}|o2|idjo|id|_q
|dfSnWq)|dfSXq)WdS(s�Determine which breakpoint for this file:line is to be acted upon.
Called only if we know there is a bpt at this
location. Returns breakpoint that was triggered and a flag
that indicates if it is ok to delete a temporary bp.
iiN(NN(
RR\trangeRqR�R�R�RXR�R�R|R{R(RdRR't possiblesRvR�tval((s/usr/lib/python2.6/bdb.pyR;s0
tTdbcBs,eZd�Zd�Zd�Zd�ZRS(cCs.|ii}|p
d}ndG|G|GHdS(Ns???s+++ call(R8Rz(RR'R�tname((s/usr/lib/python2.6/bdb.pyR/Ks
cCsddk}|ii}|p
d}n|i|ii�}|i||i|i�}dG|G|iG|GdG|i�GHdS(Ni����s???s+++t:( RR8RzRR9RVR6R|R}(RR'RR�tfnR((s/usr/lib/python2.6/bdb.pyR,Os
cCs
dG|GHdS(Ns
+++ return((RR'tretval((s/usr/lib/python2.6/bdb.pyR1VscCsdG|GH|i�dS(Ns
+++ exception(RT(RR't exc_stuff((s/usr/lib/python2.6/bdb.pyR2Xs (RRR/R,R1R2(((s/usr/lib/python2.6/bdb.pyR�Js cCs*dG|GdGHt|d�}dG|GHdS(Nsfoo(t)i
sbar returned(tbar(tntx((s/usr/lib/python2.6/bdb.pytfoo\s
cCsdG|GdGH|dS(Nsbar(R�i((ta((s/usr/lib/python2.6/bdb.pyR�as
cCst�}|id�dS(Nsimport bdb; bdb.foo(10)(R�R�(Rt((s/usr/lib/python2.6/bdb.pyttestes (RROR
R�t__all__t ExceptionRRRSRR�R;R�R�R�R�(((s/usr/lib/python2.6/bdb.pyt<module>s�� T 5