ok

Mini Shell

Direktori : /lib64/python3.6/__pycache__/
Upload File :
Current File : //lib64/python3.6/__pycache__/bdb.cpython-36.opt-2.pyc

3


 \\�@s�ddlZddlZddlZddlmZmZmZdddgZeeBeBZGdd�de	�Z
Gdd�d�Zdd	�ZGd
d�d�Z
dd�Zd
d�ZGdd�de�Zdd�Zdd�Zdd�ZdS)�N)�CO_GENERATOR�CO_COROUTINE�CO_ASYNC_GENERATOR�BdbQuit�Bdb�
Breakpointc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.6/bdb.pyr
sc@sleZdZdYdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�ZdZd%d&�Zd[d'd(�Zd)d*�Zd+d,�Zd-d.�Zd\d/d0�Zd1d2�Zd3d4�Zd]d6d7�Zd8d9�Zd:d;�Zd<d=�Zd>d?�Z d@dA�Z!dBdC�Z"dDdE�Z#dFdG�Z$dHdI�Z%dJdK�Z&dLdM�Z'd^dOdP�Z(d_dQdR�Z)d`dSdT�Z*dUdV�Z+dWdX�Z,dS)arNcCs(|rt|�nd|_i|_i|_d|_dS)N)�set�skip�breaks�fncache�frame_returning)�selfrrrr�__init__szBdb.__init__cCsR|d|dd�dkr|S|jj|�}|sNtjj|�}tjj|�}||j|<|S)N�<��>���)r�get�os�path�abspath�normcase)r�filename�canonicrrrrs
zBdb.canoniccCs&ddl}|j�d|_|jdd�dS)Nr)�	linecache�
checkcache�botframe�
_set_stopinfo)rrrrr�reset)sz	Bdb.resetcCs�|jr
dS|dkr|j|�S|dkr0|j||�S|dkrD|j||�S|dkrX|j||�S|dkrf|jS|dkrt|jS|dkr�|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_dispatchcCs.|j|�s|j|�r(|j|�|jr(t�|jS)N)�	stop_here�
break_here�	user_liner&rr+)rr.rrrr'Cs

zBdb.dispatch_linecCsd|jdkr|j|_|jS|j|�p*|j|�s0dS|jrH|jjt@rH|jS|j	||�|j
r^t�|jS)N)r!�f_backr+r0�break_anywhere�	stopframe�f_code�co_flags�GENERATOR_AND_COROUTINE_FLAGS�	user_callr&r)rr.r/rrrr(Is
zBdb.dispatch_callcCs||j|�s||jkrv|jr,|jjt@r,|jSz||_|j||�Wdd|_X|j	rVt
�|j|krv|jdkrv|jdd�|jS)Nrr)
r0�returnframer5r6r7r8r+r�user_returnr&r�
stoplinenor")rr.r/rrrr)YszBdb.dispatch_returncCs�|j|�rF|jjt@o,|dtko,|ddks�|j||�|jr�t�nD|jr�||jk	r�|jjjt@r�|dtt	fkr�|j||�|jr�t�|j
S)Nr�)r0r6r7r8�
StopIteration�user_exceptionr&rr5�
GeneratorExitr+)rr.r/rrrr*is
zBdb.dispatch_exceptioncCs$x|jD]}tj||�rdSqWdS)NTF)r�fnmatch)rZmodule_name�patternrrr�is_skipped_module�szBdb.is_skipped_modulecCsN|jr|j|jjd��rdS||jkr@|jdkr4dS|j|jkS|jsJdSdS)NrFrTr)rrC�	f_globalsrr5r<�f_lineno)rr.rrrr0�s

z
Bdb.stop_herecCs�|j|jj�}||jkrdS|j}||j|krJ|jj}||j|krJdSt|||�\}}|r�|j|_|r�|j	r�|j
t|j��dSdSdS)NFT)rr6�co_filenamerrE�co_firstlineno�	effective�numberZ	currentbp�	temporary�do_clear�str)rr.r�lineno�bp�flagrrrr1�s

zBdb.break_herecCstd��dS)Nz)subclass of bdb must implement do_clear())�NotImplementedError)rr/rrrrK�szBdb.do_clearcCs|j|jj�|jkS)N)rr6rFr)rr.rrrr4�szBdb.break_anywherecCsdS)Nr)rr.Z
argument_listrrrr9�sz
Bdb.user_callcCsdS)Nr)rr.rrrr2�sz
Bdb.user_linecCsdS)Nr)rr.Zreturn_valuerrrr;�szBdb.user_returncCsdS)Nr)rr.�exc_inforrrr?�szBdb.user_exceptionrcCs||_||_d|_||_dS)NF)r5r:r&r<)rr5r:r<rrrr"�szBdb._set_stopinfocCs$|dkr|jd}|j|||�dS)Nr)rEr")rr.rMrrr�	set_until�s
z
Bdb.set_untilcCs2|jr"|jj}|r"|jr"|j|_|jdd�dS)N)rr3�f_tracer+r")rZcaller_framerrr�set_step�s
zBdb.set_stepcCs|j|d�dS)N)r")rr.rrr�set_next�szBdb.set_nextcCs.|jjt@r|j|dd�n|j|j|�dS)Nrr)r6r7r8r"r3)rr.rrr�
set_return�szBdb.set_returncCsP|dkrtj�j}|j�x|r6|j|_||_|j}qW|j�tj|j�dS)N)	�sys�	_getframer3r#r+rSr!rT�settrace)rr.rrr�	set_trace�s

z
Bdb.set_tracecCsL|j|jdd�|jsHtjd�tj�j}x|rF||jk	rF|`|j}q,WdS)Nrr)r"r!rrWrYrXr3rS)rr.rrr�set_continues

