Hacked By AnonymousFox

Current Path : /proc/thread-self/root/proc/self/root/opt/alt/python36/lib64/python3.6/idlelib/__pycache__/
Upload File :
Current File : //proc/thread-self/root/proc/self/root/opt/alt/python36/lib64/python3.6/idlelib/__pycache__/debugger.cpython-36.pyc

3

� f�J�@s�ddlZddlZddlTddlmZddlmZddlmZddl	m
Z
Gdd�dej�ZGd	d
�d
�Z
Gdd�de�ZGd
d�d�Zedkr�ddlmZedddd�dS)�N)�*)�	Scrollbar)�macosx)�ScrolledList)�ListedToplevelc@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�IdbcCs||_tjj|�dS)N)�gui�bdb�Bdb�__init__)�selfr�r
�5/opt/alt/python36/lib64/python3.6/idlelib/debugger.pyrszIdb.__init__cCsL|j|�r|j�dS|j|�}y|jj||�Wntk
rFYnXdS)N)�in_rpc_code�set_step�_Idb__frame2messager�interactionZTclError)r�frame�messager
r
r�	user_lines

z
Idb.user_linecCs4|j|�r|j�dS|j|�}|jj|||�dS)N)rrrrr)rr�inforr
r
r�user_exceptions


zIdb.user_exceptioncCsB|jjjd�rdS|j}|jj}d|kr4d|kr4dS|j|�SdS)Nzrpc.pyT�idlelibZdebuggerF)�f_code�co_filename�count�f_backr)rrZ
prev_frameZ	prev_namer
r
rr#szIdb.in_rpc_codecCsF|j}|j}|j}tjj|�}d||f}|jdkrBd||jf}|S)Nz%s:%s�?z%s: %s())rr�f_lineno�os�path�basename�co_name)rr�code�filename�linenor!rr
r
rZ__frame2message/s
zIdb.__frame2messageN)�__name__�
__module__�__qualname__rrrrrr
r
r
rrs

rc@s�eZdZdZZZZd1dd�Zdd�Zd2dd�Z	dd	�Z
d3d
d�Zdd
�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�ZdZdd�Zdd�Zd d!�ZdZdZd"d#�Zd$d%�Zd4d'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Z dS)5�DebuggerNcCs:|dkrt|�}||_||_d|_|j�d|_d|_dS)Nr)r�pyshell�idbr�make_gui�interacting�
nesting_level)rr*r+r
r
rr>szDebugger.__init__csN�jdkr.�j��jjd��fdd��dSzd�_�jj��Sd�_XdS)Nr�dcs
�j��S)N)�runr
)�argsrr
r�<lambda>hszDebugger.run.<locals>.<lambda>�)r.�
abort_loop�root�afterr-r+r0)rr1r
)r1rrr0Hs
zDebugger.runcCsdy|j�Wntk
r YnX|jr6|jj�dS|jrL|jj�d|_|jj�|jj	�dS)N)
�quit�	Exceptionr-�topZbell�stackviewer�closer*Zclose_debugger�destroy)r�eventr
r
rr;ps


zDebugger.closecCsF|j}|j|_|j|_}t|�|_}|jjd�|jjd�|jd|j�|jj	d|j�t
|�|_}|jjdd�g|_
}t|d|jd�|_}|j|�t|d	|jd�|_}|j|�t|d
|jd�|_}|j|�t|d|jd�|_}|j|�t|d|jd�|_}|j|�x&|D]}|jd
d�|jdd��q*Wt
|�|_}|jjdd�|j�s�t|�|j_|jjd�t|d|j |jd�|_!|j!j"ddd�|j#�s�t|�|j_#t|d|j$|j#d�|_%|j%j"ddd�|j&�st|�|j_&|j&jd�t|d|j'|j&d�|_(|j(j"ddd�|j)�sBt|�|j_)t|d|j*|j)d�|_+|j+j"ddd�t,|dd�|_-|j-jdd�t,|dd�|_.|j.jddd�|j.j/d�|_0t
|dd�|_1|j1jddd�t
|�|_2|j2jddd�t
|dd�|_3|j3jddd�|jj4��r|j �|j&j4��r.|j'�|j)j4��rB|j*�dS)Nz
Debug ControlZDebugZWM_DELETE_WINDOWz<Escape>�w)�anchorZGo)�text�commandZStepZOverZOutZQuit�disabled)�state�left)�sider3ZStack)r@rAZvariabler)�row�columnZSource�Locals�Globals�x)r?�fill�
background)�height�both)�expandrK)5r*�flistr5rr9Zwm_titleZwm_iconnameZwm_protocolr;Zbind�Frame�bframe�pack�buttonsZButton�contZbcont�append�stepZbstep�nextZbnext�retZbretr7�	configure�cframe�vstackZ
BooleanVar�	__class__�setZCheckbutton�
show_stackZbstack�grid�vsource�show_sourceZbsource�vlocals�show_localsZblocals�vglobals�show_globalsZbglobals�Label�status�errorZcget�errorbg�fstack�flocals�fglobals�get)rr*r5r9rRZbl�br[r
r
rr,�s�







zDebugger.make_guic
Cs|||_|jj|d�|r~|\}}}y
|j}Wn tk
rLdt|�}YnX|dk	rxyd|t|�f}WnYnXd}nd}d}|j}|jj||d�|j}	|	r�|j	j
|j|�\}
}|	j|
|�|jd�|j
j�r�|j�x|jD]}|jdd	�q�W|jj�|jd7_|jjjd
d�|jd8_x|jD]}|jdd	��q<W|jjdd�|jjd|jd�d|_dS)
N)r@z%sz%s: %sZyellow�)r@rLr3Znormal)rCZvwaitz::idledebugwaitrB)rrhrZr&�AttributeError�strrjrir:r+�	get_stack�
load_stack�show_variablesrarn�sync_source_linerTr9�wakeupr.r5�tk�call)
rrrr�type�value�tb�m1Zbg�sv�stack�iror
r
rr�sH




