D,biSrSSKrSSKrSSKrSSKJr SSKJrJrJ r /SQr \\-\ -r "SS\ 5r "SS 5rS r"S S 5rS rSr"SS\5rSrSrSrg)zDebugger basicsN)contextmanager) CO_GENERATOR CO_COROUTINECO_ASYNC_GENERATOR)BdbQuitBdb Breakpointc\rSrSrSrSrg)rz Exception to give up completely.N)__name__ __module__ __qualname____firstlineno____doc____static_attributes__r */opt/alt/python313/lib64/python3.13/bdb.pyrrs*rrcv\rSrSrSrS7SjrSrSr\S5r Sr S r S r S r S rS rSrSrSrSrSrSrSrSrSrSrSrS8SjrSrS7SjrSrSrSr Sr!S7S jr"S!r#S"r$S#r%S9S$jr&S%r'S&r(S'r)S(r*S)r+S*r,S+r-S,r.S-r/S.r0S/r1S0r2S:S1jr3S;S2jr4S;S3jr5S4r6S5r7S6r8g)", generated in interactive mode, are returned unchanged. <>)rgetospathabspathnormcase)r#filenamecanonics rr1 Bdb.canonic-so sXa^+c1 1O,,""8,ggooh/Ggg&&w/G%,LL "rc^SSKnUR5 SUlURSS5 g)z5Set values of attributes as ready to start debugging.rN) linecache checkcachebotframe _set_stopinfo)r#r4s rreset Bdb.reset>s(  4&rc#.# XlSv SUlg7fN)rr#frames rset_enterframeBdb.set_enterframeEs scURU5 UR(a SSS5 gUS:XaURU5sSSS5 $US:XaURX5sSSS5 $US:XaUR X5sSSS5 $US:XaUR X5sSSS5 $US:XaUR sSSS5 $US:XaUR sSSS5 $US:XaUR sSSS5 $US :XaURX5sSSS5 $[S [U55 UR sSSS5 $!,(df  g=f) aDispatch a trace function for debugged frames based on the event. This function is installed as the trace function for debugged frames. Its return value is the new trace function, which is usually itself. The default implementation decides how to dispatch a frame, depending on the type of event (passed in as a string) that is about to be executed. The event can be one of the following: line: A new line of code is going to be executed. call: A function is about to be called or another code block is entered. return: A function or other code block is about to return. exception: An exception has occurred. c_call: A C function is about to be called. c_return: A C function has returned. c_exception: A C function has raised an exception. For the Python events, specialized functions (see the dispatch_*() methods) are called. For the C events, no action is taken. The arg parameter depends on the previous event. Nlinecallreturn exceptionc_call c_exceptionc_returnopcodez*bdb.Bdb.dispatch: unknown debugging event:) r>quitting dispatch_line dispatch_calldispatch_returndispatch_exceptiontrace_dispatchdispatch_opcodeprintrepr)r#r=eventargs rrNBdb.trace_dispatchKs92  '}}( '))%0 ( ' ))%5 ( ' ++E7( ' #..u:( ' **( ' %**( ' "**!( '" ++E7%( '& >U L&&)( ' 's@E E E .E E .E  E $E ?E  E  EcURU5(dURU5(aRURU:XaURUR:Xd(UR U5 UR (a[eUR$)zInvoke user function and return trace function for line event. If the debugger stops on the current line, invoke self.user_line(). Raise BdbQuit if self.quitting is set. Return self.trace_dispatch to continue tracing in this scope. ) stop_here break_herer r!f_lineno user_linerIrrNr<s rrJBdb.dispatch_linezs_ NN5 ! !T__U%;%; MMU "t~~'G NN5 !}}Gm"""rcURcURUlUR$URU5(dUR U5(dgUR (a.UR R[-(a UR$URX5 UR(a[eUR$)zInvoke user function and return trace function for call event. If the debugger stops on this function call, invoke self.user_call(). Raise BdbQuit if self.quitting is set. Return self.trace_dispatch to continue tracing in this scope. N) r6f_backrNrVbreak_anywhere stopframef_codeco_flagsGENERATOR_AND_COROUTINE_FLAGS user_callrIrr#r=rSs rrKBdb.dispatch_calls == !LLDM&& &u%%)<)>ell336SS&& & u" ==-"""rc URU5(dXR:XaUR(a.URR[ -(a UR $XlURX5 SUlUR(a[eURULa"URS:waURSS5 URS:waURU5 UR $!SUlf=f)zInvoke user function and return trace function for return event. If the debugger stops on this function return, invoke self.user_return(). Raise BdbQuit if self.quitting is set. Return self.trace_dispatch to continue tracing in this scope. Nr))rV returnframer^r_r`rarNr user_returnrIr stoplinenor7_set_caller_tracefuncrcs rrLBdb.dispatch_returns >>% E-=-=$=~~%,,"7"7:W"W*** ,',$  ,'+$}}Gm~~&4??b+@""4."$**51"""(,$s &C99 Dc"URU5(ahURR[-(aUS[LaUSb(UR X5 UR (a[eUR$UR(auXRLagURRR[-(a;US[[4;a(UR X5 UR (a[eUR$)zInvoke user function and return trace function for exception event. If the debugger stops on this exception, invoke self.user_exception(). Raise BdbQuit if self.quitting is set. Return self.trace_dispatch to continue tracing in this scope. r) rVr_r`ra StopIterationuser_exceptionrIrr^ GeneratorExitrNrcs rrMBdb.dispatch_exceptions >>% LL)),IIA-/CFN##E/==-""" nnnn!<NN))225RRF}m<<    +}}Gm"""rcURU5(dURU5(a(URU5 UR(a[eUR $)zInvoke user function and return trace function for opcode event. If the debugger stops on the current opcode, invoke self.user_opcode(). Raise BdbQuit if self.quitting is set. Return self.trace_dispatch to continue tracing in this scope. )rVrW user_opcoderIrrNrcs rrOBdb.dispatch_opcodesF >>% DOOE$:$:   U #}}Gm"""rclUcgURH n[R"X5(dM g g)z4Return True if module_name matches any skip pattern.FT)rfnmatch)r# module_namepatterns ris_skipped_moduleBdb.is_skipped_modules0  yyG{44!rcUR(a0URURRS55(agXRLa*UR S:XagUR UR :$UR(dgg)z>Return True if frame is below the starting frame in the stack.r Fr)T)rrx f_globalsr+r^rhrXr<s rrV Bdb.stop_heresg 99%%eoo&9&9*&EFF NN ""$>>T__4 4~~rcURURR5nX R;agURnX0RU;a)URR nX0RU;ag[ X#U5upEU(aNURUlU(a5UR(a$UR[UR55 gg)zReturn True if there is an effective breakpoint for this line. Check for line or function breakpoint and if in effect. Delete temporary breakpoints if effective() says to. FT) r1r_ co_filenamerrXco_firstlineno effectivenumber currentbp temporarydo_clearstr)r#r=r0linenobpflags rrWBdb.break_heres << 8 89 ;; & X. .\\00F[[22x7  YYDN c"))n-rc[S5e)z\Remove temporary breakpoint. Must implement in derived classes or get NotImplementedError. z)subclass of bdb must implement do_clear())NotImplementedError)r#rSs rr Bdb.do_clears ""MNNrcfURURR5UR;$)zEReturn True if there is any breakpoint for frame's filename. )r1r_r~rr<s rr]Bdb.break_anywhere s&||ELL445DDrcg)z&Called if we might stop in a function.Nr )r#r= argument_lists rrb Bdb.user_call( rcg)z'Called when we stop or break at a line.Nr r<s rrY Bdb.user_line,rrcg)z&Called when a return trap is set here.Nr )r#r= return_values rrgBdb.user_return0rrcg)z$Called when we stop on an exception.Nr )r#r=exc_infos rrnBdb.user_exception4rrcg)z.Called when we are about to execute an opcode.Nr r<s rrrBdb.user_opcode8rrcXR:wa=XlURnUb'XlX RLagURnUbM&gggr;)rrf_trace_opcodesr6r\)r#rr=s r_set_trace_opcodesBdb._set_trace_opcodes<sL .. .!. OOE#(5%MM)  # /rcpXlX lSUlX0lXPlX`lUR U5 g)zSet the attributes for stopping. If stoplineno is greater than or equal to 0, then stop at line greater than or equal to the stopline. If stoplineno is -1, then don't stop at all. FN)r^rfrIrhr r!r)r#r^rfrhrHr r!s rr7Bdb._set_stopinfoFs7#& %! " 'rcURnU(a3UR(d!X RLaURUlggggr;)r\f_tracer6rN)r# current_frame caller_frames rriBdb._set_caller_tracefuncZs< %++  4 4]]9Z#'#6#6L :[ 4^^a'F 50rc fURSSUR[URSS5S9 g)zStop after one line of code.NrXr r!)r7rgetattrr#s rset_step Bdb.set_stepos2 4%,T__j$%O  Qrc&URSSSS9 g)z!Stop before the next instruction.NT)rH)r7rs r set_stepinstrBdb.set_stepinstrus 4d3rc:URUSXRS9 g)z2Stop on the next line in or below the given frame.Nr)r7rXr<s rset_next Bdb.set_nextys 5$..QrcURR[-(aURUSS5 gURURU5 g)z)Stop when returning from the given frame.Nr))r_r`rar7r\r<s r set_returnBdb.set_return}s; << #@ @   udB /   u||U 3rcUc[R"5RnUR5 UR U5 U(aXUR UlXlURUR4URU'SUlURnU(aMXUR5 SSS5 [R"UR 5 g!,(df  N/=f)z^Start debugging from frame. If frame is not specified, debugging starts from caller's frame. NT) sys _getframer\r8r>rNrr6 f_trace_linesrrrsettracer<s r set_trace Bdb.set_traces =MMO**E   ' $ 3 3 % 9>9L9LeNcNc8d..u5&*#  %    ( T(()( 'sAC$C C+cURURSS5 UR(d[R"S5 [R "5R nU(a3XRLa%U?UR nU(aXRLaM%URR5Hunup#X#sUl Ul M 0Ulgg)zpStop only at breakpoints or when finished. If there are no breakpoints, set the system trace function to None. Nr)) r7r6rrrrr\rritemsrr)r#r= trace_linesrs r set_continueBdb.set_continues 4==$3{{ LL MMO**EE6M E68<7U7U7[7[7]33 =H:#U%:8^-/D *rcnURUlSUlSUl[R "S5 g)zeSet quitting attribute to True. Raises BdbQuit exception in the next call to a dispatch_*() method. NT)r6r^rfrIrrrs rset_quit Bdb.set_quits*   TrcjURRU/5nX#;aURU5 gg)z/Add breakpoint to breaks, if not already there.N)r setdefaultappend)r#r0r bp_linenoss r_add_to_breaksBdb._add_to_breakss1[[++Hb9  #   f % $rcDURU5nSSKnURX5nU(dSX4-$URX5 [ XX4U5nUR n U (a<UR U 5(aURU lU Rn U (aM<g)zSet a new breakpoint for filename:lineno. If lineno doesn't exist for the filename, return an error message. The filename should be in canonical form. rNzLine %s:%d does not exist) r1r4getlinerr rr]rNrr\) r#r0rrcondfuncnamer4rArr=s r set_break Bdb.set_breaks<<)  2.(1CC C H- )8 D""5)) $ 3 3 LLEerct[RR5HupURX5 M g)a'Apply all breakpoints (set in other instances) to this one. Populates this instance's breaks list from the Breakpoint class's list, which can have breakpoints set by another Bdb instance. This is necessary for interactive sessions to keep the breakpoints active across multiple calls to run(). N)r bplistkeysrr#r0rs rr"Bdb._load_breakss.#-"3"3"8"8": X    1#;rcX4[R;aURURU5 URU(dURU gg)zPrune breakpoints for filename:lineno. A list of breakpoints is maintained in the Bdb instance and in the Breakpoint class. If a breakpoint in the Bdb instance no longer exists in the Breakpoint class, then it's removed from the Bdb instance. N)r rrremovers r _prune_breaksBdb._prune_breakssI  Z%6%6 6 KK ! ( ( 0{{8$ H%%rcURU5nXR;aSU-$X RU;aSX4-$[RX4SSHnUR 5 M UR X5 g)z^Delete breakpoints for filename:lineno. If no breakpoints were set, return an error message. There are no breakpoints in %szThere is no breakpoint at %s:%dN)r1rr rdeleteMer)r#r0rrs r clear_breakBdb.clear_breaks} <<) ;; &3h> > X. .47II I##H$45a8B KKM9 8,rcURU5nUR5 UR UR UR 5 g![an[U5sSnA$SnAff=f)zhDelete a breakpoint by its index in Breakpoint.bpbynumber. If arg is invalid, return an error message. N)get_bpbynumber ValueErrorrrrfilerA)r#rSrerrs rclear_bpbynumberBdb.clear_bpbynumbersX  $$S)B  277BGG,  s8O sA A) A$A)$A)cURU5nXR;aSU-$URUH0n[RX4nUHnUR 5 M M2 URU g)zPDelete all breakpoints in filename. If none were set, return an error message. rN)r1rr rr)r#r0rAblistrs rclear_all_file_breaksBdb.clear_all_file_breakssp <<) ;; &3h> >KK)D%%hn5E * KK !rcUR(dg[RHnU(dM UR5 M 0Ulg)zMDelete all existing breakpoints. If none were set, return an error message. zThere are no breakpointsN)rr bpbynumberr)r#rs rclear_all_breaksBdb.clear_all_breakss8 {{-''Br ( rcU(d [S5e[U5n[RUnUc[SU-5eU$![a [SU-5Sef=f![a [SU-5Sef=f)zReturn a breakpoint by its index in Breakpoint.bybpnumber. For invalid arg values or if the breakpoint doesn't exist, raise a ValueError. zBreakpoint number expectedz Non-numeric breakpoint number %sNz!Breakpoint number %d out of rangezBreakpoint %d already deleted)rintr r IndexError)r#rSrrs rrBdb.get_bpbynumber*s 9: : QXF U&&v.B :s3<<);;&, kk(+ + ,rcURU5nXR;=(a, X RU;=(a [RX4=(d /$)z^Return all breakpoints for filename:lineno. If no breakpoints are set, return an empty list. )r1rr rrs r get_breaksBdb.get_breaksDsS <<);;&0 kk(+ +0   h. /635 6rcdURU5nXR;aURU$/$)zbReturn all lines with breakpoints for filename. If no breakpoints are set, return an empty list. r)r#r0s rget_file_breaksBdb.get_file_breaksNs0 <<) {{ ";;x( (IrcUR$)z$Return all breakpoints that are set.)rrs rget_all_breaksBdb.get_all_breaksYs {{rc/nU(aURULa URnUb<URXR45 XRLaOUR nUbM<UR 5 [S[U5S- 5nUb8URURUR45 URnUbM8Uc[S[U5S- 5nX44$)zReturn a list of (frame, lineno) in a stack trace and a size. List starts with original calling frame, if there is one. Size may be number of frames above or below f. rr() tb_frametb_nextrrXr6r\reversemaxlen tb_lineno)r#ftstackis r get_stack Bdb.get_stack`s  q Am LL!ZZ )MM!A m   3u:> "m LL!**akk2 3 Am 9As5zA~&AxrcSSKnSSKnUupVURURR5nU<SU<S3nURR (aXRR - nOUS- nUS- nSUR ;a'UR Sn US- nXRU 5- nUb:URXvUR5n U (aXU R5-- nU$XS 3- nU$) aReturn a string with information about a stack entry. The stack entry frame_lineno is a (frame, lineno) tuple. The return string contains the canonical filename, the function name or '', the input arguments, the return value, and the line of code (if it exists). rN()zz() __return__z->zWarning: lineno is None) r4reprlibr1r_r~co_namef_localsrQrr{strip) r# frame_linenolprefixr4rr=rr0srvrAs rformat_stack_entryBdb.format_stack_entryws "$ << 8 89 & ) <<   %% %A OA T  5>> ) -B IA b! !A  $$XuGDtzz|++ 934 4ArcUcSSKnURnUcUnUR5 [U[5(a [ USS5n[ R"UR5 [XU5 SUl [ R"S5 g![a N*f=f!SUl [ R"S5 f=f)ztDebug a statement executed via the exec() function. globals defaults to __main__.dict; locals defaults to globals. NrzexecT) __main____dict__r8 isinstancercompilerrrNrrrI)r#cmdglobalslocalsr s rrunBdb.runs ? ''G >F c3  #z62C T(()  v &!DM LL     !DM LL s$, B B# B&"B##B&&CcUcSSKnURnUcUnUR5 [R"UR 5 [ XU5SUl[R"S5 $![a Of=fSUl[R"S5 g!SUl[R"S5 f=f)zvDebug an expression executed via the eval() function. globals defaults to __main__.dict; locals defaults to globals. NrT) r r!r8rrrNevalrIr)r#exprr%r&r s rruneval Bdb.runevals ? ''G >F  T(() v.!DM LL       DM LL !DM LL s$ A33 B=B"?BB""Cc(URXU5 g)z.For backwards-compatibility. Defers to run().N)r')r#r$r%r&s rrunctx Bdb.runctxs v&rcUR5 [R"UR5 SnU"U0UD6nSUl[R"S5 U$![a N+f=f!SUl[R"S5 f=f)zGDebug a single function call. Return the result of the function call. NT)r8rrrNrrI)r#funcargskwdsress rruncall Bdb.runcalls|  T(() %%C!DM LL     !DM LL s#A A(%A+'A((A++B )r6rr r!rrrrrrIrfrr^rhrr;)rFNNFNN)z: NN)9r rrrrr$r1r8rr>rNrJrKrLrMrOrxrVrWrr]rbrYrgrnrrrr7rirrrrrrrrrrr"rrrrrrrrrrrrr'r,r/r6rr rrrrs*  "' -'^#"#,#6#6 # 6OE     %JO/3((71Q 4R4*&0$"& AE0 2 &"   (, 6 .D,('rrc4[5R5 g)zrs renableBreakpoint.enable$s  rcSUlg)z Mark the breakpoint as disabled.FNrJrs rdisableBreakpoint.disable(s  rcZUc[Rn[UR5US9 g)z}Print the output of bpformat(). The optional out argument directs where the output is sent and defaults to standard output. N)r)rstdoutrPbpformat)r#outs rbpprintBreakpoint.bpprint,s" ;**C dmmoC(rcUR(aSnOSnUR(aUS-nOUS-nSURUURUR4-nUR (aUSUR <3- nUR (aUSUR 4-- nUR(a)URS:aS nOS nUS URU4-- nU$) zReturn a string with information about the breakpoint. The information includes the breakpoint number, temporary status, file:line position, break condition, number of times to ignore, and number of times hit. zdel zkeep zyes zno z%-4dbreakpoint %s at %s:%dz stop only if z ignore next %d hitsr(rz" breakpoint already hit %d time%s)rr>rrrArr?r@)r#dispretsss rrRBreakpoint.bpformat6s >>DD <<'>D'>D, T04 4990FF 99 DII7 7C ;; , ~= =C 99yy1} 9TYYOK KC rcZSUR<SUR<SUR<3$)z1Return a condensed description of the breakpoint.z breakpoint z at :)rrrArs r__str__Breakpoint.__str__Ts+/;; 499MMr) rr>rr=rr@r?rArrr8r;)r rrrrrArrr$ staticmethodrDrrKrNrTrRr^rr rrr r sR( D FJ-('' #)<Nrr c"UR(dURUR:waggURRUR:wagUR (dURUlUR UR:wagg)aBReturn True if break should happen here. Whether a break should happen depends on the way that b (the breakpoint) was set. If it was set via line number, check if b.line is the same as the one in the frame. If it was set via function name, check if this is the right function and if it is on the first executable line. FT)rrArXr_rr=)br=s r checkfuncnamerc[sm :: 66U^^ # ||qzz) ' '',~~$##u~~5 rc[RX4nUHnUR(dM[XB5(dM(U=RS- slUR (d-UR S:aU=R S-slMuUS4s $[UR URUR5nU(a-UR S:aU=R S-slMUS4s $M g! US4ss $=f)aReturn (active breakpoint, delete temporary flag) or (None, None) as breakpoint to act upon. The "active breakpoint" is the first entry in bplist[line, file] (which must exist) that is enabled, for which checkfuncname is True, and that has neither a False condition nor a positive ignore count. The flag, meaning that a temporary breakpoint should be deleted, is False only when the condiion cannot be evaluated (in which case, ignore count is ignored). If no such entry exists, then (None, None) is returned. r(rTFr9) r rr>rcr@rr?r*r{r)rrAr= possiblesrbvals rrr{s!!$*-I yy Q&&  ! vvxx!|A 4y  "1665??ENNCxx!|A !"4y( +D   "5z!sAC7,C77Dc,\rSrSrSrSrSrSrSrg)TdbicZURRnU(dSn[SX25 g)N???z+++ call)r_rrP)r#r=r3names rrb Tdb.user_calls"||##ET j$%rc .SSKnURRnU(dSnURURR5nUR XAR UR5n[SXAR USUR55 g)Nrrjz+++r]) r4r_rr1r~rrXr{rPr)r#r=r4rkfnrAs rrY Tdb.user_linesg||##ET \\%,,22 3  ^^U__E eRsDJJLArc[SU5 g)Nz +++ returnrP)r#r=retvals rrgTdb.user_returns  lF#rc<[SU5 UR5 g)Nz +++ exception)rPr)r#r= exc_stuffs rrnTdb.user_exceptions oy) rr N) r rrrrbrYrgrnrr rrrhrhs&B$rrhcR[SUS5 [US-5n[SU5 g)Nzfoo(r z bar returned)rPbar)nxs rfoor|s% &!S AbD A .!rc&[SUS5 US- $)Nzbar(rrlrq)as rryrys &!S Q3Jrc:[5nURS5 g)Nzimport bdb; bdb.foo(10))rhr')r s rtestrs AEE #$r)rrurr, contextlibrinspectrrr__all__ra Exceptionrrrr rcrrhr|ryrr rrrs %BB * ,| ;>P P+i+G G T uNuNt@0j#$ %r