U e5dõã"@sìddlZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZGdd„deƒZdddddd d d d g Zd d„Zdd„Zdd„ZGdd„deƒZdZGdd„dejejƒZedk rjd dddddddddd d!d"d#d$d%d&d'dd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6g"ZeD]"Zeeed7eƒj ¡d87Zq6eej j7Z[[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.pyrWsrÚrunÚpmÚPdbÚrunevalÚrunctxÚruncallÚ set_traceÚ post_mortemÚhelpc Csˆt dt |¡¡}zt |¡}Wntk r8YdSX|@t|ddD],\}}| |¡rL|||fW5QR£SqLW5QRXdS)Nzdef\s+%s\s*[(]é)Ústart)ÚreÚcompileÚescapeÚtokenizeÚopenÚOSErrorÚ enumerateÚmatch)ÚfuncnameÚfilenameZcreÚfpÚlinenoÚlinerrrÚ find_function^s &r cCsXt |¡\}}t |¡r,|j|jkr,|dfSt |¡r>|dfSt ||d…¡|dfS©Nr)ÚinspectZ findsourceZisframeÚ f_globalsÚf_localsZismoduleZgetblock)ÚobjÚlinesrrrrÚgetsourcelinesks  r'cCs8tt |¡ƒ}| ¡|D]\}}||kr|SqdS©Nr)ÚlistÚdisZfindlinestartsÚreverse)ÚcodeZlastiZ linestartsÚirrrrÚ lasti2linenots   r.c@seZdZdd„ZdS)Ú_rstrcCs|S©Nr©ÚselfrrrÚ__repr__sz_rstr.__repr__N)rrrr3rrrrr/}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) r2Ú completekeyÚstdinÚstdoutr5rGZreadrcrDZrcFilerrrr9ŽsF  z Pdb.__init__cCs*|jr t‚| d¡| ¡| |¡dS)Nz- Program interrupted. (Use 'cont' to resume).)rFÚKeyboardInterruptÚmessageÚset_stepr)r2ZsignumÚframerrrÚsigint_handler½s  zPdb.sigint_handlercCstj |¡| ¡dSr0)r7r8ÚresetÚforgetr1rrrrZÄs z Pdb.resetcCs&d|_g|_d|_d|_|j ¡dSr()rÚstackÚcurindexÚcurframerCÚclearr1rrrr[È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_lastirCÚtb_nextr^r$Úcurframe_localsÚ execRcLines)r2ÚfÚtbrrrrÚsetupÏs  z Pdb.setupcCsd|js dS|j}| ¡g|_|r`| ¡ ¡}|r|ddkr| |¡r|jt|ƒ7_dSqdS)Nrú#T)rHr+ÚpopÚstripÚonecmdÚreversed)r2rHrrrrreás  zPdb.execRcLinescCs.|jr dS| |¡r*| d¡| |d¡dS)Nz--Call--)rBZ stop_hererVÚ interaction)r2rXZ argument_listrrrÚ user_callõs   z Pdb.user_callcCsH|jr.|j| |jj¡ks$|jdkr(dSd|_| |¡rD| |d¡dS)NrF)rBrAÚcanonicraÚ co_filenameÚf_linenoÚ bp_commandsrn)r2rXrrrÚ 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) ÚgetattrrurMÚlastcmdrhrlrOÚprint_stack_entryr\r]rNÚ_cmdloopr[)r2rXruZ lastcmd_backrrrrrss"  ÿ    zPdb.bp_commandscCs.|jr dS||jd<| d¡| |d¡dS)NÚ __return__z --Return--)rBr$rVrn)r2rXZ return_valuerrrÚ user_return s   zPdb.user_returncCsh|jr dS|\}}}||f|jd<|s2|tkr2dnd}| d|t ||¡d ¡f¡| ||¡dS)NZ __exception__z Internal r6z%s%séÿÿÿÿ)rBr$Ú StopIterationrVÚ tracebackÚformat_exception_onlyrkrn)r2rXÚexc_infoÚexc_typeÚ exc_valueÚ exc_tracebackÚprefixrrrÚuser_exception(s ÿÿÿzPdb.user_exceptioncCsBzd|_| ¡d|_Wq>Wqtk r:| d¡YqXqdS)NTFz--KeyboardInterrupt--)rFÚcmdlooprUrVr1rrrry<sz Pdb._cmdloopcCs^|j |j¡}|rZ| ¡D]>\}}| |¡}||k r||kr|||<| d|||f¡qdS)Nzdisplay %s: %r [old: %r])r@Úgetr^ÚitemsÚ_getval_exceptrV)r2r@ÚexprZoldvalueZnewvaluerrrÚpreloopIs ÿz Pdb.preloopcCsttjr6zt tjtj¡Wntk r.YnXdt_| ||¡rN| ¡dS| |j|j ¡|  ¡| ¡dSr0) r Ú_previous_sigint_handlerÚsignalÚSIGINTÚ ValueErrorrhr[rxr\r]ry)r2rXr~rrrrnVs zPdb.interactioncCs|dk r| t|ƒ¡dSr0)rVÚrepr)r2r%rrrÚ displayhookhszPdb.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<rTrSr‘Úexecr€Úerrorr~rrk) r2rÚlocalsÚglobalsr,Z save_stdoutZ save_stdinZsave_displayhookr€rrrÚdefaultps(  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)r2rÚargsZiiZtmpArgZmarkerÚnextrrrÚprecmd†s(ÿ     z Pdb.precmdcCs"|jstj ||¡S| |¡SdSr0)rPr:r;rlÚhandle_command_def)r2rrrrrlŸ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 parselinerOrQr£rMr¤rvÚAttributeErrorr™rÚcommands_resumingrN)r2rr:ÚargZcmdlistÚfuncrrrr©«s,      zPdb.handle_command_defcCst||jddS)N©Úfile©ÚprintrT©r2ÚmsgrrrrVÉsz Pdb.messagecCstd||jddS)Nz***r°r²r´rrrr–Ìsz Pdb.errorcCs¦| ¡ d¡rgSz| ||||¡}Wntk r>g}YnXt t |¡d¡}|D]H}tj |¡rx|  |d¡qXtj  |¡rX|  ¡ d¡rX|  |d¡qX|S)N)ú:ú,Ú*ú/)ú.pyz.pywr¶) rkÚendswithÚ_complete_expressionÚ ExceptionÚglobrrIrJÚisdirr¤ÚisfileÚlower)r2ÚtextrÚbegidxÚendidxZretÚglobsÚfnrrrÚ_complete_locationÒs  zPdb._complete_locationcs‡fdd„ttjjƒDƒS)Ncs.g|]&\}}|dk rt|ƒ ˆ¡rt|ƒ‘qSr0)rŸÚ startswith)Ú.0r-Úbp©rÂrrÚ ésÿz*Pdb._complete_bpnumber..)rr7Ú BreakpointÚ bpbynumber©r2rÂ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)r2rÂ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)Úlenr7rÍrÎÚintr–rQrMrNrOr>rPr†rU)r2r®ZbnumZold_command_defsZ prompt_backrrrÚ do_commands sB%   þ    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) ÚbreaksrVr7rÍ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)r2r®Z temporaryrÊrrÚcondZcommaZcolonrrfr¯r,ÚokZlnrÚerrrrrÚdo_breakXs„         þ   ÿ  ÿz Pdb.do_breakcCs"|jjj}|dkr|jr|j}|S)Nz)r^rarqrA)r2rrrrrèµs zPdb.defaultFilecCs| |d¡dSr!)rï©r2r®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ér6rÑr2)rrÛrkrèrár ) r2Z identifierZfailedZidstringÚidÚpartsZfnameÚ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ÚgetlinerVrkr–)r2rrrÅ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–ÚenablerV©r2r®r¦r-rÊrîrrrÚ do_enablesz Pdb.do_enablec Csh| ¡}|D]V}z| |¡}Wn,tk rJ}z| |¡W5d}~XYq X| ¡| d|¡q dS)Nz Disabled %s)rrùrr–ÚdisablerVrû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ìrVrë)r2r®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)Nrrrÿz %d crossingsz 1 crossingz%Will ignore next %s of breakpoint %d.z-Will stop next time breakpoint %d is reached.) rrÜrkrùrr–rÚignorerVrë)r2r®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? Zno)ÚyZyescSsg|] }|r|‘qSrr)rÉrÊrrrrÌqsz Pdb.do_clear..z Deleted %sr¶rzInvalid line number (%s))ÚinputÚEOFErrorrkrÁr7rÍrÎZclear_all_breaksrVràrÜrrêZ clear_breakr–rrùZclear_bpbynumber) r2r®ZreplyZbplistrÊr-rrrîZ numberlistrrrÚdo_clearcsF           z Pdb.do_clearcCs | ¡dSr0)Úprint_stack_tracerðrrrÚdo_where–sz Pdb.do_wherecCs>||_|j|jd|_|jj|_| |j|j¡d|_dSr()r]r\r^r$rdrxr)r2rë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 ©r2r®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 framer r)r]rÛr\r–rÜrÚminr rrrrÚ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)r2r®rrrrÚdo_untilÐs   z Pdb.do_untilcCs | ¡dSr!)rWrð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)r2r®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!)rGrrŽ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)r2r®Ú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 rRrSrTr>rkrVÚ call_tracingrr½r€r–r~rZtrace_dispatchrw)r2r®r˜r—Úpr€rrrÚdo_debugCs    z Pdb.do_debugcCsd|_| ¡dS)NTr)Ú_user_requested_quitÚset_quitrðrrrÚdo_quitZsz Pdb.do_quitcCs| d¡d|_| ¡dS)Nr6Tr)rVr!r"rðrrrÚdo_EOFes 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_varnamesrV)r2r®ÚcoÚdictrÔr-ÚnamerrrÚdo_argsns     z Pdb.do_argscCs.d|jkr | t|jdƒ¡n | d¡dS)NrzzNot yet returned!)rdrVrr–rðrrrÚ do_retvals z Pdb.do_retvalcCsPzt||jj|jƒWSt ¡dd…}| tj|Žd  ¡¡‚YnXdS)Nr”r|) râr^r#rdr<r€r–r~rrk)r2r®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/)r2r®rXr€rîrrrr‰‘szPdb._getval_exceptcCs*z| t| |¡ƒ¡Wn YnXdSr0)rVrr/rðrrrÚdo_pœszPdb.do_pcCs,z| t | |¡¡¡Wn YnXdSr0)rVÚpprintZpformatr/rð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Ürkr rr–rr^rrrarqÚget_file_breaksr÷Úgetlinesr#Ú _print_linesrrÛrVrU)r2r®ZlastÚfirstrÚ breaklistr&rrrÚdo_list²s@         ÿz Pdb.do_listc Csp|jjj}| |¡}zt|jƒ\}}Wn2tk rX}z| |¡WY¢dSd}~XYnX| ||||j¡dSr0)r^rarqr5r'rr–r7)r2r®rr9r&rrîrrrÚ do_longlistås   zPdb.do_longlistc Csvz| |¡}WnYdSXzt|ƒ\}}Wn6ttfk rd}z| |¡WY¢dSd}~XYnX| ||¡dSr0)r/r'rÚ TypeErrorr–r7)r2r®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>>ú ) rrrCr‡rrŸÚrjustrÛrVr¥) r2r&rrßrXZcurrent_linenoZ exc_linenorrÚsrrrr7s    zPdb._print_linescCsÊz| |¡}WnYdSXd}z |jj}Wntk rBYnX|r\| d|j¡dSz |j}Wntk rzYnX|r”| d|j¡dS|jtkr¸| d|j|j f¡dS| t|ƒ¡dS)Nz Method %sz Function %sz Class %s.%s) r/rÞrär½rVråÚ __class__Útyperr)r2r®Ú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)rVr@r‡r^rˆr‰Ú setdefault)r2r®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_undisplayOs zPdb.do_undisplaycs‡fdd„|j |ji¡DƒS)Ncsg|]}| ˆ¡r|‘qSrrÒ)rÉrrËrrrÌ_s ÿz*Pdb.complete_undisplay..)r@r‡r^rÏrrËrÚcomplete_undisplay^szPdb.complete_undisplaycCs |jj|j–}tjd|ddS)Nz *interactive*)Zlocal)r^r#rdr,Úinteract)r2r®rÙrrrÚ do_interactbszPdb.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ØrVr )r2r®r¦rØrœrrrÚdo_aliasks "z Pdb.do_aliascCs6| ¡}t|ƒdkrdS|d|jkr2|j|d=dSr()rrÛr?)r2r®r¦rrrÚ do_unaliasŽs  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#rcCs4z|jD]}| |¡qWntk r.YnXdSr0)r\rxrU)r2Ú frame_linenorrrr ¦s  zPdb.print_stack_tracecCs6|\}}||jkrd}nd}| || ||¡¡dS)Nz> z )r^rVZformat_stack_entry)r2rSZ 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) r:r;Údo_helprvr¬r–r<ÚflagsÚoptimizerVÚ__doc__r¥)r2r®ZtopicZcommandrrrrT¸s   ÿz Pdb.do_helpcCs| |jjpd ¡¡dS)Nr6)rVÚ help_execrWrkr1rrrrXÒs z Pdb.help_execcCs tƒdSr0)rr1rrrÚ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)Nrr6rº) rIrJÚisabsÚexistsr r<rprAÚsplitextÚislinkÚreadlink)r2rrfÚrootZextÚ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__)rBr!ÚrunpyZ_get_module_detailsrprqrArbÚ__dict__r_ÚupdateÚparentÚloaderrgr)r2Z module_namerhZmod_nameZmod_specr,rbrrrÚ _runmoduleûs  úzPdb._runmodulec Cstddl}|j ¡|j d|tdœ¡d|_| |¡|_d|_t   |¡}d|  ¡|jf}W5QRX|  |¡dS)Nrrb)rrcrgTFzexec(compile(%r, %r, 'exec'))) rbrir_rjrgrBrprAr!ÚioÚ open_codeÚreadr)r2rrbrÚ statementrrrÚ _runscript s þ    ÿzPdb._runscript)r4NNNFT)r)N)rN)wrrrrŒr9rYrZr[rhrerortrsr{r…ryr‹rnr‘r™r¨rlr©rVr–rÇrÐr¼rÝZcomplete_commandsrïrèZdo_bZcomplete_breakZ complete_brñZcomplete_tbreakrçrérüZcomplete_enablerþZcomplete_disablerZcomplete_conditionrZcomplete_ignorerZdo_clZcomplete_clearZ complete_clr Zdo_wZdo_btr rZdo_urZdo_drZdo_untrZdo_srZdo_nrZ do_restartrZdo_rrZdo_cZdo_contrZdo_jr Zcomplete_debugr#Zdo_qZdo_exitr$r-Zdo_ar.Zdo_rvr/r‰r0r2Zcomplete_printZ complete_pZ complete_ppr:Zdo_lr;Zdo_llr=Zcomplete_sourcer7rFZcomplete_whatisrIZcomplete_displayrJrKrMrOrPrRr­r Ú line_prefixrxrTZdo_hrXrYrármrrrrrrr Šsðÿ /     M ]!!.    1  ! # ÿ   ÚwhereZdownZupÚbreakZtbreakr_rýrúrZ conditionrMÚstepr§ZuntilZjumpÚreturnZretvalÚcontinuer)Zlonglistr¦rZppZwhatisÚsourceZdisplayZ undisplayrLrœZunaliasÚdebugÚquitr«z cCstƒ |||¡dSr0)r r©rqr˜r—rrrr<scCstƒ |||¡Sr0)r r )Z expressionr˜r—rrrr ?scCst|||ƒdSr0)rr|rrrr BscOstƒj||ŽSr0)r r )r¦Úkwdsrrrr Fs)ÚheadercCs,tƒ}|dk r| |¡| t ¡j¡dSr0)r rVrr<Ú _getframeÚf_back)r~ÚpdbrrrrIs 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)ÚtrrrrrQs cCsttjƒdSr0)rr<Úlast_tracebackrrrrr _szimport x; x.main()cCs ttƒdSr0)rÚTESTCMDrrrrÚtestgsr…cCsddl}| t¡dSr()ÚpydocZpagerrW)r†rrrrksausage: 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  |¡}tj  |¡tjd<t ƒ}|j  |¡z6|r| |¡n | |¡|jr*WqtdƒWqþtk rrtd|dƒtdd tjdd…¡ƒ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:r@r›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¤rIrJr[Úrealpathr`r rHrLrmrrr!rr Ú SystemExitr€Ú SyntaxErrorr~Ú print_excrn) r‡Zoptsr¦rMZ run_as_moduleÚoptZoptargrArr‚rrrÚmain~sd                 ÿrrb)NN)NN)N)/rIrnrr<r:r7r*r,r¾r1rr"rr~r÷r½rÚ__all__r r'r.rŸr/rsr8r;r rWZ _help_orderZ_commandrvrkrXrr r r rrr r„r…rrˆrrrrrrrÚFs¶ÿ    * û     D