QfvdZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlZddlmZGddeZgdZdZdZGd d eZGd d eZGd deZdZGddej<ej>Z ePgdZ!e!D],Z"ee#e de"zjjIdzz Z.ee jJjz Z[!["d#dZ&d#dZ'dZ(dZ)dddZ*d$dZ+dZ,dZ-dZ.dZ/d Z0d!Z1e2d"k(rddl3Z3e3jbyy)%a 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 ================= N)UnionceZdZdZy)RestartzBCauses a debugger to be restarted for the debugged python program.N)__name__ __module__ __qualname____doc__*/opt/alt/python312/lib64/python3.12/pdb.pyrr[sLr r) runpmPdbrunevalrunctxruncall set_trace post_mortemhelpc@tjdtj|z} tj|}|5t |dD]&\}}|j|s|||fccdddS dddy#t $rYywxYw#1swYyxYw)Nzdef\s+%s\s*[(])start)recompileescapetokenizeopenOSError enumeratematch)funcnamefilenamecrefplinenolines r find_functionr'bs **&8)<< =C ]]8 $ %b2LFDyy611222     s)B%B*B:B BBBcttj|}|j|D]\}}||k\s |cSyNr)listdisfindlinestartsreverse)codelasti linestartsir%s r lasti2linenor2osBc((./J 6 A:M  r ceZdZdZdZy)_rstrz#String that doesn't quote its repr.c|SNr selfs r __repr__z_rstr.__repr__zs r N)rrrr r9r r r r4r4xs -r r4cTeZdZfdZdZedZedZedZxZ S) _ScriptTargetcpt||tjj |}||_|Sr6)super__new__ospathrealpathorig)clsvalres __class__s r r>z_ScriptTarget.__new__s0goc277#3#3C#89 r ctjj|s,td|jdt j dtjj|r,td|jdt j dtjj|t jd<y)NzError:zdoes not existrzis a directoryr) r?r@existsprintrBsysexitisdirdirnamer7s r checkz_ScriptTarget.checksvww~~d# (DII'7 8 HHQK 77==  (DII'7 8 HHQKggood+ r c|Sr6r r7s r r"z_ScriptTarget.filenames r c(td|tdS)N__main__)r__file__ __builtins____spec__)dictrSr7s r namespacez_ScriptTarget.namespaces%   r ctj|5}d|jd|dcdddS#1swYyxYw)Nz exec(compile(z, z , 'exec')))io open_coderead)r8r$s r r.z_ScriptTarget.codes; \\$ 2"2779-r$D E E  s 7A) rrrr>rNpropertyr"rVr. __classcell__)rFs@r r;r;~sK ,  EEr r;cveZdZdZej dZedZedZ edZ edZ y) _ModuleTargetc |jy#t$r-}td|tjdYd}~yd}~wt $r,t jtjdYywxYw)Nz ImportError: r)_details ImportErrorrIrJrK Exception traceback print_exc)r8es r rNz_ModuleTarget.checksY  MM  M!% & HHQKK     ! HHQK s  A8#A5A87A8c,ddl}|j|Sr))runpy_get_module_details)r8rgs r r`z_ModuleTarget._detailss((..r c.|jjSr6)r. co_filenamer7s r r"z_ModuleTarget.filenamesyy$$$r c&|j\}}}|Sr6r`r8namespecr.s r r.z_ModuleTarget.code==dD r c&|j\}}}|Sr6rlrms r _specz_ModuleTarget._specrpr ctdtjjtjj |j |j j|j j|j tS)NrQ)rrR __package__ __loader__rTrS) rUr?r@normcaseabspathr"rrparentloaderrSr7s r rVz_ModuleTarget.namespacesYWW%%bggoodmm&DE ))zz((ZZ%   r N) rrrrN functoolscached_propertyr`r[r"r.rrrVr r r r^r^sq//%%  r r^z -> ceZdZdZ dXdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZeZdYdZ dZ!e Z"eZ#eZ$dZ%eZ&d Z'd!Z(d"Z)eZ*d#Z+eZ,d$Z-eZ.d%Z/eZ0d&Z1e1Z2eZ3eZ4d'Z5e5Z6e5Z7d(Z8d)Z9e9Z:d*Z;e;Zd,Z?e?Z@d-ZAeAZBd.ZCeCZDd/ZEeEZFd0ZGeGxZHZId1ZJeJZKd2ZLeZMd3ZNeNZOeNZPd4ZQd5ZReRZSd6ZTeTZUd7ZVdZd8ZWd9ZXd:ZYd;ZZd<Z[d=Z\eZ]eZ^eZ_d>Z`e`Zad?ZbebZcd@ZdeZed[dAZfdBZgeZhdCZieZjdDZkdEZldFZmdGZndHZodIZpgdJZqdKZresfdLZtdMZueuZvdNZwdOZxdPZydQeze{e|ffdRZ}dSe~fdTZdUZdVZdWZy)\rNcFtjj||tjj||||t j d|rd|_d|_i|_ i|_ d|_ d|_ i|_ ddl}|jdd|_||_g|_|r t)t*j,j/dd 5}|j&j1|ddd t)d d 5}|j&j1|dddi|_i|_i|_d|_d|_y#t $rYwxYw#1swYnxYw#t2$rY|wxYw#1swYWxYw#t2$rYewxYw) N)skipzpdb.Pdbrz(Pdb) Fz `@#$%^&*()=+[{]}\|;:'",<>?z~/.pdbrczutf-8)encodingz.pdbrc)bdbBdb__init__cmdCmdrJaudit use_rawinputpromptaliases displaying mainpyfile_wait_for_mainpyfile tb_linenoreadlineset_completer_delimsra allow_kbdintnosigintrcLinesrr?r@ expanduserextendrcommandscommands_dopromptcommands_silentcommands_defining commands_bnum) r8 completekeystdinstdoutr~rreadrcrrcFiles r rz Pdb.__init__sy D) {E6: )  !D   $)!    ) )*M N"    "'',,Z87KvLL''/L (W5LL''/6  !#!!&!5   LK  65  sf E:*E9$E-E9 FF2F E*)E*-E62E99 FFF F F F c|jrt|jd|j|j |y)Nz- Program interrupted. (Use 'cont' to resume).)rKeyboardInterruptmessageset_stepr)r8signumframes r sigint_handlerzPdb.sigint_handler s3   # # EF  ur cbtjj||jyr6)rrresetforgetr7s r rz Pdb.resets  d r cd|_g|_d|_t|dr2|jr&|jj j ddd|_|jjy)Nrcurframe__pdb_convenience_variables) r%stackcurindexhasattrr f_globalspoprclearr7s r rz Pdb.forgetsY   4 $ MM # # ' '(Et L  r c|j|j||\|_|_|rRt |j j |j}||j|j <|j}|rR|j|jd|_ |jj|_ |j|jd|j|jrV|jDcgc]3}|jr!|jj!ds|5c}|_g|_yycc}w)Nr_frame#)r get_stackrrr2tb_framef_codetb_lastirtb_nextrf_localscurframe_localsset_convenience_variablerstrip startswithcmdqueue)r8ftbr%r&s r setupz Pdb.setups $(NN1b$9! DM""++"4"4bkkBF*0DNN2;; 'B  4==1!4  $}}55 %%dmmXt}}M <>% LL $   UD ) !r c|jrI|j|j|jjk7s|j dkryd|_|j |r|j|dyy)z;This function is called when we stop or break at this line.rNF)rrcanonicrrjf_lineno bp_commandsr)r8rs r user_linez Pdb.user_lineAsd  $ $4<< 0H0H#II>>Q&(-D %   E "   UD ) #r ct|ddr|j|jvr|j}d|_|j}|j |d|j|D]}|j |||_|j |s(|j|j|j|j|r|j|jyy)zCall 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) getattrrrlastcmdronecmdrprint_stack_entryrrr_cmdloopr)r8rr lastcmd_backr&s r rzPdb.bp_commandsKs 4e ,~~.IDN< tjtjtjdt_|j |||j jd|j|j r,|j ddk(r|j j|jy#t$rYwxYw)N_pdbcmd_print_frame_status) r_previous_sigint_handlersignalSIGINT ValueErrorrrappendrrr)r8rrcs r rzPdb.interactions  ' ' 4 fmmS-I-IJ04, 5)$ 9:  ==T]]2.2NN MM      s2C C! C!c>||jt|yy)z{Custom displayhook for the exec in default(), which prevents assignment of the _ variable in the builtins. N)rrepr)r8objs r displayhookzPdb.displayhooks ? LLc # r cV|dddk(r|ddj}|j}|jj} t |dzdd}t j }t j}t j} |jt _|j t _|jt _t||||t _|t _|t _y#|t _|t _|t _wxYw#|jYyxYw)Nr! single) rrrrrrJrrrexec _error_exc)r8r&localsglobalsr. save_stdout save_stdinsave_displayhooks r defaultz Pdb.defaults 8s?48>>#3D%%--)) 4$; 8>$- -**40 0r c|j|\}}}|sy|dk(rd|j|j<y|dk(ry|j|j}|r|j |dz|zn|j | t |d|z}|j|jvrd|j|j<yy#t $r|j}YJwxYw)z8Handles one command line during command list definition.FsilentTrr"do_) r4rrrrrAttributeErrorr rcommands_resumingr)r8r&rr7cmdlistfuncs r r5zPdb.handle_command_defs-S$ (?7;D !3!3 4 E\-- 2 23  NN3s73; ' NN3  4-D ==D22 29>D " "4#5#5 6  <c!f&7&7&=A$H? ??s1Ac|jsgSi|jj|j}d|vry|jd} ||d}|ddD]}t ||} dj|dddz} t|D cgc]} | j|ds| | zc} S|jD cgc]} | j|s| c} S#t t f$rgcYSwxYwcc} wcc} w)N.rrr) rrrr%rKeyErrorr;rdirrkeys) r8rTr&rUrVnsdottedrpartrns r rPzPdb._complete_expressioncs }}IA '' @4+?+? @ $;ZZ_F m"1RLD!#t,C)XXfSbk*S0F(+CM1ALL4LFQJM M "wwy?y!ALL,>Ay? ? n-   N@s* C C7&C7C<C< C43C4ct|j|j|j|jyr6)rrrrr8r7s r rzPdb._pdbcmd_print_frame_status~s) tzz$--89 r c|s'ttjjdz }n t |} |j |||_||jvr-|j||j||j|f}nd}g|j|<d|j|<d|j|<|j}d|_ d|_ |jd|_ ||_ y#|j dYyxYw#t$r}|j d|zYd}~yd}~wwxYw#t$rt|r7|d|j|<|d|j|<|d |j|<n'|j|=|j|=|j|=|j d YwxYw#d|_ ||_ wxYw) a:(Pdb) commands [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] ... endNzcannot set commands: %sTFz(com) rr$z1command definition aborted, old commands restored)lenrr\r]intrFget_bpbynumberrrrrrrrrr)r8r7bnumerrold_command_defs prompt_backs r do_commandszPdb.do_commandssJs~~001A5D 3x     % " 4== $ d 3 $ 6 6t < $ 4 4T : <  $   d'+t$%*T"kk  !% & LLN&+D "%DKO  MN  JJ036 7  *! L&6q&9 d#/?/B&&t,-=a-@$$T*MM$'**40((. JJJ K L&+D "%DKsG C3D D53D D2D--D25A:F2/F51F22F55Gc|s_|jrR|jdtjjD]$}|s|j|j &yd}d}d}|j d}|dkDrT||dzdj}|j|x}r|jd|d|y|d|j}|jd} d} | dk\r`|d| j}|j|} | s|jd |zy| }|| dzdj} t|}n t|}|s|j5}|j7||}|rt|j9||||| }|r|j|y|j;||d }|jd|j<|j>|j@fzyy#t$r|jd |zYywxYw#t$r t||j j"|j$} n #|} YnxYw t'| d r | j(} | j*} | j,} | j.}| j0}nB#|j3|\}}}|s|jd |zYYy|} t|}YnxYwYwxYw)ab(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 WhereNrKrrInvalid condition rrJz%r not found from sys.pathzBad lineno: %s__func__zJThe specified object %r is not a function or was not found along sys.path.rzBreakpoint %d at %s:%d)!breaksrrr\r]bpformatr(r)_compile_error_messagerFr+rfind lookupmodulermrevalrrrrrv__code__co_nameco_firstlinenorjlineinfo defaultFile checkline set_break get_breaksnumberrAr&)r8r7 temporaryr^r"r%condcommarpcolonr!rr>r.oklnr&s r do_breakz Pdb.do_breaks {{ @A..33B R[[]34   19uQwx='')D11$77s7 sCDfu+$$&C # A:6E{))+H!!(+A 7(BCeAgh-&&(C S  %S4'')H~~h/ ..4D(KC 3__Xt4R8 5 ii"'':;< I  +c12  % $ 7 7 $ 4 46DD%tZ0#}}==D $||H!00F#//H%)-s);&R2 $FHK$LM!H WF1 %sa> G1 H1HH K#+I  K# IK#AJK#-K K# KK#"K#c|jjj}|dk(r|jr |j}|S)zProduce a reasonable default.z)rrrjr)r8r"s r rzPdb.defaultFile<s3==''33 z !dooHr c(|j|dy)ztbreak [ ([filename:]lineno | function) [, condition] ] Same arguments as break, but sets a temporary breakpoint: it is automatically deleted when first hit. rN)rrjs r do_tbreakz Pdb.do_tbreakHs c1r cd}|jd}t|dk(r|dj}n$t|dk(r|dj}n|S|dk(r|S|jd}|ddk(r|d=t|dk(r|S|j}t|dk(r|d}n|j |d}|r|}|d}t ||} | xs|S) N)NNN'rrrrar8)r%rlrrr{r') r8 identifierfailedidstringidpartsfnameitemranswers r rz Pdb.lineinfoRs###C( x=A !""$B ]a !""$BM 8F]  8v a5zQ   " u:?8D!!%(+A8DtU+r ct|dd}|r |jnd}tj|||}|s|j dy|j }|r|ddk(s|dddk(s|dddk(r|j d y|S) zCheck 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. rNz End of filerrrz"""z'''zBlank or comment)rr linecachegetlinerrrF)r8r"r%rrXr&s r rz Pdb.checklinessj$/#(d  659 LL 'zz|aC2Ah%D!H$5 JJ) * r c|j}|D]8} |j|}|j|jd|z:y#t$r}|j |Yd}~[d}~wwxYw)zenable bpnumber [bpnumber ...] Enables the breakpoints given as a space separated list of breakpoint numbers. z Enabled %sN)r%rnenablerrrFr8r7r,r1r^rps r do_enablez Pdb.do_enablesi yy{A 0((+  \B./  3 A A3A..A3c|j}|D]8} |j|}|j|jd|z:y#t$r}|j |Yd}~[d}~wwxYw)aOdisable 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. z Disabled %sN)r%rndisablerrrFrs r do_disablezPdb.do_disablesiyy{A 1((+  ]R/0  3 rc|jdd} |d}|j|x}r|jd|d|y |j |dj }||_|s|jd|jzy|jd|jzy#t$rd}YwwxYw#t$r|jd Yyt$r}|j|Yd}~yd}~wwxYw) 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"rrurNrz#Breakpoint %d is now unconditional.z$New condition set for breakpoint %d.Breakpoint number expected) r%ryrF IndexErrorrnrrrrr)r8r7r,rrpr^s r do_conditionzPdb.do_conditionsyya  7D11$77s7 sCD8 Q$$T!W]]_5B BG BRYYNO CbiiOP D  5 JJ3 4  JJsOO s//B/"C/ B=<B=C?C?$C::C?c|j} t|dj} |j|dj}||_|dkDr.|dkDrd|z}nd}|j d||j fzy|j d|j zy#d}YxYw#t$r|jdYyt$r}|j|Yd}~yd}~wwxYw) aignore 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. rrz %d crossingsz 1 crossingz%Will ignore next %s of breakpoint %d.z-Will stop next time breakpoint %d is reached.rN) r%rmrrnignorerrrrFr)r8r7r,countr^countstrrps r do_ignorez Pdb.do_ignoresyy{ Q (E *$$T!W]]_5B BIqy19-5H+H D& 234 L!yy)*% E 5 JJ3 4  JJsOO s(B*"B3*B03C2C2C--C2cZ|s td}|jj}|dvrUtj j Dcgc]}|s| }}|j|D]}|jd|zyd|vr|jd}|d|}||dzd} t|}|j||dd}|j||}|r|j|yD]}|jd|zy|j} | D]9} |j!|}|j#||jd|z;y#t$rd}YZwxYwcc}w#t$rd|z}YwxYw#t$r}|j|Yd}~d}~wwxYw) a.cl(ear) [filename:lineno | 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)yyesz Deleted %sNrJrzInvalid line number (%s))inputEOFErrorrrSrr\r]clear_all_breaksrrzrmr clear_breakrrFr%rnclear_bpbynumber) r8r7replyr^bplistr1r"r%rp numberlists r do_clearz Pdb.do_clears 23KKM'')E $'*~~'@'@G'@B"'@G%%' BLL!23!  #: #A2AwHacd)C 9S6:1=&&x8 3 !BLL!23! YY[ A 0((+%%a( \B./9  H 7036 7  3 sG E E-E-* E2"F E*)E*2FF F*F%%F*c$|jy)zw(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_tracerjs r do_wherez Pdb.do_where's  r c6||_|j|jd|_|jj|_|j |jd|j|j |j|jd|_y)Nrr)rrrrrrrr%)r8rs r _select_framezPdb._select_frame2sp  4==1!4 #}}55 %%dmmXt}}M tzz$--89 r c|jdk(r|jdy t|xsd}|dkrd}nt d|j|z }|j |y#t$r|jd|zYywxYw)zu(p) [count] Move the current frame count (default one) levels up in the stack trace (to an older frame). rz Oldest frameNrInvalid frame count (%s))rrFrmrmaxrr8r7rnewframes r do_upz Pdb.do_up;s ==A  JJ~ &  qME 19H1dmme34H 8$  JJ1C7 8  sA%%BBc|jdzt|jk(r|jdy t |xsd}|dkrt|jdz }n/t t|jdz |j|z}|j|y#t $r|jd|zYywxYw)zd(own) [count] Move the current frame count (default one) levels down in the stack trace (to a newer frame). rz Newest frameNrr)rrlrrFrmrminrrs r do_downz Pdb.do_downPs ==1 DJJ / JJ~ &  qME 194::*H3tzz?Q. 0EFH 8$  JJ1C7 8  sB''CCc|r7 t|}||jjkr|jdyd}|j |j|y#t$r|jd|zYywxYw)aOunt(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. Error in argument: %rNz7"until" line number is smaller than current line numberr)rmrrFrr set_until)r8r7r%s r do_untilz Pdb.do_untiles}  S/// )*F t}}f-  2S89 s AA98A9c$|jy)zs(tep) Execute the current line, stop at the first possible occasion (either in a function that is called or in the current function). r)rrjs r do_stepz Pdb.do_step~s r c:|j|jy)zyn(ext) Continue execution until the next line in the current function is reached or it returns. r)set_nextrrjs r do_nextz Pdb.do_nexts dmm$r c|rEddl}tjdd} |j|t_|tjddt #t$r!}|j d|d|Yd}~yd}~wwxYw)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". rNrz Cannot run r)shlexrJargvr%rrFr)r8r7rargv0res r do_runz Pdb.do_runsj  HHQqME  ;;s+!CHHRaL   #q9: sA A8A33A8c:|j|jy)zQr(eturn) Continue execution until the current function returns. r) set_returnrrjs r do_returnz Pdb.do_returns  &r c|js8 tjtj|jt_|jy#t $rYwxYw)z^c(ont(inue)) Continue execution, only stop when a breakpoint is encountered. r)rrrrrrr set_continuerjs r do_continuezPdb.do_continuesW }} MM&--1D1DE,     s7A A"!A"c|jdzt|jk7r|jdy t |} ||j _|j|jd|f|j|j<|j|j|jy#t$r}|jd|zYd}~yd}~wwxYw#t$r|jdYywxYw)aj(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 frameNrzJump failed: %sz)The 'jump' command requires a line number) rrlrrFrmrrrr)r8r7res r do_jumpz Pdb.do_jumps ==1 DJJ / JJB C  2c(C 2*- &,0JJt}},Ea,H#,M 4==)&&tzz$--'@A 2 ,q011 2 D JJB C Ds* CA.B44 C=CCC;:C;c6tjd|jj}|j}t |j |j|j}d|jjz|_ |jd tj|j|||f|jdtj|j |j"|_y#t$r|jY]wxYw)zdebug 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)rJsettracerrrrrrrrrr call_tracingr rbrtrace_dispatchr)r8r7rrps r do_debugz Pdb.do_debugs T--))%%   $**dkk :T[[..00 23    QUUS'6$: ; 12 T(()yy   OO  s#C<<DDc2d|_|jy)z^q(uit) | exit Quit from the debugger. The program being executed is aborted. Tr)_user_requested_quitset_quitrjs r do_quitz Pdb.do_quits %)! r cT|jdd|_|jy)z>EOF Handles the receipt of EOF as a command. rTr)rrrrjs r do_EOFz Pdb.do_EOFs$ R$(! r c |jj}|j}|j|jz}|j t jzr|dz}|j t jzr|dz}t|D]S}|j|}||vr*|j|d|j|||@|j|dUy)zIa(rgs) Print the argument list of the current function. r = z = *** undefined ***N) rrr co_argcountco_kwonlyargcountco_flagsinspect CO_VARARGSCO_VARKEYWORDSrange co_varnamesrr)r8r7corUrhr1rns r do_argsz Pdb.do_argss ]] ! !## NNR11 1 ;;++ +1Q ;;// /QqSqA>>!$Dt| $T D0QRS ?@ r cd|jvr/|j|j|jddy|jdy)zRretval Print the return value for the last return of a function. rretvalzNot yet returned!N)rrrrFrjs r do_retvalz Pdb.do_retval"sA 4// / LL)=)=l)KXV W JJ* +r c t||jj|jS#|j xYwr6)r|rrrrrjs r _getvalz Pdb._getval-s: T]]44d6J6JK K  OO  s *-Ac |+t||jj|jSt||j|jS#t $r'}t d|j|zcYd}~Sd}~wwxYw)Nz** raised %s **)r|rrrr BaseExceptionr4r)r8r7rexcs r rzPdb._getval_except4sq D}C!8!8$:N:NOOC%..AA D*T-=-=c-BBC C Ds",A A BA;5B;Bcltj}|j|j|yr6)rJ exceptionrFrr8rs r rzPdb._error_exc=s$mmo 4##C()r c |j|} |j||y#YyxYw#|jYyxYwr6)rrr)r8r7r>rDs r _msg_val_funczPdb._msg_val_funcAsD ,,s#C  LLc #    OO s,30Ac  t|S#t$r+}td|d|j|dcYd}~Sd}~wwxYw)Nz *** repr(z ) failed: z ***)rrbr4r)r8rrres r rzPdb._safe_reprKsJ P9  P9TF*T5E5Ea5H4INO O Ps A <AAc0|j|ty)zAp expression Print the value of the expression. N)rrrjs r do_pzPdb.do_pQs 3%r cD|j|tjy)zIpp expression Pretty-print the value of the expression. N)rpprintpformatrjs r do_ppz Pdb.do_ppXs 3/r c d|_d}|r|dk7r d|vrQ|jd\}}t|j}t|j}||kr.||z}n(t|j}t d|dz }nD|j|dk(r$t d|jjdz }n|jdz}||dz}|jjj}|jd r7|jjjd }t|t r|}|j#|} t%j&||jj}|j)||dz ||||jt+|t-||_t-||kr|j/d yy#t $r|j d|zYywxYw#t0$rYywxYw) al(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*NrarKrr z=G> H  H c.|jjj}|j|} |j |j\}}|j||||jy#t $r}|j |Yd}~yd}~wwxYw)z]ll | longlist List the whole source code for the current function or frame. N)rrrjr_getsourcelinesrrFr)r8r7r"rrr%rps r do_longlistzPdb.do_longlists ==''33((2   00?ME6 %DMMB  JJsO  sA00 B9BBc |j|} |j|\}}|j ||y#YyxYw#ttf$r}|j |Yd}~yd}~wwxYw)z_source expression Try to get source code for the given object and display it. N)rrr TypeErrorrFr)r8r7rrr%rps r do_sourcez Pdb.do_sourcesn  ,,s#C  005ME6 %(  #  JJsO  s;A?A,A''A,cv|r)|j}|jj|d}ndx}}t||D]{\}}t |j d} t | dkr| dz } ||vr| dz } n| dz } ||k(r| dz } n ||k(r| dz } |j| dz|jz}y ) zPrint a range of lines.rrr"Bz->z>> N) rrrrr'rjustrlrr+) r8rrrwrcurrent_lineno exc_linenor%r&ss r rzPdb._print_liness "^^N++E26J*, ,NZ%eU3LFDF !!!$A1vzSSS'T :%T  LLTDKKM1 24r c |j|}d} |jj}|r|j d|j zy |j}|r|j d|j zy|j tur,|j d|jd|jy|j t|y#YyxYw#t$rYwxYw#t$rYwxYw)zCwhatis expression Print the type of the argument. Nz Method %sz Function %szClass ra) rrvr}rbrr~rFtyperr)r8r7rHr.s r do_whatisz Pdb.do_whatiss  LL%E >>**D  LLt||3 4  >>D  LL5 6  ??d " LL%*:*:E