zDebugger.interactioncCsV|j}|sdS|j|�\}}|dd�|dd�dkrRtjj|�rR|jj||�dS)Nr3z<>���)r�_Debugger__frame2filelinerr �existsrPZgotofileline)rrr$r%r
r
rrv�s(zDebugger.sync_source_linecCs|j}|j}|j}||fS)N)rrr)rrr#r$r%r
r
rZ__frame2filelineszDebugger.__frame2filelinecCs|jj�|j�dS)N)r+Zset_continuer4)rr
r
rrUs
z
Debugger.contcCs|jj�|j�dS)N)r+rr4)rr
r
rrWs
z
Debugger.stepcCs|jj|j�|j�dS)N)r+Zset_nextrr4)rr
r
rrXsz
Debugger.nextcCs|jj|j�|j�dS)N)r+Z
set_returnrr4)rr
r
rrYszDebugger.retcCs|jj�|j�dS)N)r+Zset_quitr4)rr
r
rr7s
z
Debugger.quitcCs|jjjddd�dS)Nr^z::idledebugwait�1)r5rxry)rr
r
rr4szDebugger.abort_loopcCs�|jrP|jj�rPt|j|j|�|_}|jr~|jj|jd�\}}|j	||�n.|j}|rt|jj�rtd|_|j
�d|jd<dS)Nr3rM)r:r\rn�StackViewerrkrPrr+rsrtr;)rr~rr�r
r
rr_$szDebugger.show_stackcCs|jj�r|j�dS)N)rarnrv)rr
r
rrb1s
zDebugger.show_sourcecCs|d|_|j�dS)Nr)rru)rZ	stackitemr
r
r�
show_frame5s
zDebugger.show_framecCsL|j}|jj�r$|s@t|jd�|_n|r@d|_|j�d|jd<|j�dS)NrHr3rM)�localsviewerrcrn�NamespaceViewerrlr;ru)r�lvr
r
rrd<s

zDebugger.show_localscCsL|j}|jj�r$|s@t|jd�|_n|r@d|_|j�d|jd<|j�dS)NrIr3rM)�
globalsviewerrernr�rmr;ru)r�gvr
r
rrfHs

zDebugger.show_globalsrcCst|j}|j}|j}|s d}}n |j}|j}|r@|r@||kr@d}|rX|j|||jjj�|rp|j|||jjj�dS)N)	r�r�r�f_locals�	f_globals�	load_dictr*ZinterpZrpcclt)r�forcer�r�rZldictZgdictr
r
rruTs
zDebugger.show_variablescCs|jj||�dS)N)r+Z	set_break)rr$r%r
r
r�set_breakpoint_heredszDebugger.set_breakpoint_herecCs|jj||�dS)N)r+Zclear_break)rr$r%r
r
r�clear_breakpoint_heregszDebugger.clear_breakpoint_herecCs|jj|�dS)N)r+Zclear_all_file_breaks)rr$r
r
r�clear_file_breaksjszDebugger.clear_file_breakscCsXxR|jjjD]D}|jj}y x|jD]}|j||�q"WWqtk
rNwYqXqWdS)z=Load PyShellEditorWindow breakpoints into subprocess debuggerN)r*rPZinversedict�ior$Zbreakpointsr�rq)rZeditwinr$r%r
r
r�load_breakpointsmszDebugger.load_breakpoints)N)N)N)r)!r&r'r(r\rarcrerr0r;r,rrvr�rUrWrXrYr7r4r:r_rbr�r�r�rdrfrur�r�r�r�r
r
r
rr):s6

