U ÙAT^®ôã"@säddlZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z Gdd„deƒZdddddd d d d g Zd d„Zdd„Zdd„ZGdd„deƒZdZGdd„dejejƒZedk rbd dddddddddd d!d"d#d$d%d&d'dd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6g"ZeD]"Zeeed7eƒj ¡d87Zq.eejj7Z[[dId9d„Z dJd:d„Z!d;d„Z"dd „Z$dKd?d „Z%d@d„Z&dAZ'dBdC„Z(dDd „Z)dEZ*dFdG„Z+e,dHkràddl-Z-e- +¡dS)LéNc@s eZdZdS)ÚRestartN)Ú__name__Ú __module__Ú __qualname__©rrú/usr/lib64/python3.8/pdb.pyrVsrÚrunÚpmÚPdbÚrunevalÚrunctxÚruncallÚ set_traceÚ post_mortemÚhelpc Cs†t dt |¡¡}z t|ƒ}Wntk r6YdSX|@t|ddD],\}}| |¡rJ|||fW5QR£SqJW5QRXdS)Nzdef\s+%s\s*[(]é)Ústart)ÚreÚcompileÚescapeÚopenÚOSErrorÚ enumerateÚmatch)ÚfuncnameÚfilenameZcreÚfpÚlinenoÚlinerrrÚ find_function]s  &rcCsXt |¡\}}t |¡r,|j|jkr,|dfSt |¡r>|dfSt ||d…¡|dfS©Nr)ÚinspectZ findsourceZisframeÚ f_globalsÚf_localsZismoduleZgetblock)ÚobjÚlinesrrrrÚgetsourcelinesjs  r&cCs8tt |¡ƒ}| ¡|D]\}}||kr|SqdS©Nr)ÚlistÚdisZfindlinestartsÚreverse)ÚcodeZlastiZ linestartsÚirrrrÚ lasti2linenoss   r-c@seZdZdd„ZdS)Ú_rstrcCs|S©Nr©ÚselfrrrÚ__repr__~sz_rstr.__repr__N)rrrr2rrrrr.|sr.z -> c@seZdZdZd£dd„Zdd„Zd d „Zd d „Zd d„Zdd„Z dd„Z dd„Z dd„Z dd„Z dd„Zdd„Zdd„Zdd „Zd!d"„Zd#d$„Zd%d&„Zd'd(„Zd)d*„Zd+d,„Zd-d.„Zd/d0„Zd1d2„Zd3d4„Zd5d6„ZeZd¤d8d9„Zd:d;„ZeZ eZ!eZ"dd?„Z%d@dA„Z&dBdC„Z'eZ(dDdE„Z)eZ*dFdG„Z+eZ,dHdI„Z-eZ.dJdK„Z/e/Z0eZ1eZ2dLdM„Z3e3Z4e3Z5dNdO„Z6dPdQ„Z7e7Z8dRdS„Z9e9Z:dTdU„Z;e;ZdXdY„Z?e?Z@dZd[„ZAeAZBd\d]„ZCeCZDd^d_„ZEeEZFZGd`da„ZHeHZIdbdc„ZJeZKddde„ZLeLZMeLZNdfdg„ZOdhdi„ZPePZQdjdk„ZReRZSdldm„ZTd¥dndo„ZUdpdq„ZVdrds„ZWeZXeZYeZZdtdu„Z[e[Z\dvdw„Z]e]Z^dxdy„Z_eZ`d¦d{d|„Zad}d~„ZbeZcdd€„ZdeZedd‚„Zfdƒd„„Zgd…d†„Zhd‡dˆ„Zid‰dŠ„Zjd‹dŒ„ZkddŽddd‘d’gZld“d”„Zmenfd•d–„Zod—d˜„ZpepZqd™dš„Zrd›dœ„Zsddž„ZtdŸd „Zud¡d¢„ZvdS)§r NÚtabFTc Cs>tjj||dtj ||||¡t d¡|r6d|_d|_i|_ i|_ d|_ d|_ i|_ zddl}| d¡Wntk r„YnXd|_||_g|_|rz,ttj d¡ƒ}|j |¡W5QRXWntk rÞYnXz$td ƒ}|j |¡W5QRXWntk rYnXi|_i|_i|_d|_d|_dS) N)Úskipzpdb.Pdbrz(Pdb) ÚFz `@#$%^&*()=+[{]}\|;:'",<>?z~/.pdbrcz.pdbrc)ÚbdbÚBdbÚ__init__ÚcmdÚCmdÚsysÚauditZ use_rawinputÚpromptÚaliasesÚ displayingÚ mainpyfileÚ_wait_for_mainpyfileÚ tb_linenoÚreadlineZset_completer_delimsÚ ImportErrorÚ allow_kbdintÚnosigintÚrcLinesrÚosÚpathÚ expanduserÚextendrÚcommandsÚcommands_dopromptÚcommands_silentÚcommands_definingÚ commands_bnum) r1Ú completekeyÚstdinÚstdoutr4rFZreadrcrCZrcFilerrrr8sF  z Pdb.__init__cCs*|jr t‚| d¡| ¡| |¡dS)Nz- Program interrupted. (Use 'cont' to resume).)rEÚKeyboardInterruptÚmessageÚset_stepr)r1ÚsignumÚframerrrÚsigint_handler¼s  zPdb.sigint_handlercCstj |¡| ¡dSr/)r6r7ÚresetÚforgetr0rrrrZÃs z Pdb.resetcCs&d|_g|_d|_d|_|j ¡dSr')rÚstackÚcurindexÚcurframerBÚclearr0rrrr[Çs z Pdb.forgetcCsh| ¡| ||¡\|_|_|rDt|jj|jƒ}||j|j<|j }q|j|jd|_ |j j |_ |  ¡Sr')r[Z get_stackr\r]r-Útb_frameÚf_codeÚtb_lastirBÚtb_nextr^r#Úcurframe_localsÚ execRcLines)r1ÚfÚtbrrrrÚsetupÎs  z Pdb.setupcCsd|js dS|j}| ¡g|_|r`| ¡ ¡}|r|ddkr| |¡r|jt|ƒ7_dSqdS)Nrú#T)rGr*ÚpopÚstripÚonecmdÚreversed)r1rGrrrrreàs  zPdb.execRcLinescCs.|jr dS| |¡r*| d¡| |d¡dS)Nz--Call--)rAZ stop_hererUÚ interaction)r1rXZ argument_listrrrÚ user_callôs   z Pdb.user_callcCsH|jr.|j| |jj¡ks$|jdkr(dSd|_| |¡rD| |d¡dS)NrF)rAr@ÚcanonicraÚ co_filenameÚf_linenoÚ bp_commandsrn)r1rXrrrÚ user_lineýsÿ z Pdb.user_linecCs”t|ddƒr|j|jkr|j}d|_|j}| |d¡|j|D]}| |¡q@||_|j|sr| |j|j ¡|j |r„|  ¡|  ¡dSdS)NÚ currentbpFrr) ÚgetattrrurLÚlastcmdrhrlrNÚprint_stack_entryr\r]rMÚ_cmdloopr[)r1rXruZ lastcmd_backrrrrrss"  ÿ    zPdb.bp_commandscCs.|jr dS||jd<| d¡| |d¡dS)NÚ __return__z --Return--)rAr#rUrn)r1rXZ return_valuerrrÚ user_returns   zPdb.user_returncCsh|jr dS|\}}}||f|jd<|s2|tkr2dnd}| d|t ||¡d ¡f¡| ||¡dS)NZ __exception__z Internal r5z%s%séÿÿÿÿ)rAr#Ú StopIterationrUÚ tracebackÚformat_exception_onlyrkrn)r1rXÚexc_infoÚexc_typeÚ exc_valueÚ exc_tracebackÚprefixrrrÚuser_exception's ÿÿÿzPdb.user_exceptioncCsBzd|_| ¡d|_Wq>Wqtk r:| d¡YqXqdS)NTFz--KeyboardInterrupt--)rEÚcmdlooprTrUr0rrrry;sz Pdb._cmdloopcCs^|j |j¡}|rZ| ¡D]>\}}| |¡}||k r||kr|||<| d|||f¡qdS)Nzdisplay %s: %r [old: %r])r?Úgetr^ÚitemsÚ_getval_exceptrU)r1r?ÚexprZoldvalueZnewvaluerrrÚpreloopHs ÿz Pdb.preloopcCsttjr6zt tjtj¡Wntk r.YnXdt_| ||¡rN| ¡dS| |j|j ¡|  ¡| ¡dSr/) r Ú_previous_sigint_handlerÚsignalÚSIGINTÚ ValueErrorrhr[rxr\r]ry)r1rXr~rrrrnUs zPdb.interactioncCs|dk r| t|ƒ¡dSr/)rUÚrepr)r1r$rrrÚ displayhookgszPdb.displayhookc CsÈ|dd…dkr|dd…}|j}|jj}zdt|dddƒ}tj}tj}tj}z(|jt_|jt_|jt_t|||ƒW5|t_|t_|t_XWn4t  ¡dd…}|  t j |Žd  ¡¡YnXdS)Nrú!Ú zZsingleér|)rdr^r"rr;rSrRr‘Úexecr€Úerrorr~rrk) r1rÚlocalsÚglobalsr+Z save_stdoutZ save_stdinZsave_displayhookr€rrrÚdefaultos(  z Pdb.defaultcCsØ| ¡s |S| ¡}|d|jkr†|j|d}d}|dd…D] }| dt|ƒ|¡}|d7}q@| dd |dd…¡¡}| ¡}q|ddkrÔ| d¡}|dkrÔ||dd… ¡}|j  |¡|d|…  ¡}|S) Nrrú%z%*ú Úaliasz;;r”) rkÚsplitr>ÚreplaceÚstrÚjoinÚfindÚlstripÚcmdqueueÚappendÚrstrip)r1rÚargsÚiiZtmpArgZmarkerÚnextrrrÚprecmd…s(ÿ     z Pdb.precmdcCs"|jstj ||¡S| |¡SdSr/)rOr9r:rlÚhandle_command_def)r1rrrrrlžsz Pdb.onecmdcCsÄ| |¡\}}}|sdS|dkr0d|j|j<dS|dkrBg|_dS|j|j}|rf| |d|¡n | |¡zt|d|ƒ}Wntk rœ|j}YnX|j |j krÀd|j |j<g|_dSdS)NZsilentTÚendrr›Údo_F) Z parselinerNrPr£rLr¤rvÚAttributeErrorr™rÚcommands_resumingrM)r1rr9ÚargZcmdlistÚfuncrrrrªªs,      zPdb.handle_command_defcCst||jddS)N©Úfile©ÚprintrS©r1ÚmsgrrrrUÈsz Pdb.messagecCstd||jddS)Nz***r±r³rµrrrr–Ësz Pdb.errorcCs | ¡ d¡rgSz| ||||¡}Wntk r>g}YnXt |d¡}|D]H}tj |¡rr| |d¡qRtj  |¡rR|  ¡ d¡rR| |d¡qR|S)N)ú:ú,Ú*ú/)ú.pyz.pywr·) rkÚendswithÚ_complete_expressionÚ ExceptionÚglobrHrIÚisdirr¤ÚisfileÚlower)r1ÚtextrÚbegidxÚendidxÚretÚglobsÚfnrrrÚ_complete_locationÑs  zPdb._complete_locationcs‡fdd„ttjjƒDƒS)Ncs.g|]&\}}|dk rt|ƒ ˆ¡rt|ƒ‘qSr/)rŸÚ startswith)Ú.0r,Úbp©rÃrrÚ èsÿz*Pdb._complete_bpnumber..)rr6Ú BreakpointÚ bpbynumber©r1rÃrrÄrÅrrÍrÚ_complete_bpnumberäszPdb._complete_bpnumberc s¼|js gS|jj|j–}dˆkr¢ˆ d¡‰z,|ˆd}ˆdd…D]}t||ƒ}qDWnttfk rrgYSXd ˆdd…¡d‰‡‡fdd„t|ƒDƒS‡fdd„|  ¡DƒSdS)NÚ.rrr|cs"g|]}| ˆd¡rˆ|‘qS)r|©rÊ©rËÚn)Údottedr„rrrÎÿsz,Pdb._complete_expression..csg|]}| ˆ¡r|‘qSrrÔrÕrÍrrrÎs ) r^r"rdrrvÚKeyErrorr­r ÚdirÚkeys)r1rÃrrÄrÅÚnsr$Úpartr)r×r„rÃrr½ës   zPdb._complete_expressioncCs,|sttjjƒd}n&z t|ƒ}Wn| d¡YdSX||_||jkrj|j||j||j |f}nd}g|j|<d|j|<d|j |<|j }d|_ d|_ zzz |  ¡Wnht k r|rî|d|j|<|d|j|<|d|j |<n|j|=|j|=|j |=| d¡YnXW5d|_ ||_ XdS) Nrz.Usage: commands [bnum] ... endTFz(com) rr”z1command definition aborted, old commands restored)Úlenr6rÏrÐÚintr–rPrLrMrNr=rOr†rT)r1r¯ZbnumZold_command_defsZ prompt_backrrrÚ do_commandssB%   þ    zPdb.do_commandsrc CsB|s8|jr4| d¡tjjD]}|r| | ¡¡qdSd}d}d}| d¡}|dkrz||dd… ¡}|d|… ¡}|  d¡}d} |dkr|d|… ¡}|  |¡} | sÂ|  d|¡dS| }||dd… ¡}z t |ƒ}Wn&t k r |  d|¡YdSXnÀz t |ƒ}Wn²t k rÎzt||jj|jƒ} Wn|} YnXz.t| dƒrj| j} | j} | j} | j}| j}WnD| |¡\} }}| s¸|  d |¡YYdS| } t |ƒ}YnXYnX|sÞ| ¡}| ||¡}|r>| ||||| ¡}|r|  |¡n*| ||¡d }| d |j|j|jf¡dS) Nz!Num Type Disp Enb Wherer¸rrr·z%r not found from sys.pathzBad lineno: %sÚ__func__zJThe specified object %r is not a function or was not found along sys.path.r|zBreakpoint %d at %s:%d) ÚbreaksrUr6rÏrÐZbpformatr¡r¢r¥ÚrfindÚ lookupmoduler–rÞrÚevalr^r"rdÚhasattrràÚ__code__Úco_nameÚco_firstlinenorqÚlineinfoÚ defaultFileÚ checklineZ set_breakÚ get_breaksÚnumberr²r)r1r¯Z temporaryrÌrrÚcondZcommaÚcolonrrfr°r+ÚokZlnrÚerrrrrÚdo_breakWs„         þ   ÿ  ÿz Pdb.do_breakcCs"|jjj}|dkr|jr|j}|S)Nz)r^rarqr@)r1rrrrrê´s zPdb.defaultFilecCs| |d¡dSr )rò©r1r¯rrrÚ do_tbreakÀsz Pdb.do_tbreakc CsÌd}| d¡}t|ƒdkr(|d ¡}nt|ƒdkrB|d ¡}n|S|dkrR|S| d¡}|ddkr~|d=t|ƒdkr~|S| ¡}t|ƒdkrœ|d}n| |d¡}|r²|}|d}t||ƒ} | pÊ|S) N)NNNú'rrér5rÓr1)rrÝrkrêrãr) r1Z identifierZfailedZidstringÚidÚpartsÚfnameÚitemrfZanswerrrrréÉs.         z Pdb.lineinfocCs€t|dƒr|jjnd}t |||¡}|s6| d¡dS| ¡}|rn|ddksn|dd…dksn|dd…dkr|| d¡dS|S) Nr^z End of filerriröz"""z'''zBlank or comment)rår^r"Ú linecacheÚgetlinerUrkr–)r1rrrÇrrrrrëês ÿÿ z Pdb.checklinec Csh| ¡}|D]V}z| |¡}Wn,tk rJ}z| |¡W5d}~XYq X| ¡| d|¡q dS)Nz Enabled %s)rÚget_bpbynumberrr–ÚenablerU©r1r¯r¦r,rÌrñrrrÚ do_enableÿsz Pdb.do_enablec Csh| ¡}|D]V}z| |¡}Wn,tk rJ}z| |¡W5d}~XYq X| ¡| d|¡q dS)Nz Disabled %s)rrýrr–ÚdisablerUrÿrrrÚ do_disableszPdb.do_disablec CsÂ| dd¡}z |d}Wntk r0d}YnXz| |d ¡¡}WnHtk rf| d¡YnXtk r}z| |¡W5d}~XYn.X||_|s®| d|j¡n| d|j¡dS)Nr›rrúBreakpoint number expectedz#Breakpoint %d is now unconditional.z$New condition set for breakpoint %d.) rÚ IndexErrorrýrkr–rrîrUrí)r1r¯r¦rîrÌrñrrrÚ do_condition$s   zPdb.do_conditionc CsÜ| ¡}zt|d ¡ƒ}Wnd}YnXz| |d ¡¡}WnHtk rb| d¡Ynvtk rŒ}z| |¡W5d}~XYnLX||_|dkrÈ|dkr®d|}nd}| d||j f¡n| d|j ¡dS)Nrrrz %d crossingsz 1 crossingz%Will ignore next %s of breakpoint %d.z-Will stop next time breakpoint %d is reached.) rrÞrkrýrr–rÚignorerUrí)r1r¯r¦ÚcountrÌrñZcountstrrrrÚ do_ignore?s,   ÿÿz Pdb.do_ignorec Cs€|stz tdƒ}Wntk r(d}YnX| ¡ ¡}|dkrpdd„tjjDƒ}| ¡|D]}| d|¡q\dSd|kr|  d¡}|d|…}||dd…}z t |ƒ}Wnt k rÌd |}YnX|  ||¡}|  ||¡}|rö| |¡n|D]}| d|¡qúdS| ¡} | D]\}z| |¡}Wn.t k r^}z| |¡W5d}~XYnX| |¡| d|¡qdS) NzClear all breaks? Úno)ÚyZyescSsg|] }|r|‘qSrr)rËrÌrrrrÎpsz Pdb.do_clear..z Deleted %sr·rzInvalid line number (%s))ÚinputÚEOFErrorrkrÂr6rÏrÐZclear_all_breaksrUrârÞrrìZ clear_breakr–rrýZclear_bpbynumber) r1r¯ZreplyZbplistrÌr,rrrñZ numberlistrrrÚdo_clearbsF           z Pdb.do_clearcCs | ¡dSr/)Úprint_stack_tracerórrrÚdo_where•sz Pdb.do_wherecCs>||_|j|jd|_|jj|_| |j|j¡d|_dSr')r]r\r^r#rdrxr)r1rírrrÚ _select_frameŸs  zPdb._select_framecCsz|jdkr| d¡dSzt|p"dƒ}Wn$tk rL| d|¡YdSX|dkr\d}ntd|j|ƒ}| |¡dS)Nrz Oldest framerúInvalid frame count (%s))r]r–rÞrÚmaxr©r1r¯rZnewframerrrÚdo_up§s  z Pdb.do_upcCs˜|jdt|jƒkr"| d¡dSzt|p,dƒ}Wn$tk rV| d|¡YdSX|dkrpt|jƒd}ntt|jƒd|j|ƒ}| |¡dS)Nrz Newest framerr)r]rÝr\r–rÞrÚminrrrrrÚdo_down»s z Pdb.do_downcCsh|rRz t|ƒ}Wn$tk r4| d|¡YdSX||jjkrV| d¡dSnd}| |j|¡dS)NúError in argument: %rz7"until" line number is smaller than current line numberr)rÞrr–r^rrZ set_until)r1r¯rrrrÚdo_untilÏs   z Pdb.do_untilcCs | ¡dSr )rVrórrrÚdo_stepçsz Pdb.do_stepcCs| |j¡dSr )Zset_nextr^rórrrÚdo_nextñs z Pdb.do_nextcCs<|r4ddl}tjdd…}| |¡t_|tjdd…<t‚dS)Nrr)Úshlexr;Úargvrr)r1r¯rZargv0rrrÚdo_runús  z Pdb.do_runcCs| |j¡dSr )Z set_returnr^rórrrÚ do_return s z Pdb.do_returncCs>|js2zt tj|j¡t_Wntk r0YnX| ¡dSr )rFrrŽrYr rŒrZ set_continuerórrrÚ do_continuesÿzPdb.do_continuec Cs¾|jdt|jƒkr"| d¡dSz t|ƒ}Wntk rL| d¡YnnXz:||j_|j|jd|f|j|j<| |j|j¡Wn0tk r¸}z| d|¡W5d}~XYnXdS)Nrz)You can only jump within the bottom framez)The 'jump' command requires a line numberrzJump failed: %s) r]rÝr\r–rÞrr^rrrx)r1r¯ÚerrrÚdo_jump%s   z Pdb.do_jumpcCs¼t d¡|jj}|j}t|j|j|jƒ}d|j   ¡|_ |  d¡zt  |j |||f¡Wn<tk r˜t ¡dd…}| tj|Žd  ¡¡YnX|  d¡t |j¡|j|_dS)Nz(%s) zENTERING RECURSIVE DEBUGGERr”r|zLEAVING RECURSIVE DEBUGGER)r;Úsettracer^r"rdr rQrRrSr=rkrUÚ call_tracingrr¾r€r–r~rZtrace_dispatchrw)r1r¯r˜r—Úpr€rrrÚdo_debugBs    z Pdb.do_debugcCsd|_| ¡dS)NTr)Ú_user_requested_quitÚset_quitrórrrÚdo_quitYsz Pdb.do_quitcCs| d¡d|_| ¡dS)Nr5Tr)rUr&r'rórrrÚdo_EOFds z Pdb.do_EOFcCsŽ|jj}|j}|j|j}|jtj@r.|d}|jtj@rB|d}t |ƒD]>}|j |}||krx|  d|||f¡qJ|  d|f¡qJdS)Nrz%s = %rz%s = *** undefined ***) r^rardÚ co_argcountÚco_kwonlyargcountÚco_flagsr!Z CO_VARARGSZCO_VARKEYWORDSÚrangeÚ co_varnamesrU)r1r¯ÚcoÚdictrÖr,ÚnamerrrÚdo_argsms     z Pdb.do_argscCs.d|jkr | t|jdƒ¡n | d¡dS)NrzzNot yet returned!)rdrUrr–rórrrÚ do_retval~s z Pdb.do_retvalcCsPzt||jj|jƒWSt ¡dd…}| tj|Žd  ¡¡‚YnXdS)Nr”r|) rär^r"rdr;r€r–r~rrk)r1r¯r€rrrÚ_getvalˆs z Pdb._getvalcCsrz2|dkrt||jj|jƒWSt||j|jƒWSWn:t ¡dd…}tj|Žd  ¡}t d|ƒYSXdS)Nr”r|z** raised %s **) rär^r"rdr#r;r€r~rrkr.)r1r¯rXr€rñrrrr‰szPdb._getval_exceptcCs*z| t| |¡ƒ¡Wn YnXdSr/)rUrr4rórrrÚdo_p›szPdb.do_pcCs,z| t | |¡¡¡Wn YnXdSr/)rUÚpprintZpformatr4rórrrÚdo_pp¤sz Pdb.do_ppcCsfd|_d}|rœ|dkrœz^d|krX| d¡\}}t| ¡ƒ}t| ¡ƒ}||krr||}nt| ¡ƒ}td|dƒ}WqÌtk r˜| d|¡YdSXn0|jdks®|dkrÂtd|jj dƒ}n |jd}|dkrÜ|d}|jj j }|  |¡}zZt  ||jj¡}| ||d|…|||j¡t|t|ƒƒ|_t|ƒ|krH| d¡Wntk r`YnXdS) Nr(rÓr¸réré z[EOF])rwrrÞrkrrr–rr^rrrarqÚget_file_breaksrûÚgetlinesr"Ú _print_linesrrÝrUrT)r1r¯ZlastÚfirstrÚ breaklistr%rrrÚdo_list±s@         ÿz Pdb.do_listc Csp|jjj}| |¡}zt|jƒ\}}Wn2tk rX}z| |¡WY¢dSd}~XYnX| ||||j¡dSr/)r^rarqr:r&rr–r<)r1r¯rr>r%rrñrrrÚ do_longlistäs   zPdb.do_longlistc Csvz| |¡}WnYdSXzt|ƒ\}}Wn6ttfk rd}z| |¡WY¢dSd}~XYnX| ||¡dSr/)r4r&rÚ TypeErrorr–r<)r1r¯r$r%rrñrrrÚ do_sourceòs z Pdb.do_sourcerc Cs®|r|j}|j |d¡}nd}}t||ƒD]|\}}t|ƒ d¡} t| ƒdkrV| d7} ||krh| d7} n| d7} ||kr‚| d7} n||kr’| d7} | | d| ¡¡q,dS) Nr|röér›ÚBz->z>>ú ) rrrBr‡rrŸÚrjustrÝrUr¥) r1r%rrárXZcurrent_linenoZ exc_linenorrÚsrrrr<s    zPdb._print_linescCsÊz| |¡}WnYdSXd}z |j}Wntk r@YnX|rZ| d|j¡dSz |jj}Wntk rzYnX|r”| d|j¡dS|jtkr¸| d|j|j f¡dS| t|ƒ¡dS)Nz Function %sz Method %sz Class %s.%s) r4rær¾rUrçràÚ __class__Útyperr)r1r¯Úvaluer+rrrÚ do_whatiss.   z Pdb.do_whatiscCsl|s8| d¡|j |ji¡ ¡D]}| d|¡q"n0| |¡}||j |ji¡|<| d||f¡dS)NzCurrently displaying:z%s: %rzdisplay %s: %r)rUr?r‡r^rˆr‰Ú setdefault)r1r¯rúÚvalrrrÚ do_display;s  zPdb.do_displaycCsT|r@z|j |ji¡|=WqPtk r<| d|¡YqPXn|j |jd¡dS)Nznot displaying %s)r?r‡r^rØr–rjrórrrÚ do_undisplayNs zPdb.do_undisplaycs‡fdd„|j |ji¡DƒS)Ncsg|]}| ˆ¡r|‘qSrrÔ)rËr rÍrrrÎ^s ÿz*Pdb.complete_undisplay..)r?r‡r^rÑrrÍrÚcomplete_undisplay]szPdb.complete_undisplaycCs |jj|j–}tjd|ddS)Nz *interactive*)Úlocal)r^r"rdr+Úinteract)r1r¯rÛrrrÚ do_interactaszPdb.do_interactcCs¤| ¡}t|ƒdkrHt|j ¡ƒ}|D]}| d||j|f¡q&dS|d|jkr„t|ƒdkr„| d|d|j|df¡nd |dd…¡|j|d<dS)Nrz%s = %srr›)rrÝÚsortedr>rÚrUr )r1r¯r¦rÚrœrrrÚdo_aliasjs "z Pdb.do_aliascCs6| ¡}t|ƒdkrdS|d|jkr2|j|d=dSr')rrÝr>)r1r¯r¦rrrÚ do_unaliass  zPdb.do_unaliascs‡fdd„|jDƒS)Ncsg|]}| ˆ¡r|‘qSrrÔ)rËÚarÍrrrΗs z(Pdb.complete_unalias..)r>rÑrrÍrÚcomplete_unalias–szPdb.complete_unaliasrrrrr(r!cCs4z|jD]}| |¡qWntk r.YnXdSr/)r\rxrT)r1Ú frame_linenorrrr¥s  zPdb.print_stack_tracecCs6|\}}||jkrd}nd}| || ||¡¡dS)Nz> z )r^rUZformat_stack_entry)r1rYZ prompt_prefixrXrr„rrrrx¬s  ÿzPdb.print_stack_entrycCs¨|stj ||¡Sz@zt|d|ƒ}|ƒWWStk rNt|d|ƒ}YnXWn"tk rt| d|¡Yn0Xtjjdkr”| d|¡dS|  |j   ¡¡dS)NZhelp_r¬zNo help for %rr”zJNo help for %r; please do not run Python with -OO if you need command help) r9r:Údo_helprvr­r–r;ÚflagsÚoptimizerUÚ__doc__r¥)r1r¯ZtopicZcommandrrrrZ·s   ÿz Pdb.do_helpcCs| |jjpd ¡¡dS)Nr5)rUÚ help_execr]rkr0rrrr^Ñs z Pdb.help_execcCs tƒdSr/)rr0rrrÚhelp_pdbÝsz Pdb.help_pdbcCsÊtj |¡rtj |¡r|Stj tjd|¡}tj |¡rP| |¡|jkrP|Stj |¡\}}|dkrp|d}tj |¡r€|StjD]>}tj  |¡r¢t  |¡}qŠtj ||¡}tj |¡r†|Sq†dS)Nrr5r») rHrIÚisabsÚexistsr r;rpr@ÚsplitextÚislinkÚreadlink)r1rrfÚrootÚextÚdirnameÚfullnamerrrrãâs"      zPdb.lookupmodulec Csrd|_d|_ddl}| |¡\}}}| |j¡|_ddl}|j  ¡|j  d|j|j |j |t dœ¡| |¡dS)NTFrÚ__main__)rÚ__file__Ú __package__Ú __loader__Ú__spec__Ú __builtins__)rAr&ÚrunpyÚ_get_module_detailsrprqr@riÚ__dict__r_ÚupdateÚparentÚloaderrnr)r1Ú module_nameroÚmod_nameÚmod_specr+rirrrÚ _runmoduleús  úzPdb._runmodulec Cstddl}|j ¡|j d|tdœ¡d|_| |¡|_d|_t   |¡}d|  ¡|jf}W5QRX|  |¡dS)Nrri)rrjrnTFzexec(compile(%r, %r, 'exec'))) rirqr_rrrnrArpr@r&ÚioÚ open_codeÚreadr)r1rrirÚ statementrrrÚ _runscript s þ    ÿzPdb._runscript)r3NNNFT)r)N)rN)wrrrrŒr8rYrZr[rhrerortrsr{r…ryr‹rnr‘r™r©rlrªrUr–rÉrÒr½rßZcomplete_commandsròrêZdo_bZcomplete_breakZ complete_brôZcomplete_tbreakrérërZcomplete_enablerZcomplete_disablerZcomplete_conditionrZcomplete_ignorer Zdo_clZcomplete_clearZ complete_clrZdo_wZdo_btrrZdo_urZdo_drZdo_untrZdo_srZdo_nrZ do_restartrZdo_rrZdo_cZdo_contr!Zdo_jr%Zcomplete_debugr(Zdo_qZdo_exitr)r2Zdo_ar3Zdo_rvr4r‰r5r7Zcomplete_printZ complete_pZ complete_ppr?Zdo_lr@Zdo_llrBZcomplete_sourcer<rKZcomplete_whatisrNZcomplete_displayrOrPrSrUrVrXr®rÚ line_prefixrxrZZdo_hr^r_rãrxr}rrrrr ‰sðÿ /     M ]!!.    1  ! # ÿ   ÚwhereZdownZupÚbreakZtbreakr_rrþrZ conditionrLÚstepr¨ZuntilZjumpÚreturnZretvalÚcontinuer(Zlonglistr¦r$ÚppZwhatisÚsourceZdisplayZ undisplayrRrœZunaliasÚdebugÚquitr¬z cCstƒ |||¡dSr/)r r©r|r˜r—rrrr;scCstƒ |||¡Sr/)r r )Z expressionr˜r—rrrr >scCst|||ƒdSr/)rrˆrrrr AscOstƒj||ŽSr/)r r )r¦Úkwdsrrrr Es)ÚheadercCs,tƒ}|dk r| |¡| t ¡j¡dSr/)r rUrr;Ú _getframeÚf_back)rŠÚpdbrrrrHs cCsB|dkrt ¡d}|dkr$tdƒ‚tƒ}| ¡| d|¡dS)Nr”zAA valid traceback must be passed if no exception is being handled)r;r€rr rZrn)Útr$rrrrPs cCsttjƒdSr/)rr;Úlast_tracebackrrrrr ^szimport x; x.main()cCs ttƒdSr/)rÚTESTCMDrrrrÚtestfsr‘cCsddl}| t¡dSr')ÚpydocZpagerr])r’rrrrjsausage: pdb.py [-c command] ... [-m module | pyfile] [arg] ... Debug the Python program given by pyfile. Alternatively, an executable module or package to debug can be specified using the -m switch. Initial commands are read from .pdbrc files in your home directory and in the current directory, if they exist. Commands supplied with -c are executed after commands from .pdbrc files. To let the script run until an exception occurs, use "-c continue". To let the script run up to a given line X in the debugged file, use "-c 'until X'".c Csddl}| tjdd…dddg¡\}}|s>ttƒt d¡g}d}|D]B\}}|dkrlttƒt ¡qJ|d kr€| |¡qJ|d krJd }qJ|d}|s¼tj  |¡s¼td |d ƒt d¡|tjdd…<|sàtj  |¡tjd<t ƒ}|j   |¡z6|r| |¡n | |¡|jrWqtdƒWqòtk r\td|dƒtdd |¡ƒYqòtk rŒtdddtt ¡dƒYqòtk r²t ¡t d¡Yqòt ¡tdƒtdƒt ¡d} | d| ¡td|dƒYqòXqòdS)Nrrzmhc:rzcommand=r”F)z-hz--help)z-cz --command)z-mTzError:zdoes not existz*The program finished and will be restartedZ Restartingzwith arguments:rEr›z/The program exited via sys.exit(). Exit status:)r«z2Uncaught exception. Entering post mortem debuggingz1Running 'cont' or 'step' will restart the programz#Post mortem debugger finished. The z will be restarted)Úgetoptr;rr´Ú_usageÚexitr¤rHrIrargr rGrKrxr}r&rr Ú SystemExitr€Ú SyntaxErrorr~Ú print_excrn) r“Zoptsr¦rLZ run_as_moduleÚoptZoptargr@rrŽrrrÚmain}sb               ÿršri)NN)NN)N).rHryrr;r9r6r)r+r¿r6rr!r~rûr¾rÚ__all__rr&r-rŸr.r~r7r:r r]Z _help_orderZ_commandrvrkr^rr r r rrr rr‘rr”ršrrrrrrÚFs´ÿ    * û     C