Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325
3 \~ïã"@sÞdZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z Gdd„deƒZddddd d d d d g Zdd„Zdd„Zdd„ZGdd„deƒZdZGdd„dejejƒZedk �rbd ddddddddd d!d"d#d$d%d&d'd(dd)d*d+d,d-d.d/d0d1d2d3d4d5d6d7g"Zx*eD]"Zeeed8eƒjjƒd97Z�q,Weejj7Z[[dId:d„ZdJd;d„Z dd „Z#dKd?d „Z$d@d„Z%dAZ&dBdC„Z'dDd „Z(dEZ)dFdG„Z*e+dHk�rÚddl,Z,e,j*ƒdS)La½ The Python Debugger Pdb ======================= To use the debugger in its simplest form: >>> import pdb >>> pdb.run('') The debugger's prompt is '(Pdb) '. This will stop in the first function call in . Alternatively, if a statement terminated with an unhandled exception, you can use pdb's post-mortem facility to inspect the contents of the traceback: >>> >>> import pdb >>> pdb.pm() The commands recognized by the debugger are listed in the next section. Most can be abbreviated as indicated; e.g., h(elp) means that 'help' can be typed as 'h' or 'help' (but not as 'he' or 'hel', nor as 'H' or 'Help' or 'HELP'). Optional arguments are enclosed in square brackets. Alternatives in the command syntax are separated by a vertical bar (|). A blank line repeats the previous command literally, except for 'list', where it lists the next 11 lines. Commands that the debugger doesn't recognize are assumed to be Python statements and are executed in the context of the program being debugged. Python statements can also be prefixed with an exclamation point ('!'). This is a powerful way to inspect the program being debugged; it is even possible to change variables or call functions. When an exception occurs in such a statement, the exception name is printed but the debugger's state is not changed. The debugger supports aliases, which can save typing. And aliases can have parameters (see the alias help entry) which allows one a certain level of adaptability to the context under examination. Multiple commands may be entered on a single line, separated by the pair ';;'. No intelligence is applied to separating the commands; the input is split at the first ';;', even if it is in the middle of a quoted string. If a file ".pdbrc" exists in your home directory or in the current directory, it is read in and executed as if it had been typed at the debugger prompt. This is particularly useful for aliases. If both files exist, the one in the home directory is read first and aliases defined there can be overridden by the local file. This behavior can be disabled by passing the "readrc=False" argument to the Pdb constructor. Aside from aliases, the debugger is not directly programmable; but it is implemented as a class from which you can derive your own debugger class, which you can make as fancy as you like. Debugger commands ================= éNc@seZdZdZdS)ÚRestartzBCauses a debugger to be restarted for the debugged python program.N)Ú__name__Ú __module__Ú __qualname__Ú__doc__©rrú/usr/lib64/python3.6/pdb.pyrUsrÚrunÚpmÚPdbÚrunevalÚrunctxÚruncallÚ set_traceÚ post_mortemÚhelpcCsxtjdtj|ƒƒ}y t|ƒ}Wntk r4dSX|�4x,t|dd�D]\}}|j|ƒrJ|||fSqJWWdQRXdS)Nzdef\s+%s\s*[(]é)Ústart)ÚreÚcompileÚescapeÚopenÚOSErrorÚ enumerateÚmatch)ÚfuncnameÚfilenameZcreÚfpÚlinenoÚlinerrrÚ find_function\s  r cCsXtj|ƒ\}}tj|ƒr,|j|jkr,|dfStj|ƒr>|dfStj||d…ƒ|dfS)Nr)ÚinspectZ findsourceZisframeÚ f_globalsÚf_localsZismoduleZgetblock)ÚobjÚlinesrrrrÚgetsourcelinesis  r&cCs8ttj|ƒƒ}|jƒx|D]\}}||kr|SqWdS)Nr)ÚlistÚdisZfindlinestartsÚreverse)ÚcodeZlastiZ linestartsÚirrrrÚ lasti2linenors r,c@seZdZdZdd„ZdS)Ú_rstrz#String that doesn't quote its repr.cCs|S)Nr)ÚselfrrrÚ__repr__}sz_rstr.__repr__N)rrrrr/rrrrr-{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`fdfdzd{„Zad|d}„ZbeZcd~d„ZdeZed€d�„Zfd‚dƒ„Zgd„d…„Zhd†d‡„Zidˆd‰„ZjdŠd‹„ZkdŒd�dŽd�d�d‘gZld’d“„Zmenfd”d•„Zod–d—„ZpepZqd˜d™„Zrdšd›„Zsdœd�„ZtdždŸ„ZudS)£r NÚtabFTc $CsJtjj||d�tjj||||ƒ|r,d|_d|_i|_i|_d|_ d|_ i|_ yddl }|j dƒWntk rzYnXd|_||_g|_|�r(dtjkrìtjd}y.ttjj|dƒƒ�} |jj| ƒWdQRXWntk rêYnXy$tdƒ�} |jj| ƒWdQRXWntk �r&YnXi|_i|_i|_d|_d|_dS) N)Úskiprz(Pdb) ÚFz `@#$%^&*()=+[{]}\|;:'",<>?ÚHOMEz.pdbrc)ÚbdbÚBdbÚ__init__ÚcmdÚCmdZ use_rawinputÚpromptÚaliasesÚ displayingÚ mainpyfileÚ_wait_for_mainpyfileÚ tb_linenoÚreadlineZset_completer_delimsÚ ImportErrorÚ allow_kbdintÚnosigintÚrcLinesÚosÚenvironrÚpathÚjoinÚextendrÚcommandsÚcommands_dopromptÚcommands_silentÚcommands_definingÚ commands_bnum) r.Ú completekeyÚstdinÚstdoutr1rBZreadrcr?ZenvHomeZrcFilerrrr6ŒsH   z Pdb.__init__cCs*|jr t‚|jdƒ|jƒ|j|ƒdS)Nz- Program interrupted. (Use 'cont' to resume).)rAÚKeyboardInterruptÚmessageÚset_stepr)r.ZsignumÚframerrrÚsigint_handler¼s  zPdb.sigint_handlercCstjj|ƒ|jƒdS)N)r4r5ÚresetÚforget)r.rrrrVÃs z Pdb.resetcCs&d|_g|_d|_d|_|jjƒdS)Nr)rÚstackÚcurindexÚcurframer>Úclear)r.rrrrWÇs z Pdb.forgetcCsl|jƒ|j||ƒ\|_|_x*|rFt|jj|jƒ}||j|j<|j }qW|j|jd|_ |j j |_ |j ƒS)Nr)rWZ get_stackrXrYr,Útb_frameÚf_codeÚtb_lastir>Útb_nextrZr#Úcurframe_localsÚ execRcLines)r.ÚfÚtbrrrrÚsetupÎs   z Pdb.setupcCsh|js dS|j}|jƒg|_xD|rb|jƒjƒ}|r |ddkr |j|ƒr |jt|ƒ7_dSq WdS)Nrú#T)rCr)ÚpopÚstripÚonecmdÚreversed)r.rCrrrrraàs  zPdb.execRcLinescCs.|jr dS|j|ƒr*|jdƒ|j|dƒdS)znThis method is called when there is the remote possibility that we ever need to stop in this function.Nz--Call--)r=Z stop_hererRÚ interaction)r.rTZ argument_listrrrÚ user_callôs   z Pdb.user_callcCsH|jr.|j|j|jjƒks$|jdkr(dSd|_|j|ƒrD|j|dƒdS)z;This function is called when we stop or break at this line.rNF)r=r<Úcanonicr]Ú co_filenameÚf_linenoÚ bp_commandsrj)r.rTrrrÚ user_lineýs  z Pdb.user_linecCs˜t|ddƒr”|j|jkr”|j}d|_|j}|j|dƒx|j|D]}|j|ƒqBW||_|j|sv|j|j|j ƒ|j |rˆ|j ƒ|j ƒdSdS)z¾Call every command that was set for the current active breakpoint (if there is one). Returns True if the normal interaction function must be called, False otherwise.Ú currentbpFrNr) ÚgetattrrqrIÚlastcmdrdrhrKÚprint_stack_entryrXrYrJÚ_cmdlooprW)r.rTrqZ lastcmd_backrrrrros      zPdb.bp_commandscCs.|jr dS||jd<|jdƒ|j|dƒdS)z7This function is called when a return trap is set here.NÚ __return__z --Return--)r=r#rRrj)r.rTZ return_valuerrrÚ user_returns   zPdb.user_returncCsj|jr dS|\}}}||f|jd<| r4|tkr4dnd}|jd|tj||ƒdjƒfƒ|j||ƒdS)zoThis function is called if an exception occurs, but only if we are to stop at or just below this level.NZ __exception__z Internal r2z%s%sréÿÿÿÿ)r=r#Ú StopIterationrRÚ tracebackÚformat_exception_onlyrgrj)r.rTÚexc_infoÚexc_typeÚ exc_valueÚ exc_tracebackÚprefixrrrÚuser_exception's zPdb.user_exceptionc CsDx>yd|_|jƒd|_PWqtk r:|jdƒYqXqWdS)NTFz--KeyboardInterrupt--)rAÚcmdlooprQrR)r.rrrru;sz Pdb._cmdloopcCsb|jj|jƒ}|r^xJ|jƒD]>\}}|j|ƒ}||k r||kr|||<|jd|||fƒqWdS)Nzdisplay %s: %r [old: %r])r;ÚgetrZÚitemsÚ_getval_exceptrR)r.r;ÚexprZoldvalueZnewvaluerrrÚpreloopHs z Pdb.preloopcCsZtjrtjtjtjƒdt_|j||ƒr4|jƒdS|j|j|jƒ|j ƒ|jƒdS)N) r Ú_previous_sigint_handlerÚsignalÚSIGINTrdrWrtrXrYru)r.rTrzrrrrjUs zPdb.interactioncCs|dk r|jt|ƒƒdS)z{Custom displayhook for the exec in default(), which prevents assignment of the _ variable in the builtins. N)rRÚrepr)r.r$rrrÚ displayhookcszPdb.displayhookc CsÈ|dd…dkr|dd…}|j}|jj}ydt|dddƒ}tj}tj}tj}z(|jt_|jt_|jt_t|||ƒWd|t_|t_|t_XWn4tj ƒdd…}|j t j |Ždj ƒƒYnXdS)Nrú!Ú zZsingleérx)r`rZr"rÚsysrPrOrŒÚexecr|Úerrorrzr{rg) r.rÚlocalsÚglobalsr*Z save_stdoutZ save_stdinZsave_displayhookr|rrrÚdefaultks(  z Pdb.defaultcCsà|jƒs |S|jƒ}xx|d|jkrŒ|j|d}d}x0|dd…D] }|jdt|ƒ|ƒ}|d7}qDW|jddj|dd…ƒƒ}|jƒ}qW|ddkrÜ|jdƒ}|dkrÜ||d d…jƒ}|jj |ƒ|d|…j ƒ}|S) z*Handle alias expansion and ';;' separator.rrNú%z%*ú Úaliasz;;r�) rgÚsplitr:ÚreplaceÚstrrGÚfindÚlstripÚcmdqueueÚappendÚrstrip)r.rÚargsZiiZtmpArgZmarkerÚnextrrrÚprecmd�s&     z Pdb.precmdcCs"|jstjj||ƒS|j|ƒSdS)zÒInterpret the argument as though it had been typed in response to the prompt. Checks whether this line is typed at the normal prompt or in a breakpoint command list definition. N)rLr7r8rhÚhandle_command_def)r.rrrrrhšsz Pdb.onecmdc CsÄ|j|ƒ\}}}|sdS|dkr0d|j|j<dS|dkrBg|_dS|j|j}|rf|j|d|ƒn |j|ƒyt|d|ƒ}Wntk rœ|j}YnX|j |j krÀd|j |j<g|_dSdS) z8Handles one command line during command list definition.NZsilentTÚendrr—Údo_F) Z parselinerKrMržrIrŸrrÚAttributeErrorr•rÚcommands_resumingrJ)r.rr7ÚargZcmdlistÚfuncrrrr¤¦s,      zPdb.handle_command_defcCst||jd�dS)N)Úfile)ÚprintrP)r.ÚmsgrrrrRÄsz Pdb.messagecCstd||jd�dS)Nz***)r«)r¬rP)r.r­rrrr’Çsz Pdb.errorc Cs¤|jƒjdƒrgSy|j||||ƒ}Wntk r>g}YnXtj|dƒ}xP|D]H}tjj|ƒrt|j|dƒqTtjj |ƒrT|j ƒjdƒrT|j|dƒqTW|S) Nú:ú,Ú*ú/ú.pyú.pyw)r®r¯)r²r³) rgÚendswithÚ_complete_expressionÚ ExceptionÚglobrDrFÚisdirrŸÚisfileÚlower)r.ÚtextrÚbegidxÚendidxZretÚglobsÚfnrrrÚ_complete_locationÍs   zPdb._complete_locationcs‡fdd„ttjjƒDƒS)Ncs.g|]&\}}|dk rt|ƒjˆƒrt|ƒ‘qS)N)r›Ú startswith)Ú.0r+Úbp)r»rrú äsz*Pdb._complete_bpnumber..)rr4Ú BreakpointÚ bpbynumber)r.r»rr¼r½r)r»rÚ_complete_bpnumberàszPdb._complete_bpnumberc sÆ|js gS|jjjƒ}|j|jƒdˆkr¬ˆjdƒ‰y0|ˆd}xˆdd…D]}t||ƒ}qPWWnttfk r|gSXdj ˆdd…ƒd‰‡‡fdd„t |ƒDƒS‡fdd„|j ƒDƒSdS) NÚ.rrcs"g|]}|jˆdƒrˆ|‘qS)rrx)rÁ)rÂÚn)Údottedr€rrrÄüsz,Pdb._complete_expression..csg|]}|jˆƒr|‘qSr)rÁ)rÂrÉ)r»rrrÄÿsrxrx) rZr"ÚcopyÚupdater`r™rrÚKeyErrorr§rGÚdirÚkeys)r.r»rr¼r½Únsr$Úpartr)rÊr€r»rrµçs    zPdb._complete_expressioncCs(|sttjjƒd}n"y t|ƒ}Wn|jdƒdS||_||jkrf|j||j||j |f}nd}g|j|<d|j|<d|j |<|j }d|_ d|_ zzy |j ƒWnht k �r|rê|d|j|<|d|j|<|d|j |<n|j|=|j|=|j |=|jd ƒYnXWdd|_ ||_ XdS) a4commands [bpnumber] (com) ... (com) end (Pdb) Specify a list of commands for breakpoint number bpnumber. The commands themselves are entered on the following lines. Type a line containing just 'end' to terminate the commands. The commands are executed when the breakpoint is hit. To remove all commands from a breakpoint, type commands and follow it immediately with end; that is, give no commands. With no bpnumber argument, commands refers to the last breakpoint set. You can use breakpoint commands to start your program up again. Simply use the continue command, or step, or any other command that resumes execution. Specifying any command resuming execution (currently continue, step, next, return, jump, quit and their abbreviations) terminates the command list (as if that command was immediately followed by end). This is because any time you resume execution (even with a simple next or step), you may encounter another breakpoint -- which could have its own command list, leading to ambiguities about which list to execute. If you use the 'silent' command in the command list, the usual message about stopping at a breakpoint is not printed. This may be desirable for breakpoints that are to print a specific message and then continue. If none of the other commands print anything, you will see no sign that the breakpoint was reached. rz.Usage: commands [bnum] ... endNTFz(com) rr�z1command definition aborted, old commands restored)Úlenr4rÅrÆÚintr’rMrIrJrKr9rLr‚rQ)r.r©ZbnumZold_command_defsZ prompt_backrrrÚ do_commandss@%       zPdb.do_commandsrcCs@|s<|jr8|jdƒx"tjjD]}|r|j|jƒƒqWdSd}d}d}|jdƒ}|dkr~||dd…jƒ}|d|…jƒ}|j dƒ}d} |dk�r|d|…jƒ}|j |ƒ} | sÆ|j d|ƒdS| }||dd…jƒ}y t |ƒ}Wn$t k �r|j d|ƒdSXn¼y t |ƒ}Wn®t k �rÌyt||jj|jƒ} Wn|} YnXy.t| d ƒ�rl| j} | j} | j} | j}| j}Wn@|j|ƒ\} }}| �s¶|j d |ƒdS| } t |ƒ}YnXYnX|�sÜ|jƒ}|j||ƒ}|�r<|j||||| ƒ}|�r|j |ƒn*|j||ƒd }|jd |j|j|jfƒdS) a²b(reak) [ ([filename:]lineno | function) [, condition] ] Without argument, list all breaks. With a line number argument, set a break at this line in the current file. With a function name, set a break at the first executable line of that function. If a second argument is present, it is a string specifying an expression which must evaluate to true before the breakpoint is honored. The line number may be prefixed with a filename and a colon, to specify a breakpoint in another file (probably one that hasn't been loaded yet). The file is searched for on sys.path; the .py suffix may be omitted. z!Num Type Disp Enb WhereNr¯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.zBreakpoint %d at %s:%drx) ÚbreaksrRr4rÅrÆZbpformatrœr�r ÚrfindÚ lookupmoduler’rÓÚ ValueErrorÚevalrZr"r`ÚhasattrrÕÚ__code__Úco_nameÚco_firstlinenormÚlineinfoÚ defaultFileÚ checklineZ set_breakÚ get_breaksÚnumberr«r)r.r©Z temporaryrÃrrÚcondZcommaZcolonrrbrªr*ÚokÚlnrÚerrrrrÚdo_breakTs~             z Pdb.do_breakcCs"|jjj}|dkr|jr|j}|S)zProduce a reasonable default.z)rZr]rmr<)r.rrrrrà±s zPdb.defaultFilecCs|j|dƒdS)z¶tbreak [ ([filename:]lineno | function) [, condition] ] Same arguments as break, but sets a temporary breakpoint: it is automatically deleted when first hit. rN)rè)r.r©rrrÚ do_tbreak½sz Pdb.do_tbreakc CsÌd}|jdƒ}t|ƒdkr(|djƒ}nt|ƒdkrB|djƒ}n|S|dkrR|S|jdƒ}|ddkr~|d=t|ƒdkr~|S|jƒ}t|ƒdkrœ|d}n|j|dƒ}|r²|}|d}t||ƒ} | pÊ|S) Nú'rrér2rÈr.)NNN)r™rÒrgràrØr ) r.Z identifierZfailedZidstringÚidÚpartsZfnameÚitemrbZanswerrrrr߯s.         z Pdb.lineinfocCs‚t|dƒr|jjnd}tj|||ƒ}|s6|jdƒdS|jƒ}| sp|ddksp|dd…dksp|dd…dkr~|jd ƒdS|S) zÈCheck whether specified line seems to be executable. Return `lineno` if it is, 0 if not (e.g. a docstring, comment, blank line or EOF). Warning: testing is not comprehensive. rZNz End of filerrerëz"""z'''zBlank or comment)rÛrZr"Ú linecacheÚgetlinerRrgr’)r.rrr¾rrrrráçs   z Pdb.checklinecCsl|jƒ}x^|D]V}y|j|ƒ}Wn,tk rL}z|j|ƒWYdd}~XqX|jƒ|jd|ƒqWdS)z†enable bpnumber [bpnumber ...] Enables the breakpoints given as a space separated list of breakpoint numbers. Nz Enabled %s)r™Úget_bpbynumberrÙr’ÚenablerR)r.r©r¡r+rÃrçrrrÚ do_enableüs z Pdb.do_enablecCsl|jƒ}x^|D]V}y|j|ƒ}Wn,tk rL}z|j|ƒWYdd}~XqX|jƒ|jd|ƒqWdS)aNdisable bpnumber [bpnumber ...] Disables the breakpoints given as a space separated list of breakpoint numbers. Disabling a breakpoint means it cannot cause the program to stop execution, but unlike clearing a breakpoint, it remains in the list of breakpoints and can be (re-)enabled. Nz Disabled %s)r™rñrÙr’ÚdisablerR)r.r©r¡r+rÃrçrrrÚ do_disable s zPdb.do_disablecCsÂ|jddƒ}y |d}Wntk r0d}YnXy|j|djƒƒ}WnHtk rf|jdƒYnXtk r�}z|j|ƒWYdd}~Xn.X||_|s®|jd|jƒn|jd|jƒdS)a#condition bpnumber [condition] Set a new condition for the breakpoint, an expression which must evaluate to true before the breakpoint is honored. If condition is absent, any existing condition is removed; i.e., the breakpoint is made unconditional. r—rNrzBreakpoint number expectedz#Breakpoint %d is now unconditional.z$New condition set for breakpoint %d.) r™Ú IndexErrorrñrgr’rÙrärRrã)r.r©r¡rärÃrçrrrÚ do_condition!s   zPdb.do_conditioncCsÜ|jƒ}yt|djƒƒ}Wnd}YnXy|j|djƒƒ}WnHtk rb|jdƒYnvtk rŒ}z|j|ƒWYdd}~XnLX||_|dkrÈ|dkr®d|}nd}|jd||j fƒn|jd|j ƒdS) a–ignore bpnumber [count] Set the ignore count for the given breakpoint number. If count is omitted, the ignore count is set to 0. A breakpoint becomes active when the ignore count is zero. When non-zero, the count is decremented each time the breakpoint is reached and the breakpoint is not disabled and any associated condition evaluates to true. rrzBreakpoint number expectedNz %d crossingsz 1 crossingz%Will ignore next %s of breakpoint %d.z-Will stop next time breakpoint %d is reached.) r™rÓrgrñrör’rÙÚignorerRrã)r.r©r¡ÚcountrÃrçZcountstrrrrÚ do_ignore<s(   z Pdb.do_ignorec !Cs�|sxy tdƒ}Wntk r(d}YnX|jƒjƒ}|d krtdd„tjjDƒ}|jƒx|D]}|jd|ƒq^WdSd |k�r|j d ƒ}|d|…}||d d…}y t |ƒ}Wnt k rÐd |}YnX|j ||ƒ}|j ||ƒ}|�rü|j|ƒnx|D]}|jd|ƒ�qWdS|jƒ} xd| D]\}y|j|ƒ}Wn.t k �rl}z|j|ƒWYdd}~XnX|j|ƒ|jd|ƒ�q,WdS) a=cl(ear) filename:lineno cl(ear) [bpnumber [bpnumber...]] With a space separated list of breakpoint numbers, clear those breakpoints. Without argument, clear all breaks (but first ask confirmation). With a filename:lineno argument, clear all breaks at that line in that file. zClear all breaks? ÚnoÚyÚyescSsg|] }|r|‘qSrr)rÂrÃrrrrÄmsz Pdb.do_clear..z Deleted %sNr®rzInvalid line number (%s))rürý)ÚinputÚEOFErrorrgrºr4rÅrÆZclear_all_breaksrRr×rÓrÙrâZ clear_breakr’r™rñZclear_bpbynumber) r.r©ZreplyZbplistrÃr+rrrçZ numberlistrrrÚdo_clear_sF              z Pdb.do_clearcCs |jƒdS)zâw(here) Print a stack trace, with the most recent frame at the bottom. An arrow indicates the "current frame", which determines the context of most commands. 'bt' is an alias for this command. N)Úprint_stack_trace)r.r©rrrÚdo_where’sz Pdb.do_wherecCs`d|kot|jƒkns"t‚||_|j|jd|_|jj|_|j|j|jƒd|_dS)Nr) rÒrXÚAssertionErrorrYrZr#r`rtr)r.rãrrrÚ _select_frameœs " zPdb._select_framec Csx|jdkr|jdƒdSyt|p"dƒ}Wn"tk rJ|jd|ƒdSX|dkrZd}ntd|j|ƒ}|j|ƒdS)z‚u(p) [count] Move the current frame count (default one) levels up in the stack trace (to an older frame). rz Oldest frameNrzInvalid frame count (%s))rYr’rÓrÙÚmaxr)r.r©rùÚnewframerrrÚdo_up¤s  z Pdb.do_upc Cs–|jdt|jƒkr"|jdƒdSyt|p,dƒ}Wn"tk rT|jd|ƒdSX|dkrnt|jƒd}ntt|jƒd|j|ƒ}|j|ƒdS)z…d(own) [count] Move the current frame count (default one) levels down in the stack trace (to a newer frame). rz Newest frameNzInvalid frame count (%s)r)rYrÒrXr’rÓrÙÚminr)r.r©rùrrrrÚdo_down¸s z Pdb.do_downc Csf|rPy t|ƒ}Wn"tk r2|jd|ƒdSX||jjkrT|jdƒdSnd}|j|j|ƒdS)aNunt(il) [lineno] Without argument, continue execution until the line with a number greater than the current one is reached. With a line number, continue execution until a line with a number greater or equal to that is reached. In both cases, also stop when the current frame returns. zError in argument: %rNz7"until" line number is smaller than current line numberr)rÓrÙr’rZrnZ set_until)r.r©rrrrÚdo_untilÌs   z Pdb.do_untilcCs |jƒdS)z§s(tep) Execute the current line, stop at the first possible occasion (either in a function that is called or in the current function). r)rS)r.r©rrrÚdo_stepäsz Pdb.do_stepcCs|j|jƒdS)zxn(ext) Continue execution until the next line in the current function is reached or it returns. r)Zset_nextrZ)r.r©rrrÚdo_nextîs z Pdb.do_nextcCs<|r4ddl}tjdd…}|j|ƒt_|tjdd…<t‚dS)arun [args...] Restart the debugged python program. If a string is supplied it is split with "shlex", and the result is used as the new sys.argv. History, breakpoints, actions and debugger options are preserved. "restart" is an alias for "run". rNr)Úshlexr�Úargvr™r)r.r©r Zargv0rrrÚdo_run÷s  z Pdb.do_runcCs|j|jƒdS)zPr(eturn) Continue execution until the current function returns. r)Z set_returnrZ)r.r©rrrÚ do_returns z Pdb.do_returnc Cs>|js2ytjtj|jƒt_Wntk r0YnX|jƒdS)z]c(ont(inue)) Continue execution, only stop when a breakpoint is encountered. r)rBr‰rŠrUr rˆrÙZ set_continue)r.r©rrrÚ do_continueszPdb.do_continuecCs¾|jdt|jƒkr"|jdƒdSy t|ƒ}Wntk rL|jdƒYnnXy:||j_|j|jd|f|j|j<|j|j|jƒWn0tk r¸}z|jd|ƒWYdd}~XnXdS)a£j(ump) lineno Set the next line that will be executed. Only available in the bottom-most frame. This lets you jump back and execute code again, or jump forward to skip code that you don't want to run. It should be noted that not all jumps are allowed -- for instance it is not possible to jump into the middle of a for loop or out of a finally clause. rz)You can only jump within the bottom frameNz)The 'jump' command requires a line numberrzJump failed: %s) rYrÒrXr’rÓrÙrZrnrt)r.r©ÚerrrÚdo_jump"s   z Pdb.do_jumpcCsztjdƒ|jj}|j}t|j|j|jƒ}d|j j ƒ|_ |j dƒtj |j |||fƒ|j dƒtj|jƒ|j|_dS)zÆdebug code Enter a recursive debugger that steps through the code argument (which is an arbitrary expression or statement to be executed in the current environment). Nz(%s) zENTERING RECURSIVE DEBUGGERzLEAVING RECURSIVE DEBUGGER)r�ÚsettracerZr"r`r rNrOrPr9rgrRÚ call_tracingr Ztrace_dispatchrs)r.r©r”r“ÚprrrÚdo_debug?s    z Pdb.do_debugcCsd|_|jƒdS)z[q(uit) exit Quit from the debugger. The program being executed is aborted. Tr)Ú_user_requested_quitÚset_quit)r.r©rrrÚdo_quitRsz Pdb.do_quitcCs|jdƒd|_|jƒdS)z=EOF Handles the receipt of EOF as a command. r2Tr)rRrr)r.r©rrrÚdo_EOF]s z Pdb.do_EOFcCsˆ|jj}|j}|j}|jd@r&|d}|jd@r8|d}xJt|ƒD]>}|j|}||krp|jd|||fƒqB|jd|fƒqBWdS)zHa(rgs) Print the argument list of the current function. éréz%s = %rz%s = *** undefined ***N)rZr]r`Ú co_argcountÚco_flagsÚrangeÚ co_varnamesrR)r.r©ÚcoÚdictrÉr+ÚnamerrrÚdo_argsfs   z Pdb.do_argscCs.d|jkr |jt|jdƒƒn |jdƒdS)zQretval Print the return value for the last return of a function. rvzNot yet returned!N)r`rRr‹r’)r.r©rrrÚ do_retvalws z Pdb.do_retvalc CsNyt||jj|jƒStjƒdd…}|jtj|Ždj ƒƒ‚YnXdS)Nr�rrx) rÚrZr"r`r�r|r’rzr{rg)r.r©r|rrrÚ_getval�s z Pdb._getvalc Cshy.|dkrt||jj|jƒSt||j|jƒSWn4tjƒdd…}tj|Ždj ƒ}t d|ƒSdS)Nr�rz** raised %s **rx) rÚrZr"r`r#r�r|rzr{rgr-)r.r©rTr|rçrrrr…‰szPdb._getval_exceptc Cs*y|jt|j|ƒƒƒWn YnXdS)z@p expression Print the value of the expression. N)rRr‹r')r.r©rrrÚdo_p”szPdb.do_pc Cs,y|jtj|j|ƒƒƒWn YnXdS)zHpp expression Pretty-print the value of the expression. N)rRÚpprintZpformatr')r.r©rrrÚdo_pp�sz Pdb.do_ppcCsdd|_d}|rš|dkršy^d|krX|jdƒ\}}t|jƒƒ}t|jƒƒ}||krr||}nt|jƒƒ}td|dƒ}WqÊtk r–|jd|ƒdSXn0|jdks¬|dkrÀtd|jj dƒ}n |jd}|dkrÚ|d}|jj j }|j |ƒ}yZt j||jjƒ}|j||d|…|||jƒt|t|ƒƒ|_t|ƒ|k�rF|jd ƒWntk �r^YnXdS) a°l(ist) [first [,last] | .] List source code for the current file. Without arguments, list 11 lines around the current line or continue the previous listing. With . as argument, list 11 lines around the current line. With one argument, list 11 lines starting at that line. With two arguments, list the given range; if the second argument is less than the first, it is a count. The current line in the current frame is indicated by "->". If an exception is being debugged, the line where the exception was originally raised or propagated is indicated by ">>", if it differs from the current line. r'NrÈr¯rézError in argument: %ré z[EOF])rsr™rÓrgrrÙr’rrZrnr]rmÚget_file_breaksrïÚgetlinesr"Ú _print_linesrrÒrRrQ)r.r©ZlastÚfirstrÚ breaklistr%rrrÚdo_listªs>        z Pdb.do_listcCsh|jjj}|j|ƒ}yt|jƒ\}}Wn*tk rP}z|j|ƒdSd}~XnX|j||||jƒdS)z\longlist | ll List the whole source code for the current function or frame. N)rZr]rmr-r&rr’r/)r.r©rr1r%rrçrrrÚ do_longlistÝs   zPdb.do_longlistcCsjy|j|ƒ}Wn dSyt|ƒ\}}Wn.ttfk rX}z|j|ƒdSd}~XnX|j||ƒdS)z^source expression Try to get source code for the given object and display it. N)r'r&rÚ TypeErrorr’r/)r.r©r$r%rrçrrrÚ do_sourceës z Pdb.do_sourcec Cs²|r|j}|jj|d ƒ}nd }}xŠt||ƒD]|\}}t|ƒjdƒ} t| ƒdkrX| d7} ||krj| d7} n| d7} ||kr„| d7} n||kr”| d7} |j| d|jƒƒq.Wd S) zPrint a range of lines.rrërr—ÚBz->z>>ú Nrxrx) rnr>rƒrr›ÚrjustrÒrRr ) r.r%rrÖrTZcurrent_linenoZ exc_linenorrÚsrrrr/üs    zPdb._print_linescCsÆy|j|ƒ}Wn dSd}y |j}Wntk r<YnX|rV|jd|jƒdSy |jj}Wntk rvYnX|r�|jd|jƒdS|jtkr´|jd|j|j fƒdS|jt|ƒƒdS)z;whatis arg Print the type of the argument. Nz Function %sz Method %sz Class %s.%s) r'rÜr¶rRrÝrÕÚ __class__Útyperr)r.r©Úvaluer*rrrÚ do_whatiss.   z Pdb.do_whatiscCsp|s<|jdƒx\|jj|jiƒjƒD]}|jd|ƒq$Wn0|j|ƒ}||jj|jiƒ|<|jd||fƒdS)zâdisplay [expression] Display the value of the expression if it changed, each time execution stops in the current frame. Without expression, list all display expressions for the current frame. zCurrently displaying:z%s: %rzdisplay %s: %rN)rRr;rƒrZr„r…Ú setdefault)r.r©rîÚvalrrrÚ do_display4s  zPdb.do_displayc CsT|r@y|jj|jiƒ|=WqPtk r<|jd|ƒYqPXn|jj|jdƒdS)z·undisplay [expression] Do not display the expression any more in the current frame. Without expression, clear all display expressions for the current frame. znot displaying %sN)r;rƒrZrÍr’rf)r.r©rrrÚ do_undisplayGs zPdb.do_undisplaycs‡fdd„|jj|jiƒDƒS)Ncsg|]}|jˆƒr|‘qSr)rÁ)rÂr)r»rrrÄWsz*Pdb.complete_undisplay..)r;rƒrZ)r.r»rr¼r½r)r»rÚcomplete_undisplayVszPdb.complete_undisplaycCs*|jjjƒ}|j|jƒtjd|d�dS)z interact Start an interactive interpreter whose global namespace contains all the (global and local) names found in the current scope. z *interactive*)ZlocalN)rZr"rËrÌr`r*Úinteract)r.r©rÐrrrÚ do_interactZs  zPdb.do_interactcCs¨|jƒ}t|ƒdkrLt|jjƒƒ}x$|D]}|jd||j|fƒq(WdS|d|jkrˆt|ƒdkrˆ|jd|d|j|dfƒndj|dd…ƒ|j|d<dS)acalias [name [command [parameter parameter ...] ]] Create an alias called 'name' that executes 'command'. The command must *not* be enclosed in quotes. Replaceable parameters can be indicated by %1, %2, and so on, while %* is replaced by all the parameters. If no command is given, the current alias for name is shown. If no name is given, all aliases are listed. Aliases may be nested and can contain anything that can be legally typed at the pdb prompt. Note! You *can* override internal pdb commands with aliases! Those internal commands are then hidden until the alias is removed. Aliasing is recursively applied to the first word of the command line; all other words in the line are left alone. As an example, here are two useful aliases (especially when placed in the .pdbrc file): # Print instance variables (usage "pi classInst") alias pi for k in %1.__dict__.keys(): print("%1.",k,"=",%1.__dict__[k]) # Print instance variables in self alias ps pi self rz%s = %sNrr—)r™rÒÚsortedr:rÏrRrG)r.r©r¡rÏr˜rrrÚdo_aliasds  "z Pdb.do_aliascCs6|jƒ}t|ƒdkrdS|d|jkr2|j|d=dS)z9unalias name Delete the specified alias. rN)r™rÒr:)r.r©r¡rrrÚ do_unalias‡s  zPdb.do_unaliascs‡fdd„|jDƒS)Ncsg|]}|jˆƒr|‘qSr)rÁ)rÂÚa)r»rrrÄ‘sz(Pdb.complete_unalias..)r:)r.r»rr¼r½r)r»rÚcomplete_unalias�szPdb.complete_unaliasrr r rrrc Cs8yx|jD]}|j|ƒq WWntk r2YnXdS)N)rXrtrQ)r.Ú frame_linenorrrrŸs  zPdb.print_stack_tracecCs6|\}}||jkrd}nd}|j||j||ƒƒdS)Nz> z )rZrRZformat_stack_entry)r.rJZ prompt_prefixrTrr€rrrrt¦s  zPdb.print_stack_entrycCs¤|stjj||ƒSy}xtjj |ƒr¦tj |ƒ}qŽWtjj||ƒ}tjj|ƒrˆ|SqˆWdS)z·Helper function for break/clear parsing -- may be overridden. lookupmodule() translates (possibly incomplete) file or module name into an absolute file name. rr2z.pyN) rDrFÚisabsÚexistsrGr�rlr<ÚsplitextÚislinkÚreadlink)r.rrbÚrootZextÚdirnameÚfullnamerrrrØÜs"   zPdb.lookupmodulec Cstddl}|jjƒ|jjd|tdœƒd|_|j|ƒ|_d|_t |dƒ�}d|j ƒ|jf}WdQRX|j |ƒdS)NrÚ__main__)rÚ__file__Ú __builtins__TFÚrbzexec(compile(%r, %r, 'exec'))) rXÚ__dict__r[rÌrZr=rlr<rrÚreadr )r.rrXrÚ statementrrrÚ _runscriptôs    zPdb._runscript)r0NNNFT)r)N)vrrrrˆr6rUrVrWrdrarkrprorwr�rur‡rjrŒr•r£rhr¤rRr’rÀrÇrµrÔZcomplete_commandsrèràZdo_bZcomplete_breakZ complete_bréZcomplete_tbreakrßráróZcomplete_enablerõZcomplete_disabler÷Zcomplete_conditionrúZcomplete_ignorerZdo_clZcomplete_clearZ complete_clrZdo_wZdo_btrrZdo_ur Zdo_dr Zdo_untr Zdo_sr Zdo_nrZ do_restartrZdo_rrZdo_cZdo_contrZdo_jrZcomplete_debugrZdo_qZdo_exitrr%Zdo_ar&Zdo_rvr'r…r(r*Zcomplete_printZ complete_pZ complete_ppr2Zdo_lr3Zdo_llr5Zcomplete_sourcer/r=Zcomplete_whatisr@Zcomplete_displayrArBrDrFrGrIr¨rÚ line_prefixrtrKZdo_hrNrOrØr_rrrrr ˆsæ /     M ]!!.    1 ! #    ÚwhereZdownZupÚbreakZtbreakr[rôròrøZ conditionrIÚstepr¢ZuntilZjumpÚreturnZretvalÚcontinuer'Zlonglistr¡rZppZwhatisÚsourceZdisplayZ undisplayrCr˜ZunaliasÚdebugÚquitr¦z cCstƒj|||ƒdS)N)r r )r^r”r“rrrr #scCstƒj|||ƒS)N)r r )Z expressionr”r“rrrr &scCst|||ƒdS)N)r )r^r”r“rrrr )scOstƒj||ŽS)N)r r)r¡Úkwdsrrrr-scCstƒjtjƒjƒdS)N)r rr�Ú _getframeÚf_backrrrrr0scCsB|dkrtjƒd}|dkr$tdƒ‚tƒ}|jƒ|jd|ƒdS)Nr�zAA valid traceback must be passed if no exception is being handled)r�r|rÙr rVrj)Útrrrrr5s cCsttjƒdS)N)rr�Úlast_tracebackrrrrr Cszimport x; x.main()cCs ttƒdS)N)r ÚTESTCMDrrrrÚtestKsrocCsddl}|jtƒdS)Nr)ÚpydocZpagerr)rprrrrOsa¯usage: pdb.py [-c command] ... pyfile [arg] ... Debug the Python program given by pyfile. 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 CsÚddl}|jtjdd…dddgƒ\}}|s>ttƒtjdƒg}x<|D]4\}}|dkrjttƒtjƒqH|dkrH|j|ƒqHW|d}tjj |ƒsªtd |d ƒtjdƒ|tjdd…<tjj |ƒtjd<t ƒ}|j j |ƒxøy|j|ƒ|jròPtd ƒWqÞtk �r0td |dƒtddj|ƒƒYqÞtk �r`tddd�ttjƒdƒYqÞtk �r†tjƒtjdƒYqÞtjƒtdƒtdƒtjƒd}|jd|ƒtd|dƒYqÞXqÞWdS)Nrrzhc:ú--helpz --command=r�ú-hú-cú --commandzError:zdoes not existz*The program finished and will be restartedZ Restartingzwith arguments:r7r—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)rrrq)rsrt)Úgetoptr�rr¬Ú_usageÚexitrŸrDrFrQrVr rCrHr_rrrGÚ SystemExitr|Ú SyntaxErrorrzÚ print_excrj) ruZoptsr¡rIÚoptZoptargr<ÚpdbrlrrrÚmain`sV             r}rX)NN)NN)N)-rrDrr�r7r4r(r*r·r)r‰r!rzrïr¶rÚ__all__r r&r,r›r-r`r5r8r Z _help_orderZ_commandrrrgrNr r r rrrr rnrorrvr}rr|rrrrÚBst      "    <