(
K
1

r)c@sVeZdZdd�Zddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�ZdS)r�cCs<tj�rtj||�ntj||dd�||_||_g|_dS)N�P)�width)rZisAquaTkrrrPrr)r�masterrPrr
r
rryszStackViewer.__init__Nc
Cs�||_|j�x�tt|��D]�}||\}}y|jd}Wnd}YnX|j}|j}|j}	ddl}
|
j	||�}|j
�}|	dkr�d|||f}nd||	||f}||kr�d|}|j|�qW|dk	r�|j|�dS)	Nr&rrrpz%s, line %d: %sz%s.%s(), line %d: %sz> )rrpN)
r�clear�range�lenr�rrr"�	linecache�getline�striprVZselect)
rr�indexr�rr%�modnamer#r$�funcnamer�Z
sourceline�itemr
r
rrt�s.

zStackViewer.load_stackcCs|jrtj||�SdS)zoverride base methodN)rr�popup_event)rr=r
r
rr��szStackViewer.popup_eventcCs*|j}|jd|jd�|jd|jd�dS)zoverride base methodzGo to source line)�labelrAzShow stack frameN)�menuZadd_command�goto_source_line�show_stack_frame)rr�r
r
r�	fill_menu�s

zStackViewer.fill_menucCs4d|kot|j�knr0|jj|j|�dS)zoverride base methodrN)r�rrr�)rr�r
r
r�	on_select�szStackViewer.on_selectcCs|j|�dS)zoverride base methodN)rb)rr�r
r
r�	on_double�szStackViewer.on_doublecCs|jjd�}|j|�dS)N�active)�listboxr�rb)rr�r
r
rr��szStackViewer.goto_source_linecCs@|jjd�}d|ko$t|j�knr<|jj|j|�dS)Nr�r)r�r�r�rrr�)rr�r
r
rr��szStackViewer.show_stack_framecCsfd|kot|j�kns"dS|j|\}}|j}|j}tjj|�rb|jj|�}|rb|j	|�dS)Nr)
r�rrrrr �isfilerP�openZgotoline)rr�rr%r#r$Zeditr
r
rrb�szStackViewer.show_source)N)r&r'r(rrtr�r�r�r�r�r�rbr
r
r
rr�ws
r�c@s,eZdZd
dd�ZdZddd�Zdd	�ZdS)
r�NcCs d}d}|rdt|�}||_||_ddl}|j�|_d|j_d|j_t|�|_	}|j	j
ddd�t||dd	d
�|_|jj
dd�t
|d
d�|_}|j
ddd�t|tdtd|��dd||fd�|_}	|	j
dddd�|	j|d<|j|	d<t|	�|_}
|	jdd|
dd�|_|j|�dS)Nr�(��<r3rN)rOrK�Zgroove)r@�borderwidthZreliefrJ)rK�vbar)�name�right�y)rErKi,)rM�scrollregionrD)rErKrOrAZyscrollcommand�nw)Zwindowr?)r�r��title�reprlib�Repr�repr�	maxstring�maxotherrQrrSrgr�rr�ZCanvas�min�max�canvasZyviewr^�subframeZ
create_windowZsfidr�)rr�r��dictr�rMr�rr�r�r�r
r
rr�s2


zNamespaceViewer.__init__r3rcCsh||jkr|rdS|j}|j}xt|jj��D]}|j�q0Wd|_|sft|dd�}|jddd�n�|j	�}t
|�}	d}
x~|	D]v}||}|jj|�}
|r�|
dd
�}
t||d�}|j|
ddd�t|ddd�}|j
d|
�|j|
ddd�|
d}
q�W||_|j�|j�}|j�}|j}dd||f|jd	<|d
k�rPd
|d<|jdd�n||d<|jdd�dS)N�None)r@r)rFrGr3r�)rFrGZsticky)r�r�r�i,rM)rOr�)r�r�r�listZchildren�valuesr<rgr`�keys�sortedr�ZEntry�insertZupdate_idletasksZwinfo_reqwidthZwinfo_reqheightr�rS)rr�r�Z
rpc_clientr�r�c�lZ	keys_list�namesrFr�r{Zsvaluer�rMr�r
r
rr��sF


zNamespaceViewer.load_dictcCs|jj�dS)N)rr<)rr
r
rr;szNamespaceViewer.close)Nr�)rN)r&r'r(rr�r�r;r
r
r
rr��s

6r��__main__)�mainzidlelib.idle_test.test_debuggerr�F)�	verbosity�exit)r	rZtkinterZtkinter.ttkrrrZidlelib.scrolledlistrZidlelib.windowrr
rr)r�r�r&Zunittestr�r
r
r
r�<module>s.?SX

Hacked By AnonymousFox1.0, Coded By AnonymousFox