a ÕDOg÷ã@sœddlZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZGdd„deƒZgd¢Zdd„Zdd„Zd d „ZGd d „d eƒZd ZGdd„dejejƒZedurgd¢ZeD] Zeeedeƒj ¡d7Zqèeej j7Z[[d+dd„Z!d,dd„Z"dd„Z#dd„Z$ddœdd„Z%d-dd„Z&d d!„Z'd"Z(d#d$„Z)d%d&„Z*d'Z+d(d)„Z,e-d*kr˜ddl.Z.e. ,¡dS).éNc@s eZdZdS)ÚRestartN)Ú__name__Ú __module__Ú __qualname__©rrú(/opt/alt/python39/lib64/python3.9/pdb.pyrWsr) ÚrunÚpmÚPdbÚrunevalÚrunctxÚruncallÚ set_traceÚ post_mortemÚhelpcCsœt dt |¡¡}zt |¡}Wnty6YdS0|Lt|ddD].\}}| |¡rJ|||fWdƒSqJWdƒn1sŽ0YdS)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|jur,|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@s$eZdZdZd¢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„ZWdtdu„ZXdvdw„ZYeZZeZ[eZ\dxdy„Z]e]Z^dzd{„Z_e_Z`d|d}„ZaeZbd¥dd€„Zcdd‚„ZdeZedƒd„„ZfeZgd…d†„Zhd‡dˆ„Zid‰dŠ„Zjd‹dŒ„ZkddŽ„Zldd„Zmgd‘¢Znd’d“„Zoepfd”d•„Zqd–d—„ZrerZsd˜d™„Ztdšd›„Zudœd„ZvdždŸ„Zwd d¡„ZxdS)¦r NÚtabFTc Csbtjj||dtj ||||¡t d¡|r6d|_d|_i|_ i|_ d|_ d|_ i|_ zddl}| d¡Wnty‚Yn0d|_||_g|_|r@z@ttj d¡ƒ}|j |¡Wdƒn1sÐ0YWntyîYn0z:td ƒ}|j |¡Wdƒn1s0YWnty>Yn0i|_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  .  0z 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|jvr|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|tur2dnd}| 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_exceptioncCs@zd|_| ¡d|_Wq\}}| |¡}||ur||kr|||<| d|||f¡qdS)Nzdisplay %s: %r [old: %r])r@Úgetr^ÚitemsÚ_getval_exceptrV)r2r@ÚexprZoldvalueZnewvaluerrrÚpreloopIs ÿz Pdb.preloopcCsrtjr4zt tjtj¡Wnty,Yn0dt_| ||¡rL| ¡dS| |j|j ¡|  ¡| ¡dSr0) r Ú_previous_sigint_handlerÚsignalÚSIGINTÚ ValueErrorrhr[rxr\r]ry)r2rXr~rrrrnVs  zPdb.interactioncCs|dur| t|ƒ¡dSr0)rVÚrepr)r2r%rrrÚ displayhookhszPdb.displayhookcCsº|dd…dkr|dd…}|j}|jj}zvt|dddƒ}tj}tj}tj}z:|jt_|jt_|jt_t|||ƒW|t_|t_|t_n|t_|t_|t_0Wn|  ¡Yn0dS)Nrú!Ú zZsingle) rdr^r#rr<rTrSr‘ÚexecÚ _error_exc)r2rÚlocalsÚglobalsr,Z save_stdoutZ save_stdinZsave_displayhookrrrÚdefaultps*þ z Pdb.defaultcCsØ| ¡s |S| ¡}|d|jvr†|j|d}d}|dd…D] }| dt|ƒ|¡}|d7}q@| dd |dd…¡¡}| ¡}q|ddkrÔ| d¡}|dkrÔ||dd… ¡}|j  |¡|d|…  ¡}|S) Nrrú%z%*ú Úaliasz;;é) 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|ƒ}Wntyš|j}Yn0|j |j vr¾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´rrrÚerrorËsz Pdb.errorcCs¤| ¡ d¡rgSz| ||||¡}Wnty<g}Yn0t t |¡d¡}|D]H}tj |¡rv|  |d¡qVtj  |¡rV|  ¡ d¡rV|  |d¡qV|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|]&\}}|durt|ƒ ˆ¡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 gSi|jj¥|j¥}dˆvr¤ˆ d¡‰z,|ˆd}ˆdd…D]}t||ƒ}qHWnttfytgYS0d ˆdd…¡d‰‡‡fdd„t|ƒDƒS‡fdd„|  ¡DƒSdS)NÚ.rrr|cs"g|]}| ˆd¡rˆ|‘qS)r|©rÉ©rÊÚn)Údottedr„rrrÍÿóz,Pdb._complete_expression..csg|]}| ˆ¡r|‘qSrrÓrÔrÌrrrÍr×) r^r#rdrrvÚKeyErrorr¬r ÚdirÚkeys)r2rÃrrÄrÅÚnsr%Úpartr)rÖr„rÃrr½ës   zPdb._complete_expressioncCs6|sttjjƒd}n&z t|ƒ}Wn| d¡YdS0||_||jvrj|j||j||j |f}nd}g|j|<d|j|<d|j |<|j }d|_ d|_ z„z |  ¡Wnft y|rì|d|j|<|d|j|<|d|j |<n|j|=|j|=|j |=| d¡Yn0Wd|_ ||_ nd|_ ||_ 0dS) 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_commandssF%   þ    ÿzPdb.do_commandsrc Cs>|s8|jr4| d¡tjjD]}|r| | ¡¡qdSd}d}d}| d¡}|dkrz||dd… ¡}|d|… ¡}|  d¡}d} |dkr|d|… ¡}|  |¡} | sÂ|  d|¡dS| }||dd… ¡}z t |ƒ}Wn$t y |  d|¡YdS0n¾z t |ƒ}Wn°t yÊzt||jj|jƒ} Wn|} Yn0z.t| dƒrf| j} | j} | j} | j}| j}WnD| |¡\} }}| s´|  d |¡YYdS| } t |ƒ}Yn0Yn0|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_breakWs„         þ   ÿ  ÿ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|ddƒ}|r|jnd}t |||¡}|s:| d¡dS| ¡}|rr|ddksr|dd…dksr|dd…dkr€| d¡dS|S) Nr^z End of filerrirõz"""z'''zBlank or comment)rvr#Ú linecacheÚgetlinerVrkr¶)r2rrrXrÆrrrrrëês  ÿÿ z Pdb.checklinec Csj| ¡}|D]X}z| |¡}Wn.tyL}z| |¡WYd}~q d}~00| ¡| d|¡q dS)Nz Enabled %s)rÚget_bpbynumberrr¶ÚenablerV©r2r®r¦r-rËrðrrrÚ do_enables z Pdb.do_enablec Csj| ¡}|D]X}z| |¡}Wn.tyL}z| |¡WYd}~q d}~00| ¡| d|¡q dS)Nz Disabled %s)rrûrr¶ÚdisablerVrýrrrÚ do_disables zPdb.do_disablec CsÀ| dd¡}z |d}Wnty.d}Yn0z| |d ¡¡}WnHtyb| d¡YnZtyŽ}z| |¡WYd}~n6d}~00||_|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}Yn0z| |d ¡¡}WnHty`| d¡YnxtyŒ}z| |¡WYd}~nTd}~00||_|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ÚignorerVrí)r2r®r¦ÚcountrËrðZcountstrrrrÚ do_ignore@s,     ÿÿz Pdb.do_ignorec Cs†|srz tdƒ}Wnty&d}Yn0| ¡ ¡}|dvrndd„tjjDƒ}| ¡|D]}| d|¡qZdSd|vr|  d¡}|d|…}||dd…}z t |ƒ}Wnt yÈd |}Yn"0|  ||¡dd…}|  ||¡}|rú| |¡n|D]}| d|¡qþdS| ¡} | D]^}z| |¡}Wn0t yd}z| |¡WYd}~n"d}~00| |¡| d|¡q"dS) NzClear all breaks? Zno)ÚyZyescSsg|] }|r|‘qSrr)rÊrËrrrrÍqr×z 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_framecCsx|jdkr| d¡dSzt|p"dƒ}Wn"tyJ| d|¡YdS0|dkrZd}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"tyT| d|¡YdS0|dkrnt|jƒd}ntt|jƒd|j|ƒ}| |¡dS)Nrz Newest framerr)r]rÝr\r¶rÞrÚminr rrrrÚdo_down¼s  z Pdb.do_downcCsf|rPz t|ƒ}Wn"ty2| d|¡YdS0||jjkrT| 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_nextc Csz|rrddl}tjdd…}z| |¡t_Wn8tyb}z | d||f¡WYd}~dSd}~00|tjdd…<t‚dS)NrrzCannot run %s: %s)Úshlexr<Úargvrrr¶r)r2r®rZargv0ÚerrrÚdo_runûsz Pdb.do_runcCs| |j¡dSr!)Z set_returnr^ròrrrÚ do_returns z Pdb.do_returncCs<|js0zt tj|j¡t_Wnty.Yn0| ¡dSr!)rGrrŽrYr rŒrZ set_continueròrrrÚ do_continuesÿ zPdb.do_continuec Cs¾|jdt|jƒkr"| d¡dSz t|ƒ}WntyJ| d¡Ynp0z:||j_|j|jd|f|j|j<| |j|j¡Wn2ty¸}z| d|¡WYd}~n d}~00dS)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®rrrrÚdo_jump*s    z Pdb.do_jumpcCsšt d¡|jj}|j}t|j|j|jƒ}d|j   ¡|_ |  d¡zt  |j |||f¡Wntyv| ¡Yn0|  d¡t |j¡|j|_dS)Nz(%s) zENTERING RECURSIVE DEBUGGERzLEAVING RECURSIVE DEBUGGER)r<Úsettracer^r#rdr rRrSrTr>rkrVÚ call_tracingrr¾r•Ztrace_dispatchrw)r2r®r—r–ÚprrrÚdo_debugGs     z Pdb.do_debugcCsd|_| ¡dS)NTr)Ú_user_requested_quitÚset_quitròrrrÚdo_quit]sz Pdb.do_quitcCs| d¡d|_| ¡dS)Nr6Tr)rVr#r$ròrrrÚdo_EOFhs z Pdb.do_EOFcCsŽ|jj}|j}|j|j}|jtj@r.|d}|jtj@rB|d}t |ƒD]>}|j |}||vrx|  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_argsqs   z Pdb.do_argscCs.d|jvr | t|jdƒ¡n | d¡dS)NrzzNot yet returned!)rdrVrr¶ròrrrÚ do_retval‚s z Pdb.do_retvalcCs0zt||jj|jƒWS| ¡‚Yn0dSr0)rär^r#rdr•ròrrrÚ_getvalŒs z Pdb._getvalcCsrz2|durt||jj|jƒWSt||j|jƒWSWn:t ¡dd…}tj|Žd  ¡}t d|ƒYS0dS)Nrœr|z** raised %s **) rär^r#rdr$r<r€r~rrkr/)r2r®rXr€rðrrrr‰“szPdb._getval_exceptcCs,t ¡dd…}| tj|Žd ¡¡dS)Nrœr|)r<r€r¶r~rrk)r2r€rrrr•žszPdb._error_exccCsJz| |¡}WnYdS0z| ||ƒ¡Wn| ¡Yn0dSr0)r1rVr•)r2r®r¯ÚvalrrrÚ _msg_val_func¢szPdb._msg_val_funccCs| |t¡dSr0)r3rròrrrÚdo_p¬szPdb.do_pcCs| |tj¡dSr0)r3ÚpprintZpformatròrrrÚdo_pp²sz Pdb.do_ppcCsbd|_d}|rš|dkršz^d|vrX| d¡\}}t| ¡ƒ}t| ¡ƒ}||krr||}nt| ¡ƒ}td|dƒ}WqÊty–| d|¡YdS0n0|jdus¬|dkrÀtd|jj dƒ}n |jd}|durÚ|d}|jj j }|  |¡}zZt  ||jj¡}| ||d|…|||j¡t|t|ƒƒ|_t|ƒ|krF| d¡Wnty\Yn0dS) Nr)rÒr¸réré z[EOF])rwrrÞrkrrr¶rr^rrrarqÚget_file_breaksrùÚgetlinesr#Ú _print_linesrrÝrVrU)r2r®ZlastÚfirstrÚ breaklistr&rrrÚdo_list¼s@          ÿz Pdb.do_listc Csn|jjj}| |¡}zt|jƒ\}}Wn0tyV}z| |¡WYd}~dSd}~00| ||||j¡dSr0)r^rarqr9r'rr¶r;)r2r®rr=r&rrðrrrÚ do_longlistïs   zPdb.do_longlistc Cstz| |¡}WnYdS0zt|ƒ\}}Wn4ttfyb}z| |¡WYd}~dSd}~00| ||¡dSr0)r1r'rÚ TypeErrorr¶r;)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} ||vrh| 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Úsrrrr;s    zPdb._print_linescCsÆz| |¡}WnYdS0d}z |jj}Wnty@Yn0|rZ| d|j¡dSz |j}WntyvYn0|r| d|j¡dS|jtur´| d|j|j f¡dS| t|ƒ¡dS)Nz Method %sz Function %sz Class %s.%s) r1ràrær¾rVrçÚ __class__Útyperr)r2r®Úvaluer,rrrÚ do_whatis#s.     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ør2rrrÚ do_displayFs  zPdb.do_displaycCsR|r>z|j |ji¡|=WqNty:| d|¡YqN0n|j |jd¡dS)Nznot displaying %s)r@r‡r^rØr¶rjròrrrÚ do_undisplayYs  zPdb.do_undisplaycs‡fdd„|j |ji¡DƒS)Ncsg|]}| ˆ¡r|‘qSrrÓ)rÊrrÌrrrÍis ÿz*Pdb.complete_undisplay..)r@r‡r^rÐrrÌrÚcomplete_undisplayhszPdb.complete_undisplaycCs$i|jj¥|j¥}tjd|ddS)Nz *interactive*)Zlocal)r^r#rdr,Úinteract)r2r®rÛrrrÚ do_interactlszPdb.do_interactcCs¤| ¡}t|ƒdkrHt|j ¡ƒ}|D]}| d||j|f¡q&dS|d|jvr„t|ƒdkr„| d|d|j|df¡nd |dd…¡|j|d<dS)Nrz%s = %srrš)rrÝÚsortedr?rÚrVr )r2r®r¦rÚr›rrrÚdo_aliasus "z Pdb.do_aliascCs6| ¡}t|ƒdkrdS|d|jvr2|j|d=dSr()rrÝr?)r2r®r¦rrrÚ do_unalias˜szPdb.do_unaliascs‡fdd„|jDƒS)Ncsg|]}| ˆ¡r|‘qSrrÓ)rÊÚarÌrrrÍ¢r×z(Pdb.complete_unalias..)r?rÐrrÌrÚcomplete_unalias¡szPdb.complete_unalias)rrrrr%rcCs2z|jD]}| |¡qWnty,Yn0dSr0)r\rxrU)r2Ú frame_linenorrrr °s   zPdb.print_stack_tracecCs6|\}}||jurd}nd}| || ||¡¡dS)Nz> z )r^rVZformat_stack_entry)r2rVZ prompt_prefixrXrr„rrrrx·s  ÿzPdb.print_stack_entrycCsÀ|stj ||¡Sz>zt|d|ƒ}|ƒWWStyLt|d|ƒ}Yn0Wn typ| d|¡YnL0tjjdkr| d|¡dS|j dur¬| 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 helpz&No help for %r; __doc__ string missing) r:r;Údo_helprvr¬r¶r<ÚflagsÚoptimizeÚ__doc__rVr¥)r2r®ZtopicZcommandrrrrWÂs&    ÿ z Pdb.do_helpcCs| |jjpd ¡¡dS)Nr6)rVÚ help_execrZrkr1rrrr[ß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#ÚrunpyÚ_get_module_detailsrprqrAreÚ__dict__r_ÚupdateÚparentÚloaderrjr)r2Z module_namerkZmod_nameZmod_specr,rerrrÚ _runmodules  úzPdb._runmodulecCsˆddl}|j ¡|j d|tdœ¡d|_| |¡|_d|_t   |¡"}d|  ¡|jf}Wdƒn1sp0Y|  |¡dS)Nrre)rrfrjTFzexec(compile(%r, %r, 'exec'))) rermr_rnrjrBrprAr#ÚioÚ open_codeÚreadr)r2rrerÚ statementrrrÚ _runscripts þ    ÿ"zPdb._runscript)r4NNNFT)r)N)rN)yrrrrŒ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_enablerZcomplete_disablerZcomplete_conditionrZcomplete_ignorer Zdo_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_ar0Zdo_rvr1r‰r•r3r4r6Zcomplete_printZ complete_pZ complete_ppr>Zdo_lr?Zdo_llrAZcomplete_sourcer;rJZcomplete_whatisrLZcomplete_displayrMrNrPrRrSrUr­r Ú line_prefixrxrWZdo_hr[r\rãrqrvrrrrr Šsìÿ /     M ]!!.   1  ! #    r )"rÚwhereZdownZupÚbreakZtbreakr_rÿrürZ conditionrMÚstepr§ZuntilZjumpÚreturnZretvalrÚcontinuer)Zlonglistr¦r!ZppZwhatisÚsourceZdisplayZ undisplayrOr›ZunaliasÚdebugÚquitr«z cCstƒ |||¡dSr0)r r©rur—r–rrrrIsrcCstƒ |||¡Sr0)r r )Z expressionr—r–rrrr Lsr cCst|||ƒdSr0)rr€rrrr Osr cOstƒj|i|¤ŽSr0)r r )r¦Úkwdsrrrr Ssr )ÚheadercCs,tƒ}|dur| |¡| t ¡j¡dSr0)r rVrr<Ú _getframeÚf_back)r‚ÚpdbrrrrVs rcCsB|durt ¡d}|dur$tdƒ‚tƒ}| ¡| d|¡dS)NrœzAA valid traceback must be passed if no exception is being handled)r<r€rr rZrn)Útr!rrrr^s rcCsttjƒdSr0)rr<Úlast_tracebackrrrrr lsr zimport x; x.main()cCs ttƒdSr0)rÚTESTCMDrrrrÚtesttsr‰cCsddl}| t¡dSr()ÚpydocZpagerrZ)rŠrrrrxsrausage: 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 CsXddl}| tjdd…dddg¡\}}|s>ttƒt d¡g}d}|D]B\}}|dvrlttƒt ¡qJ|d vr€| |¡qJ|d vrJd }qJ|d}|s¼tj  |¡s¼td |d ƒt d¡|rüddl }z|  |¡Wn$t yút  ¡t d¡Yn0|tjdd…<|s.tj |¡}tj |¡tjd<tƒ} | j |¡z6|rT|  |¡n |  |¡| jrlWqTtdƒWnØty²td|dƒtdd tjdd…¡ƒYnžtyàtdddtt ¡dƒYnptyt  ¡t d¡YnLt  ¡tdƒtdƒt ¡d} |  d| ¡td|dƒYn0q@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:rDrš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^rkrlr¾r~Ú print_excÚrealpathrcr rHrLrqrvr#rr Ú SystemExitr€Ú SyntaxErrorrn) r‹Zoptsr¦rMZ run_as_moduleÚoptZoptargrArkr…r†rrrÚmain‹sr                  ÿr“re)NN)NN)N)/rIrrrr<r:r7r*r,r¿r5rr"rr~rùr¾rÚ__all__r r'r.rŸr/rwr8r;r rZZ _help_orderZ_commandrvrkr[rr r r rrr rˆr‰rrŒr“rr…rrrrÚFsl    7     L