U ÙAT^®ôc"@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.pyrVórÚ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ÚcompileZescapeÚopenÚOSErrorÚ enumerateZmatch)Ú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__~óz_rstr.__repr__N)rrrr0rrrrr,|rr,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ÚsysZauditZ use_rawinputÚpromptÚaliasesÚ displayingÚ mainpyfileÚ_wait_for_mainpyfileÚ tb_linenoÚreadlineZset_completer_delimsZ ImportErrorÚ allow_kbdintÚnosigintÚrcLinesrÚosÚpathZ expanduserÚextendrÚcommandsÚcommands_dopromptÚcommands_silentÚcommands_definingÚ commands_bnum) r/Ú completekeyÚstdinÚstdoutr3rCZreadrcrAZrcFilerrrr7sF  z Pdb.__init__cCs*|jr t‚| d¡| ¡| |¡dS)Nz- Program interrupted. (Use 'cont' to resume).)rBÚKeyboardInterruptÚmessageÚset_stepr)r/ZsignumÚframerrrÚsigint_handler¼s  zPdb.sigint_handlercCstj |¡| ¡dSr-)r5r6ÚresetÚforgetr.rrrrUÃs z Pdb.resetcCs&d|_g|_d|_d|_|j ¡dSr%)rÚstackÚcurindexÚcurframer@Úclearr.rrrrVÇs z Pdb.forgetcCsh| ¡| ||¡\|_|_|rDt|jj|jƒ}||j|j<|j }q|j|jd|_ |j j |_ |  ¡Sr%)rVZ get_stackrWrXr+Ztb_frameÚf_codeZtb_lastir@Ztb_nextrYr!Úcurframe_localsÚ execRcLines)r/ÚfZtbrrrrÚsetupÎs  z Pdb.setupcCsd|js dS|j}| ¡g|_|r`| ¡ ¡}|r|ddkr| |¡r|jt|ƒ7_dSqdS)Nrú#T)rDr(ÚpopÚstripÚonecmdZreversed)r/rDrrrrr]às  zPdb.execRcLinescCs.|jr dS| |¡r*| d¡| |d¡dS)Nz--Call--)r?Z stop_hererQÚ interaction)r/rSZ argument_listrrrÚ user_callôs   z Pdb.user_callcCsH|jr.|j| |jj¡ks$|jdkr(dSd|_| |¡rD| |d¡dS)NrF)r?r>Úcanonicr[Ú co_filenameÚf_linenoÚ bp_commandsrd)r/rSrrrÚ 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) ÚgetattrrkrHÚlastcmdr_rcrJÚprint_stack_entryrWrXrIÚ_cmdlooprV)r/rSrkZ lastcmd_backrrrrris"  ÿ    zPdb.bp_commandscCs.|jr dS||jd<| d¡| |d¡dS)NÚ __return__z --Return--)r?r!rQrd)r/rSZ return_valuerrrÚ user_returns   zPdb.user_returncCsh|jr dS|\}}}||f|jd<|s2|tkr2dnd}| d|t ||¡d ¡f¡| ||¡dS)NZ __exception__z Internal r4z%s%séÿÿÿÿ)r?r!Z StopIterationrQÚ tracebackÚformat_exception_onlyrbrd)r/rSÚexc_infoZexc_typeZ exc_valueZ exc_tracebackÚprefixrrrÚuser_exception's ÿÿÿzPdb.user_exceptioncCsBzd|_| ¡d|_Wq>Wqtk r:| d¡YqXqdS)NTFz--KeyboardInterrupt--)rBÚcmdlooprPrQr.rrrro;sz Pdb._cmdloopcCs^|j |j¡}|rZ| ¡D]>\}}| |¡}||k r||kr|||<| d|||f¡qdS)Nzdisplay %s: %r [old: %r])r=ÚgetrYÚitemsÚ_getval_exceptrQ)r/r=ZexprZoldvalueZnewvaluerrrÚpreloopHs ÿz Pdb.preloopcCsttjr6zt tjtj¡Wntk r.YnXdt_| ||¡rN| ¡dS| |j|j ¡|  ¡| ¡dSr-) r Ú_previous_sigint_handlerÚsignalÚSIGINTÚ ValueErrorr_rVrnrWrXro)r/rSrsrrrrdUs zPdb.interactioncCs|dk r| t|ƒ¡dSr-)rQÚrepr)r/r"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)Nrz!Z zZsingleérr)r\rYr rr:rOrNr‚ZexecruÚerrorrsrtrb) r/rÚlocalsÚglobalsr)Z save_stdoutZ save_stdinZsave_displayhookrurrrÚ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) Nrrz%z%*ú Úaliasz;;rƒ) rbÚsplitr<ZreplaceÚstrÚjoinÚfindÚlstripÚcmdqueueÚappendÚrstrip)r/rÚargsZiiZtmpArgZmarkerÚnextrrrÚprecmd…s(ÿ     z Pdb.precmdcCs"|jstj ||¡S| |¡SdSr-)rKr8r9rcÚhandle_command_def)r/rrrrrcž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 parselinerJrLrrHrrlÚAttributeErrorr‡rÚcommands_resumingrI)r/rr8ÚargZcmdlistÚfuncrrrr•ªs,      zPdb.handle_command_defcCst||jddS)N©Úfile©ÚprintrO©r/ZmsgrrrrQÈr1z Pdb.messagecCstd||jddS)Nz***rœržr rrrr„Ër1z Pdb.errorcCs | ¡ d¡rgSz| ||||¡}Wntk r>g}YnXt |d¡}|D]H}tj |¡rr| |d¡qRtj  |¡rR|  ¡ d¡rR| |d¡qR|S)N)ú:ú,Z*z/)ú.pyz.pywr¡) rbZendswithÚ_complete_expressionÚ ExceptionÚglobrErFZisdirrZisfileÚlower)r/ÚtextrÚbegidxÚendidxZretÚglobsZfnrrrÚ_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..)rr5Ú BreakpointÚ bpbynumber©r/r¨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Ú.rrrrcs"g|]}| ˆd¡rˆ|‘qS)rr©r­©r®Ún)Údottedrvrrr±ÿsz,Pdb._complete_expression..cóg|]}| ˆ¡r|‘qSrr·r¸r°rrr±ó ) rYr r\rŠrlÚKeyErrorr˜rŒZdirÚkeys)r/r¨rr©rªÚnsr"Zpartr)rºrvr¨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)Úlenr5r²r³Úintr„rLrHrIrJr;rKrxrP)r/rš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.rrzBreakpoint %d at %s:%d) ÚbreaksrQr5r²r³ZbpformatrrŽr‘ÚrfindÚ lookupmoduler„rÁr€ÚevalrYr r\ÚhasattrrÃÚ__code__Úco_nameZco_firstlinenorgÚlineinfoÚ defaultFileÚ checklineZ set_breakÚ get_breaksÚnumberrr)r/ršZ temporaryr¯rrÚcondZcommaZcolonrr^r›r)ZokZlnrÚerrrrrÚdo_breakWs„         þ   ÿ  ÿz Pdb.do_breakcCs"|jjj}|dkr|jr|j}|S)Nz)rYr[rgr>)r/rrrrrÌ´s zPdb.defaultFilecCs| |d¡dSr)rÒ©r/rš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)NNNz'rrér4r¶r/)rŠrÀrbrÌrÆr) r/Z identifierZfailedZidstringZidZpartsZfnameÚitemr^ZanswerrrrrËÉs.         z Pdb.lineinfocCs€t|dƒr|jjnd}t |||¡}|s6| d¡dS| ¡}|rn|ddksn|dd…dksn|dd…dkr|| d¡dS|S) NrYz End of filerr`rÕz"""z'''zBlank or comment)rÈrYr Ú linecacheZgetlinerQrbr„)r/rrr«rrrrrÍês ÿÿ z Pdb.checklinec Cóh| ¡}|D]V}z| |¡}Wn,tk rJ}z| |¡W5d}~XYq X| ¡| d|¡q dS)Nz Enabled %s)rŠÚget_bpbynumberr€r„ÚenablerQ©r/ršr’r*r¯rÑrrrÚ do_enableÿsz Pdb.do_enablec CrØ)Nz Disabled %s)rŠrÙr€r„ÚdisablerQrÛ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Ùrbr„r€rÐrQrÏ)r/rš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.) rŠrÁrbrÙràr„r€ÚignorerQrÏ)r/rš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)ZyZyescSsg|] }|r|‘qSrr)r®r¯rrrr±psz Pdb.do_clear..z Deleted %sr¡rzInvalid line number (%s))ZinputZEOFErrorrbr§r5r²r³Zclear_all_breaksrQrÅrÁr€rÎZ clear_breakr„rŠrÙZclear_bpbynumber) r/rš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%)rXrWrYr!r\rnr)r/rÏ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))rXr„rÁr€Úmaxrè©r/ršrãZnewframerrrÚ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)rXrÀrWr„rÁr€ÚminrèrërrrÚ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Ár€r„rYrhZ set_until)r/ršrrrrÚdo_untilÏs   z Pdb.do_untilcCs | ¡dSr)rRrÓrrrÚdo_stepçsz Pdb.do_stepcCó| |j¡dSr)Zset_nextrYrÓrrrÚdo_nextñs z Pdb.do_nextcCs<|r4ddl}tjdd…}| |¡t_|tjdd…<t‚dS)Nrr)Úshlexr:ÚargvrŠr)r/ršrôZargv0rrrÚdo_runús  z Pdb.do_runcCròr)Z set_returnrYrÓrrrÚ do_return s z Pdb.do_returncCs>|js2zt tj|j¡t_Wntk r0YnX| ¡dSr)rCr~rrTr r}r€Z 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) rXrÀrWr„rÁr€rYrhrn)r/ršÚ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ƒrrzLEAVING RECURSIVE DEBUGGER)r:ZsettracerYr r\r rMrNrOr;rbrQZ call_tracingrr¥rur„rsrtZtrace_dispatchrm)r/ršr†r…ÚprurrrÚdo_debugBs    z Pdb.do_debugcCsd|_| ¡dS)NTr)Ú_user_requested_quitÚset_quitrÓrrrÚdo_quitYsz Pdb.do_quitcCs| d¡d|_| ¡dS)Nr4Tr)rQrý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 ***) rYr[r\Z co_argcountZco_kwonlyargcountZco_flagsrZ CO_VARARGSZCO_VARKEYWORDSZrangeZ co_varnamesrQ)r/ršZcoZdictr¹r*ZnamerrrÚdo_argsms     z Pdb.do_argscCs.d|jkr | t|jdƒ¡n | d¡dS)NrpzNot yet returned!)r\rQrr„rÓrrrÚ do_retval~s z Pdb.do_retvalcCsPzt||jj|jƒWSt ¡dd…}| tj|Žd  ¡¡‚YnXdS)Nrƒrr) rÇrYr r\r:rur„rsrtrb)r/ršrurrrÚ_getvalˆs z Pdb._getvalcCsrz2|dkrt||jj|jƒWSt||j|jƒWSWn:t ¡dd…}tj|Žd  ¡}t d|ƒYSXdS)Nrƒrrz** raised %s **) rÇrYr r\r!r:rursrtrbr,)r/ršrSrurÑrrrr{szPdb._getval_exceptcCs*z| t| |¡ƒ¡Wn YnXdSr-)rQrrrÓrrrÚdo_p›szPdb.do_pcCs,z| t | |¡¡¡Wn YnXdSr-)rQÚpprintZpformatrrÓ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¢rirïi z[EOF])rmrŠrÁrbrêr€r„rrYrhr[rgÚget_file_breaksr×Zgetlinesr Ú _print_linesrírÀrQrP)r/ršZlastZfirstrÚ breaklistr#rrrÚdo_list±s@         ÿz Pdb.do_listc Csp|jjj}| |¡}zt|jƒ\}}Wn2tk rX}z| |¡WY¢dSd}~XYnX| ||||j¡dSr-)rYr[rgrr$rr„r)r/ršrr r#rrÑrrrÚ do_longlistäs   zPdb.do_longlistc Csvz| |¡}WnYdSXzt|ƒ\}}Wn6ttfk rd}z| |¡WY¢dSd}~XYnX| ||¡dSr-)rr$rZ TypeErrorr„r)r/rš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) NrrrÕirˆZBz->z>>ú ) rhr@ryrr‹ZrjustrÀrQr‘) r/r#rrÄrSZcurrent_linenoZ exc_linenorrZsrrrrs    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) rrÉr¥rQrÊrÃZ __class__Ztyperr)r/ršZvaluer)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)rQr=ryrYrzr{Z setdefault)r/ršrÖZvalrrrÚ do_display;s  zPdb.do_displaycCsT|r@z|j |ji¡|=WqPtk r<| d|¡YqPXn|j |jd¡dS)Nznot displaying %s)r=ryrYr½r„rarÓrrrÚ do_undisplayNs zPdb.do_undisplaycs‡fdd„|j |ji¡DƒS)Ncr»rr·)r®rùr°rrr±^s ÿz*Pdb.complete_undisplay..)r=ryrYr´rr°rÚcomplete_undisplay]r1zPdb.complete_undisplaycCs |jj|j–}tjd|ddS)Nz *interactive*)Zlocal)rYr r\r)Úinteract)r/rš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ˆ)rŠrÀZsortedr<r¾rQrŒ)r/ršr’r¾r‰rrrÚdo_aliasjs "z Pdb.do_aliascCs6| ¡}t|ƒdkrdS|d|jkr2|j|d=dSr%)rŠrÀr<)r/ršr’rrrÚ do_unaliass  zPdb.do_unaliascs‡fdd„|jDƒS)Ncr»rr·)r®Zar°rrr±—r¼z(Pdb.complete_unalias..)r<r´rr°rÚcomplete_unalias–r1zPdb.complete_unaliasrørñrór÷rÿrúcCs4z|jD]}| |¡qWntk r.YnXdSr-)rWrnrP)r/Ú frame_linenorrrræ¥s  zPdb.print_stack_tracecCs6|\}}||jkrd}nd}| || ||¡¡dS)Nz> z )rYrQZformat_stack_entry)r/rZ prompt_prefixrSrrvrrrrn¬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) r8r9Údo_helprlr˜r„r:ZflagsZoptimizerQÚ__doc__r‘)r/ršZtopicZcommandrrrr·s   ÿz Pdb.do_helpcCs| |jjpd ¡¡dS)Nr4)rQÚ help_execrrbr.rrrrÑs z Pdb.help_execcCs tƒdSr-)rr.rrrÚhelp_pdbÝr1z 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)Nrr4r£) rErFZisabsÚexistsrŒr:rfr>ZsplitextZislinkZreadlink)r/rr^ZrootZextÚdirnameZfullnamerrrrÆâs"      zPdb.lookupmodulec Csrd|_d|_ddl}| |¡\}}}| |j¡|_ddl}|j  ¡|j  d|j|j |j |t dœ¡| |¡dS)NTFrÚ__main__)rÚ__file__Z __package__Z __loader__Z__spec__Ú __builtins__)r?rýÚrunpyZ_get_module_detailsrfrgr>rÚ__dict__rZÚupdateZparentZloaderr r)r/Z module_namer!Zmod_nameZmod_specr)rrrrÚ _runmoduleús  úzPdb._runmodulec Cstddl}|j ¡|j d|tdœ¡d|_| |¡|_d|_t   |¡}d|  ¡|jf}W5QRX|  |¡dS)Nrr)rrr TFzexec(compile(%r, %r, 'exec'))) rr"rZr#r r?rfr>rýÚioZ open_codeZreadr)r/rrrÚ statementrrrÚ _runscript s þ    ÿzPdb._runscript)r2NNNFT)rr-)rN)wrrrr}r7rTrUrVr_r]rerjrirqrwror|rdr‚r‡r”rcr•rQr„r¬rµr¤rÂZcomplete_commandsrÒrÌZdo_bZcomplete_breakZ complete_brÔZcomplete_tbreakrËrÍrÜZcomplete_enablerÞZcomplete_disableráZcomplete_conditionräZcomplete_ignoreråZdo_clZcomplete_clearZ complete_clrçZdo_wZdo_btrèrìZdo_urîZdo_drðZdo_untrñZdo_sróZdo_nröZ do_restartr÷Zdo_rrøZdo_cZdo_contrúZdo_jrüZcomplete_debugrÿZdo_qZdo_exitrrZdo_arZdo_rvrr{rrZcomplete_printZ complete_pZ complete_ppr Zdo_lr Zdo_llr Zcomplete_sourcerrZcomplete_whatisrZcomplete_displayrrrrrrr™ræÚ line_prefixrnrZdo_hrrrÆr$r'rrrrr ‰sðÿ /     M ]!!.    1  ! # ÿ   ZwhereZdownZupZbreakZtbreakrZrÝrÚrâZ conditionrHZstepr“ZuntilZjumpZreturnZretvalZcontinuer&Zlonglistr’rûZppZwhatisZsourceZdisplayZ undisplayrr‰ZunaliasZdebugZquitr—z cCstƒ |||¡dSr-)r r©r&r†r…rrrr;r1cCstƒ |||¡Sr-)r r )Z expressionr†r…rrrr >r1cCst|||ƒdSr-)rr)rrrr AscOstƒj||ŽSr-)r r )r’Zkwdsrrrr Er1)ÚheadercCs,tƒ}|dk r| |¡| t ¡j¡dSr-)r rQrr:Z _getframeZf_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:rur€r rUrd)ÚtrûrrrrPs cCsttjƒdSr-)rr:Zlast_tracebackrrrrr ^r1zimport x; x.main()cCs ttƒdSr-)rÚTESTCMDrrrrÚtestfr1r.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: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:rõrŸÚ_usageZexitrrErFrrr rDrGr$r'rýrrŒZ SystemExitruZ SyntaxErrorrsZ print_excrd) r0Zoptsr’rHZ run_as_moduleZoptZoptargr>r+r,rrrÚmain}sb               ÿr2r©NNr3r-).rEr%rr:r8r5r'r)r¦rr~rrsr×r¥rZ__all__rr$r+r‹r,r(r6r9r rZ _help_orderZ_commandrlrbrrr r r rrr r-r.rr1r2rr+rrrrZFs´ÿ    * û     C