Your IP : 3.144.30.14


Current Path : /opt/alt/python310/lib64/python3.10/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/__pycache__/bdb.cpython-310.opt-2.pyc

o

6��f�~�@s�	ddlZddlZddlZddlmZmZmZgd�ZeeBeBZGdd�de	�Z
Gdd�d�Zdd	�ZGd
d�d�Z
dd
�Zdd�ZGdd�de�Zdd�Zdd�Zdd�ZdS)�N)�CO_GENERATOR�CO_COROUTINE�CO_ASYNC_GENERATOR)�BdbQuit�Bdb�
Breakpointc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�*/opt/alt/python310/lib64/python3.10/bdb.pyr
src@s�eZdZ	d]dd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd^d%d&�Zd]d'd(�Zd)d*�Zd+d,�Zd-d.�Zd]d/d0�Zd1d2�Zd3d4�Zd5d6�Z		d_d8d9�Zd:d;�Zd<d=�Zd>d?�Z d@dA�Z!dBdC�Z"dDdE�Z#dFdG�Z$dHdI�Z%dJdK�Z&dLdM�Z'dNdO�Z(dPdQ�Z)d`dSdT�Z*dadUdV�Z+dadWdX�Z,dYdZ�Z-d[d\�Z.dS)brNcCs0|rt|�nd|_i|_i|_d|_|��dS�N)�set�skip�breaks�fncache�frame_returning�_load_breaks)�selfrrrr�__init__s
zBdb.__init__cCsT	|d|dd�dkr|S|j�|�}|s(tj�|�}tj�|�}||j|<|S)N�<�����>)r�get�os�path�abspath�normcase)r�filename�canonicrrrr 's
zBdb.canoniccCs(	ddl}|��d|_|�dd�dS)Nr)�	linecache�
checkcache�botframe�
_set_stopinfo)rr!rrr�reset8s
z	Bdb.resetcCs�	|jrdS|dkr|�|�S|dkr|�||�S|dkr#|�||�S|dkr-|�||�S|dkr4|jS|dkr;|jS|dkrB|jStdt|��|jS)	N�lineZcall�returnZ	exceptionZc_callZc_exceptionZc_returnz*bdb.Bdb.dispatch: unknown debugging event:)�quitting�
dispatch_line�
dispatch_call�dispatch_return�dispatch_exception�trace_dispatch�print�repr)r�frameZevent�argrrrr-?s&
zBdb.trace_dispatchcCs0	|�|�s|�|�r|�|�|jrt�|jSr
)�	stop_here�
break_here�	user_liner(rr-�rr0rrrr)js


zBdb.dispatch_linecCsf	|jdur
|j|_|jS|�|�s|�|�sdS|jr%|jjt@r%|jS|�	||�|j
r0t�|jSr
)r#�f_backr-r2�break_anywhere�	stopframe�f_code�co_flags�GENERATOR_AND_COROUTINE_FLAGS�	user_callr(r�rr0r1rrrr*vs

zBdb.dispatch_callcCs�	|�|�s||jkr?|jr|jjt@r|jSz||_|�||�Wd|_nd|_w|j	r/t
�|j|ur?|jdkr?|�dd�|jS�Nr)
r2�returnframer8r9r:r;r-r�user_returnr(r�
stoplinenor$r=rrrr+�s
zBdb.dispatch_returncCs�	|�|�r&|jjt@r|dtur|ddus#|�||�|jr#t�|j
S|jrH||jurH|jjjt@rH|dtt	fvrH|�||�|jrHt�|j
S)Nr�)r2r9r:r;�
StopIteration�user_exceptionr(rr8�
GeneratorExitr-r=rrrr,�s

��
zBdb.dispatch_exceptioncCs0	|durdS|jD]}t�||�rdSq
dS�NFT)r�fnmatch)rZmodule_name�patternrrr�is_skipped_module�s
�zBdb.is_skipped_modulecCsP	|jr|�|j�d��rdS||jur!|jdkrdS|j|jkS|js&dSdS)NrFrT)rrI�	f_globalsrr8rA�f_linenor5rrrr2�s�

z
Bdb.stop_herecCs�	|�|jj�}||jvrdS|j}||j|vr&|jj}||j|vr&dSt|||�\}}|rC|j|_|rA|j	rA|�
t|j��dSdSrF)r r9�co_filenamerrK�co_firstlineno�	effective�numberZ	currentbp�	temporary�do_clear�str)rr0r�lineno�bp�flagrrrr3�s 

zBdb.break_herecCs
	td��)Nz)subclass of bdb must implement do_clear())�NotImplementedError)rr1rrrrQ�szBdb.do_clearcCs	|�|jj�|jvSr
)r r9rLrr5rrrr7�szBdb.break_anywherecC�	dSr
r)rr0Z
argument_listrrrr<�z
Bdb.user_callcCrWr
rr5rrrr4rXz
Bdb.user_linecCrWr
r)rr0Zreturn_valuerrrr@rXzBdb.user_returncCrWr
r)rr0�exc_inforrrrDrXzBdb.user_exceptionrcCs	||_||_d|_||_dS�NF)r8r?r(rA)rr8r?rArrrr$s

zBdb._set_stopinfocCs&	|dur
|jd}|�|||�dS�Nr)rKr$)rr0rSrrr�	set_until$s
z
Bdb.set_untilcCs2	|jr|jj}|r|js|j|_|�dd�dSr
)rr6�f_tracer-r$)rZcaller_framerrr�set_step,s
zBdb.set_stepcCs	|�|d�dSr
)r$r5rrr�set_next8szBdb.set_nextcCs2	|jjt@r|�|dd�dS|�|j|�dSr>)r9r:r;r$r6r5rrr�
set_return<szBdb.set_returncCsP	|dur
t��j}|��|r|j|_||_|j}|s|��t�|j�dSr
)	�sys�	_getframer6r%r-r]r#r^�settracer5rrr�	set_traceCs
�z
Bdb.set_tracecCsf	|�|jdd�|js+t�d�t��j}|r-||jur1|`|j}|r/||jusdSdSdSdSdSr>)r$r#rrarcrbr6r]r5rrr�set_continueRs