zBdb.set_continuecCs"|j|_d|_d|_tjd�dS)NT)r!r5r:r&rWrY)rrrr�set_quitszBdb.set_quitFc
Csb|j|�}ddl}|j||�}|s.d||fS|jj|g�}||krN|j|�t|||||�}	dS)NrzLine %s:%d does not exist)rr�getliner�
setdefault�appendr)
rrrMrJ�cond�funcnamerr$�listrNrrr�	set_breaks

z
Bdb.set_breakcCs4||ftjkr|j|j|�|j|s0|j|=dS)N)r�bplistr�remove)rrrMrrr�
_prune_breaks$s
zBdb._prune_breakscCsn|j|�}||jkrd|S||j|kr6d||fSx&tj||fdd�D]}|j�qNW|j||�dS)NzThere are no breakpoints in %szThere is no breakpoint at %s:%d)rrrrd�deleteMerf)rrrMrNrrr�clear_break*s

zBdb.clear_breakcCsPy|j|�}Wn$tk
r2}zt|�Sd}~XnX|j�|j|j|j�dS)N)�get_bpbynumber�
ValueErrorrLrgrf�filer$)rr/rN�errrrr�clear_bpbynumber6szBdb.clear_bpbynumbercCs`|j|�}||jkrd|Sx6|j|D](}tj||f}x|D]}|j�q@Wq(W|j|=dS)NzThere are no breakpoints in %s)rrrrdrg)rrr$ZblistrNrrr�clear_all_file_breaks>s


zBdb.clear_all_file_breakscCs0|js
dSxtjD]}|r|j�qWi|_dS)NzThere are no breakpoints)rr�
bpbynumberrg)rrNrrr�clear_all_breaksHszBdb.clear_all_breakscCs�|std��yt|�}Wn tk
r8td|��YnXytj|}Wn tk
rhtd|��YnX|dkr~td|��|S)NzBreakpoint number expectedz Non-numeric breakpoint number %sz!Breakpoint number %d out of rangezBreakpoint %d already deleted)rj�intrro�
IndexError)rr/rIrNrrrriPszBdb.get_bpbynumbercCs"|j|�}||jko ||j|kS)N)rr)rrrMrrr�	get_break_s

z
Bdb.get_breakcCs4|j|�}||jkr0||j|kr0tj||fp2gS)N)rrrrd)rrrMrrr�
get_breaksds

zBdb.get_breakscCs&|j|�}||jkr|j|SgSdS)N)rr)rrrrr�get_file_breaksjs


zBdb.get_file_breakscCs|jS)N)r)rrrr�get_all_breaksqszBdb.get_all_breakscCs�g}|r|j|kr|j}x.|dk	rF|j||jf�||jkr>P|j}qW|j�tdt|�d�}x$|dk	r�|j|j|j	f�|j}qdW|dkr�tdt|�d�}||fS)Nrr)
�tb_frame�tb_nextr_rEr!r3�reverse�max�len�	tb_lineno)r�f�t�stack�irrr�	get_stackws 




z
Bdb.get_stack�: cCs�ddl}ddl}|\}}|j|jj�}d||f}|jjrH||jj7}n|d7}d|jkrf|jd}	nd}	|	r~||j|	�7}n|d7}d|jkr�|jd}
|d7}||j|
�7}|j|||j	�}|r�|||j
�7}|S)Nrz%s(%r)z<lambda>Z__args__z()Z
__return__z->)r�reprlibrr6rF�co_name�f_localsr-r]rD�strip)rZframe_linenoZlprefixrr�r.rMr�s�args�rvr$rrr�format_stack_entry�s*


zBdb.format_stack_entrycCs�|dkrddl}|j}|dkr"|}|j�t|t�r@t|dd�}tj|j�z*yt	|||�Wnt
k
rrYnXWdd|_tjd�XdS)Nrz<string>�execT)�__main__�__dict__r#�
isinstancerL�compilerWrYr+r�rr&)r�cmd�globals�localsr�rrr�run�s

zBdb.runcCst|dkrddl}|j}|dkr"|}|j�tj|j�z&yt|||�Stk
rXYnXWdd|_tjd�XdS)NrT)	r�r�r#rWrYr+�evalrr&)r�exprr�r�r�rrr�runeval�s
zBdb.runevalcCs|j|||�dS)N)r�)rr�r�r�rrr�runctx�sz
Bdb.runctxcOsX|j�tj|j�d}z(y|||�}Wntk
r<YnXWdd|_tjd�X|S)NT)r#rWrYr+rr&)r�funcr��kwds�resrrr�runcall�s
zBdb.runcall)N)r)N)N)FNN)r�)NN)NN)-rr	r
rrr#r+r'r(r)r*rCr0r1rKr4r9r2r;r?r"rRrTrUrVrZr[r\rcrfrhrmrnrprirsrtrurvr�r�r�r�r�r�rrrrrsV










cCst�j�dS)N)rrZrrrrrZ�srZc@sVeZdZdZiZdgZddd�Zdd�Zdd	�Zd
d�Z	ddd
�Z
dd�Zdd�ZdS)rrNFcCs�||_d|_||_||_||_||_d|_d|_d|_t	j
|_t	j
d7_
|jj
|�||f|jkr||j||fj
|�n|g|j||f<dS)NTrr)ra�func_first_executable_linerkr$rJr`�enabled�ignore�hitsr�nextrIror_rd)rrkr$rJr`rarrrr�szBreakpoint.__init__cCs>|j|jf}d|j|j<|j|j|�|j|s:|j|=dS)N)rkr$rorIrdre)r�indexrrrrgs

zBreakpoint.deleteMecCs
d|_dS)NT)r�)rrrr�enableszBreakpoint.enablecCs
d|_dS)NF)r�)rrrr�disableszBreakpoint.disablecCs"|dkrtj}t|j�|d�dS)N)rk)rW�stdoutr,�bpformat)r�outrrr�bpprintszBreakpoint.bpprintcCs�|jrd}nd}|jr |d}n|d}d|j||j|jf}|jrT|d|jf7}|jrj|d|jf7}|jr�|jdkr�d	}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)rJr�rIrkr$r`r�r�)rZdispZretZssrrrr�s$