��zBdb.set_continuecCs$	|j|_d|_d|_t�d�dS�NT)r#r8r?r(rarc�rrrr�set_quitas
zBdb.set_quitcCs*	|j�|g�}||vr|�|�dSdSr
)r�
setdefault�append)rrrSZ
bp_linenosrrr�_add_to_breaksrs
�zBdb._add_to_breaksFc	CsP	|�|�}ddl}|�||�}|sd||fS|�||�t|||||�}dS)NrzLine %s:%d does not exist)r r!�getlinerkr)	rrrSrP�cond�funcnamer!r&rTrrr�	set_breakxs
z
Bdb.set_breakcCs&	tj��D]
\}}|�||�qdSr
)r�bplist�keysrk�rrrSrrrr�s�zBdb._load_breakscCs:	||ftjvr|j|�|�|j|s|j|=dSdSr
)rrpr�removerrrrr�
_prune_breaks�s
�zBdb._prune_breakscCsl	|�|�}||jvrd|S||j|vrd||fStj||fdd�D]}|��q'|�||�dS)N�There are no breakpoints in %szThere is no breakpoint at %s:%d)r rrrp�deleteMert)rrrSrTrrr�clear_break�s


zBdb.clear_breakc
CsZ	z|�|�}Wnty}z
t|�WYd}~Sd}~ww|��|�|j|j�dSr
)�get_bpbynumber�
ValueErrorrRrvrt�filer&)rr1rT�errrrr�clear_bpbynumber�s��zBdb.clear_bpbynumbercCsZ	|�|�}||jvrd|S|j|D]}tj||f}|D]}|��qq|j|=dS)Nru)r rrrprv)rrr&ZblistrTrrr�clear_all_file_breaks�s


�zBdb.clear_all_file_breakscCs.	|jsdStjD]}|r|��q	i|_dS)NzThere are no breakpoints)rr�
bpbynumberrv)rrTrrr�clear_all_breaks�s
�zBdb.clear_all_breakscCs|	|std��zt|�}Wntytd|�d�wztj|}Wnty1td|�d�w|dur<td|��|S)NzBreakpoint number expectedz Non-numeric breakpoint number %sz!Breakpoint number %d out of rangezBreakpoint %d already deleted)ry�intrr~�
IndexError)rr1rOrTrrrrx�s ��zBdb.get_bpbynumbercCs$	|�|�}||jvo||j|vSr
�r rrrrrr�	get_break�s


�z
Bdb.get_breakcCs6	|�|�}||jvr||j|vrtj||fpgSr
)r rrrprrrrr�
get_breaks�s

���zBdb.get_breakscCs$	|�|�}||jvr|j|SgSr
r�)rrrrr�get_file_breaks�s



zBdb.get_file_breakscCs	|jSr
)rrgrrr�get_all_breaks	szBdb.get_all_breakscCs�	g}|r
|j|ur
|j}|dur&|�||jf�||jurn|j}|dus|��tdt|�d�}|durG|�|j|j	f�|j}|dus7|durTtdt|�d�}||fS)Nrr)
�tb_frame�tb_nextrjrKr#r6�reverse�max�len�	tb_lineno)r�f�t�stack�irrr�	get_stacks&
��z
Bdb.get_stack�: cCs�	ddl}ddl}|\}}|�|jj�}d||f}|jjr%||jj7}n|d7}|d7}d|jvrB|jd}	|d7}||�|	�7}|durX|�|||j	�}
|
rX|||
�
�7}|S)Nrz%s(%r)z<lambda>z()Z
__return__z->)r!�reprlibr r9rL�co_name�f_localsr/rlrJ�strip)rZframe_linenoZlprefixr!r�r0rSr�sZrvr&rrr�format_stack_entry's$

zBdb.format_stack_entryc	Cs�	|durddl}|j}|dur|}|��t|t�r!t|dd�}t�|j�z(zt	|||�Wn	t
y9YnwWd|_t�d�dSWd|_t�d�dSd|_t�d�w)Nrz<string>�execT)�__main__�__dict__r%�
isinstancerR�compilerarcr-r�rr()r�cmd�globals�localsr�rrr�runGs.
����zBdb.runc	Cs�	|durddl}|j}|dur|}|��t�|j�z%zt|||�WWd|_t�d�Sty6YnwWd|_t�d�dSd|_t�d�w)NrT)	r�r�r%rarcr-�evalr(r)r�exprr�r�r�rrr�runeval]s(���zBdb.runevalcCs	|�|||�dSr
)r�)rr�r�r�rrr�runctxqsz
Bdb.runctxc	Os�	|��t�|j�d}z)z	||i|��}Wn	ty YnwWd|_t�d�|SWd|_t�d�|Sd|_t�d�wrf)r%rarcr-rr()r�func�args�kwds�resrrr�runcallxs&��
�
�zBdb.runcallr
)r�FNN)r��NN)/rr	r
rr r%r-r)r*r+r,rIr2r3rQr7r<r4r@rDr$r\r^r_r`rdrerhrkrorrtrwr|r}rrxr�r�r�r�r�r�r�r�r�r�rrrrrs`

+	



�





 
rcCs	t���dSr
)rrdrrrrrd�srdc@sdeZdZ	dZiZdgZddd�Zedd��Zdd	�Z	d
d�Z
dd
�Zddd�Zdd�Z
dd�ZdS)rrNFcCs�||_d|_||_||_||_||_d|_d|_d|_t	j
|_t	j
d7_
|j�
|�||f|jvr?|j||f�
|�dS|g|j||f<dS)NTrr)rn�func_first_executable_linerzr&rPrm�enabled�ignore�hitsr�nextrOr~rjrp)rrzr&rPrmrnrrrr�szBreakpoint.__init__cCsdt_it_dgt_dSr[)rr�rpr~rrrr�clearBreakpoints�szBreakpoint.clearBreakpointscCsD	|j|jf}d|j|j<|j|�|�|j|s |j|=dSdSr
)rzr&r~rOrprs)r�indexrrrrv�s
�zBreakpoint.deleteMecC�	d|_dSrf�r�rgrrr�enable��
zBreakpoint.enablecCr�rZr�rgrrr�disable�r�zBreakpoint.disablecCs$	|durtj}t|��|d�dS)N)rz)ra�stdoutr.�bpformat)r�outrrr�bpprint�szBreakpoint.bpprintcCs�	|jrd}nd}|jr|d}n|d}d|j||j|jf}|jr+|d|jf7}|jr6|d|jf7}|jrL|jdkrAd	}nd
}|d|j|f7}|S)Nzdel  zkeep zyes  zno   z%-4dbreakpoint   %s at %s:%dz
	stop only if %sz
	ignore next %d hitsrr��z"
	breakpoint already hit %d time%s)rPr�rOrzr&rmr�r�)rZdispZretZssrrrr��s(
�
zBreakpoint.bpformatcCs	d|j|j|jfS)Nzbreakpoint %s at %s:%s)rOrzr&rgrrr�__str__szBreakpoint.__str__r�r
)rr	r
r�rpr~r�staticmethodr�rvr�r�r�r�r�rrrrr�s



rcCsP	|js|j|jkrdSdS|jj|jkrdS|js|j|_|j|jkr&dSdSrF)rnr&rKr9r�r�)�br0rrr�
checkfuncname	sr�cCs�	tj||f}|D]U}|jsq
t||�sq
|jd7_|js3|jdkr-|jd8_q
|dfSz!t|j|j|j	�}|rS|jdkrL|jd8_n|dfWSWq
|dfYSdS)NrrTFr�)
rrpr�r�r�rmr�r�rJr�)rzr&r0Z	possiblesr��valrrrrN)s.


�rNc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�TdbcCs |jj}|sd}td||�dS)N�???z+++ call)r9r�r.)rr0r��namerrrr<_sz
Tdb.user_callcCsTddl}|jj}|sd}|�|jj�}|�||j|j�}td||j|d|�	��dS)Nrr�z+++�:)
r!r9r�r rLrlrKrJr.r�)rr0r!r��fnr&rrrr4csz
Tdb.user_linecCstd|�dS)Nz
+++ return�r.)rr0Zretvalrrrr@jszTdb.user_returncCstd|�|��dS)Nz
+++ exception)r.re)rr0Z	exc_stuffrrrrDls
zTdb.user_exceptionN)rr	r
r<r4r@rDrrrrr�^s
r�cCs&td|d�t|d�}td|�dS)Nzfoo(�)�
zbar returned)r.�bar)�n�xrrr�foopsr�cCstd|d�|dS)Nzbar(r�rBr�)�arrrr�usr�cCst�}|�d�dS)Nzimport bdb; bdb.foo(10))r�r�)r�rrr�testysr�)rGrar�inspectrrr�__all__r;�	Exceptionrrrdrr�rNr�r�r�r�rrrr�<module>s*}z 5

?>