zBreakpoint.bpformatcCsd|j|j|jfS)Nzbreakpoint %s at %s:%s)rIrkr$)rrrr�__str__6szBreakpoint.__str__)FNN)N)
rr	r
r�rdrorrgr�r�r�r�r�rrrrr�s

cCsN|js|j|jkrdSdS|jj|jkr,dS|js:|j|_|j|jkrJdSdS)NFT)rar$rEr6r�r�)�br.rrr�
checkfuncname;sr�cCs�tj||f}x�|D]�}|js qt||�s,q|jd7_|jsf|jdkr\|jd8_qq�|dfSqy<t|j|j|j	�}|r�|jdkr�|jd8_n|dfSWq|dfSqWdS)NrrTF)NN)
rrdr�r�r�r`r�r�rDr�)rkr$r.Z	possiblesr��valrrrrHWs*




rHc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�TdbcCs |jj}|sd}td||�dS)Nz???z+++ call)r6r�r,)rr.r��namerrrr9�sz
Tdb.user_callcCsTddl}|jj}|sd}|j|jj�}|j||j|j�}td||j|d|j	��dS)Nrz???z+++�:)
rr6r�rrFr]rErDr,r�)rr.rr��fnr$rrrr2�sz
Tdb.user_linecCstd|�dS)Nz
+++ return)r,)rr.Zretvalrrrr;�szTdb.user_returncCstd|�|j�dS)Nz
+++ exception)r,r[)rr.Z	exc_stuffrrrr?�s
zTdb.user_exceptionN)rr	r
r9r2r;r?rrrrr��sr�cCs&td|d�t|d�}td|�dS)Nzfoo(�)�
zbar returned)r,�bar)�n�xrrr�foo�sr�cCstd|d�|dS)Nzbar(r�r=)r,)�arrrr��sr�cCst�}|jd�dS)Nzimport bdb; bdb.foo(10))r�r�)r~rrr�test�sr�)rArWr�inspectrrr�__all__r8�	ExceptionrrrZrr�rHr�r�r�r�rrrr�<module>s$
OZ0

Zerion Mini Shell 1.0