HEX
Server: Apache/2.4.65 (Unix) OpenSSL/1.1.1k
System: Linux vps109042.inmotionhosting.com 4.18.0 #1 SMP Mon Sep 30 15:36:27 MSK 2024 x86_64
User: cisa (1010)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: //opt/imh/python3.13/lib/python3.13/idlelib/__pycache__/debugger.cpython-313.pyc
�

��eR����SrSSKrSSKrSSK7 SSKJrJr SSKJr SSK	J
r
 SSKJr "SS	\R5rS
rSr"SS
5r"SS\
5r"SS5r\S:XaSSKJr \"SSSS9 gg)a�Debug user code with a GUI interface to a subclass of bdb.Bdb.

The Idb instance 'idb' and Debugger instance 'gui' need references to each
other or to an rpc proxy for each other.

If IDLE is started with '-n', so that user code and idb both run in the
IDLE process, Debugger is called without an idb.  Debugger.__init__
calls Idb with its incomplete self.  Idb.__init__ stores gui and gui
then stores idb.

If IDLE is started normally, so that user code executes in a separate
process, debugger_r.start_remote_debugger is called, executing in the
IDLE process.  It calls 'start the debugger' in the remote process,
which calls Idb with a gui proxy.  Then Debugger is called in the IDLE
for more.
�N)�*)�Frame�	Scrollbar)�macosx)�ScrolledList)�ListedToplevelc�8^�\rSrSrSrU4SjrSrSrSrU=r	$)�Idb�z6Supply user_line and user_exception functions for Bdb.c�.>�Xl[TU]	5 g�N)�gui�super�__init__)�selfr�	__class__s  ��6/opt/imh/python3.13/lib/python3.13/idlelib/debugger.pyr�Idb.__init__ s�����
����c��[U5(aUR5 g[U5nURR	X!5 g![
a gf=f)z]Handle a user stopping or breaking at a line.

Convert frame to a string and send it to gui.
N)�_in_rpc_code�set_step�_frame2messager�interaction�TclError)r�frame�messages   r�	user_line�
Idb.user_line$sN��
�����M�M�O�� ��'��	��H�H� � ��0���	��	�s�A
�

A�Ac��[U5(aUR5 g[U5nURR	X1U5 g)z)Handle an the occurrence of an exception.N)rrrrr)rr�exc_infors    r�user_exception�Idb.user_exception2s7�������M�M�O�� ��'�������W�X�6r)r)
�__name__�
__module__�__qualname__�__firstlineno__�__doc__rrr"�__static_attributes__�
__classcell__)rs@rr
r
s���<���7�7rr
c���URRRS5(agURnUcgURRnSU;aSU;ag[	U5$)z)Determine if debugger is within RPC code.zrpc.pyTF�idlelib�debugger)�f_code�co_filename�count�f_backr)r�
prev_frame�	prev_names   rrr:sb���|�|���%�%�h�/�/���\�\�
�����%�%�1�1�	��	�!�j�I�&=���J�'�'rc���URnURnURn[RRU5nUSU3nURS:waUSURS3nU$)z"Return a message string for frame.�:�?�: z())r.r/�f_lineno�os�path�basename�co_name)r�code�filename�linenor;rs      rrrIsj���<�<�D����H�
�^�^�F��w�w����)�H��
�!�F�8�$�G��|�|�s���I�R����~�R�0���Nrc���\rSrSrSrSrSrSrSrSr	Sr
SrSSjrSr
SSjrSrSSjrS	rS
rSrSrS
rSrSrSrSrSrSrSrSrSSjrSrSr Sr!Sr"Sr#g)�Debugger�Uz�The debugger interface.

This class handles the drawing of the debugger window and
the interactions with the underlying debugger session.
Nc��Uc[U5nXlX lSUlUR	5 SUlSUlg)z�Instantiate and draw a debugger window.

:param pyshell: An instance of the PyShell Window
:type  pyshell: :class:`idlelib.pyshell.PyShell`

:param idb: An instance of the IDLE debugger (optional)
:type  idb: :class:`idlelib.debugger.Idb`
NFr)r
�pyshell�idbr�make_gui�interacting�
nesting_level)rrDrEs   rr�Debugger.__init__cs<���;��d�)�C�������
��
�
�� �����rc��^^�TRS:�a2TR5 TRRSUU4Sj5 gSTlTR
R"T6STl$!STlf=f)zRun the debugger.r�dc�">�TR"T6$r
)�run)�argsrs��r�<lambda>�Debugger.run.<locals>.<lambda>�s
������4�rNTF)rH�
abort_loop�root�afterrGrErM)rrNs``rrM�Debugger.runusa���>����!��O�O���I�I�O�O�C�!8�9��	%�#�D���8�8�<�<��&�$�D���u�D��s�A-�-	A6c�j�UR5 UR(aURR	5 gUR
(a!UR
R
5 SUlURR5 URR5 g![a N�f=f)zClose the debugger and window.N)
�quit�	ExceptionrG�top�bell�stackviewer�closerD�close_debugger�destroy�r�events  rr[�Debugger.close�s���	��I�I�K�����H�H�M�M�O��������"�"�$��d�&6�	
���#�#�%���������	��	�s�B%�%
B2�1B2c�
�URnURUlUR=Uln[U5=UlnURRS5 URR
S5 URSUR5 URRSUR5 [U5=UlnURRSS9 /=Ul
n[USURS9=UlnUR#U5 [US	UR$S9=UlnUR#U5 [US
UR(S9=UlnUR#U5 [USUR,S9=UlnUR#U5 [USUR0S9=UlnUR#U5 UH!nUR3S
S9 URSS9 M# [U5=UlnUR4RSS9 UR6(d5[9U5UR:lUR6R=S5 [?USUR@UR6S9Ul!URBRESSS9 URF(d[9U5UR:l#[?USURHURFS9Ul%URJRESSS9 URL(d5[9U5UR:l&URLR=S5 [?USURNURLS9Ul(URPRESSS9 URR(d[9U5UR:l)[?USURTURRS9Ul+URVRESSS9 [YUSS9Ul-URZRSS9 [YUSS9Ul.UR\RSSS9 UR\R_S5Ul0[USS9Ul1URbRSSS9 [U5Ul2URdRSSS9 [USS9Ul3URfRSSS9 UR6Ri5(aURA5 URLRi5(aURO5 URRRi5(aURU5 gg) z$Draw the debugger gui on the screen.z
Debug Control�Debug�WM_DELETE_WINDOWz<Escape>�w)�anchor�Go)�text�command�Step�Over�Out�Quit�disabled��state�left)�side��Stack)rgrh�variabler��row�column�Source�Locals�Globals�x)re�fill�
background)�height�both��expandr|N)5rD�flistrRrrX�wm_title�wm_iconname�wm_protocolr[�bindr�bframe�pack�buttons�Button�cont�bcont�append�step�bstep�next�bnext�ret�bretrV�	configure�cframe�vstack�
BooleanVarr�set�Checkbutton�
show_stack�bstack�grid�vsource�show_source�bsource�vlocals�show_locals�blocals�vglobals�show_globals�bglobals�Label�status�error�cget�errorbg�fstack�flocals�fglobals�get)rrDrRrXr��bl�br�s        rrF�Debugger.make_gui�s1���,�,���]�]��
�"�<�<�'��	�D�'��-�-���3������/�*������W�%����*�D�J�J�7����
�
�j�$�*�*�-�$�S�z�)���f��������$�����r���T�4�9�9�E�E��
�Q�
�	�	�!����V�T�Y�Y�G�G��
�Q�
�	�	�!����V�T�Y�Y�G�G��
�Q�
�	�	�!���v�E�4�8�8�D�D��	�A�
�	�	�!���v�F�D�I�I�F�F��	�A�
�	�	�!���A�
�K�K�j�K�)�
�F�F��F��� %�V�}�,���f������f��%��{�{�$.�s�O�D�N�N�!��K�K�O�O�A��!�&��$�/�/�D�K�K�I��������Q�q��)��|�|�%/��_�D�N�N�"�"�6��4�#3�#3�d�l�l�L��������a���*��|�|�%/��_�D�N�N�"��L�L���Q��"�6��4�#3�#3�d�l�l�L��������a���*��}�}�&0��o�D�N�N�#�#�F��D�$5�$5��
�
�O��
��
�
���q���+��C��,����������$��3�s�+��
��
�
���s���-��z�z���|�4����C��*�����������/��S�z�����������0��c�!�,��
��
�
���!�&��1��;�;�?�?����O�O���<�<����������=�=���������rc�,�X lURRUS9 U(a UupEnURnUbUSU3nSnOSnSnURnURRXxS9 URn	U	(a9URRURU5up�U	RX�5 URS5 URR5(aUR5 UR HnURSS	9 M UR"R%5 U=R&S-
slUR(R*R-S
S5 U=R&S-slUR HnURSS	9 M URRSS9 URRSURS9 SUlg![a S[U5-nGN�f=f! GN�=f)
N�rgz%sr7�yellow�)rgr}rr�normalrn�vwait�::idledebugwaitrm)rr�r�r$�AttributeError�strr�r�rZrE�	get_stack�
load_stack�show_variablesr�r��sync_source_liner�rX�wakeuprHrR�tk�call)
rrr�info�type�value�tb�m1�bg�sv�stack�ir�s
             rr�Debugger.interaction�s����
������7��+��"�O�D��
&��]�]��� ���4�r�%��)�B��B��B��B����B��
�
���"��4�
�
�
��
��x�x�)�)�$�*�*�b�9�H�E��M�M�%�#����A���<�<������!�!�#����A�
�K�K�h�K�'��	
������	
���a����	�	�����'�#4�5����a������A�
�K�K�j�K�)�������2��&��
�
���"�����>���
��Q"�
&��C��I�%��
&����s�G/�H�/H�
H�Hc���URnU(dgURU5up#USSUSS-S:waA[RR	U5(aUR
R
X#5 ggg)Nrr���z<>)r�_Debugger__frame2fileliner9r:�existsr��gotofileline)rrr>r?s    rr��Debugger.sync_source_line.sj���
�
�����0�0��7����B�Q�<�(�2�3�-�'�4�/�B�G�G�N�N�8�4L�4L��J�J�#�#�H�5�5M�/rc�P�URnURnURnX44$r
)r.r/r8)rrr=r>r?s     r�__frame2fileline�Debugger.__frame2fileline6s(���|�|���#�#��������rc�X�URR5 UR5 gr
)rE�set_continuerQ�rs rr��
Debugger.cont<s�����������rc�X�URR5 UR5 gr
)rErrQr�s rr��
Debugger.step@������������rc�n�URRUR5 UR5 gr
)rE�set_nextrrQr�s rr��
Debugger.nextDs"�������$�*�*�%����rc�n�URRUR5 UR5 gr
)rE�
set_returnrrQr�s rr��Debugger.retHs"�������D�J�J�'����rc�X�URR5 UR5 gr
)rE�set_quitrQr�s rrV�
Debugger.quitLr�rc�R�URRRSSS5 g)Nr�r��1)rRr�r�r�s rrQ�Debugger.abort_loopPs���	�	�����%�!2�C�8rc��UR(d�URR5(at[URUR
U5=UlnUR(a:URRURS5up#URX#5 ggURnU(a6URR5(dSUlUR5 SURS'g)Nrrr~)rZr�r��StackViewerr�r�rrEr�r�r[)rr�r�r�s    rr��Debugger.show_stackSs������D�K�K�O�O�$5�$5�$/����T�Z�Z��$N�N�D��r��z�z��8�8�-�-�d�j�j�$�?����
�
�e�'���!�!�B��$�+�+�/�/�+�+�#'�� ����
�$%�D�K�K��!rc�d�URR5(aUR5 ggr
)r�r�r�r�s rr��Debugger.show_source`s&���<�<������!�!�#�rc�8�USUlUR5 g�Nr)rr�)r�	stackitems  r�
show_frame�Debugger.show_frameds���q�\��
����rc��URnURR5(a#U(d[URS5UlO-U(a&SUlUR5 SURS'UR
5 g)Nryrrr~)�localsviewerr�r��NamespaceViewerr�r[r�)r�lvs  rr��Debugger.show_localshse��
�
�
���<�<������$3�D�L�L�(�$K��!���$(��!����
�)*����X�&����rc��URnURR5(a#U(d[URS5UlO-U(a&SUlUR5 SURS'UR
5 g)Nrzrrr~)�
globalsviewerr�r�r�r�r[r�)r�gvs  rr��Debugger.show_globalstse��
�
�
���=�=������%4�T�]�]�I�%N��"���%)��"����
�*+��
�
�h�'����rc��URnURnURnU(dS=pVO,URnURnU(a
U(aXVLaSnU(a0URXQURRR5 U(a1URXaURRR5 ggr
)	r�r�r�f_locals�	f_globals�	load_dictrD�interp�rpcclt)r�forcer�r�r�ldict�gdicts       rr��Debugger.show_variables�s���
�
�
��
�
�
���
�
��� � �E�E��N�N�E��O�O�E��b�U�^���
��L�L��t�|�|�':�':�'A�'A�B�
��L�L��t�|�|�':�':�'A�'A�B�rc�:�URRX5 g)zjSet a filename-lineno breakpoint in the debugger.

Called from self.load_breakpoints and EW.setbreakpoint
N)rE�	set_break�rr>r?s   r�set_breakpoint�Debugger.set_breakpoint�s��
	
�����8�,rc�:�URRX5 gr
)rE�clear_breakrs   r�clear_breakpoint�Debugger.clear_breakpoint�s�������X�.rc�:�URRU5 gr
)rE�clear_all_file_breaks)rr>s  r�clear_file_breaks�Debugger.clear_file_breaks�s�����&�&�x�0rc���URRRH>nURRnUR
HnUR
X#5 M M@ g![a MPf=f)z>Load PyShellEditorWindow breakpoints into subprocess debugger.N)rDr��inversedict�ior>�breakpointsrr�)r�editwinr>r?s    r�load_breakpoints�Debugger.load_breakpoints�sb���|�|�)�)�5�5�G��z�z�*�*�H�
�%�1�1�F��'�'��9�2�6��
"�
��
�s�$A$�$
A2�1A2)r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�r�rErGr�rHrDrRrZr�rXr
)r)$r$r%r&r'r(r�r�r�r�rZr�r�rrMr[rFrr�r�r�r�r�r�rVrQr�r�r�r�r�r�rrrrr)�rrrArAUs����
�F��G��G��H��K��L��M��$'%�R�$J �X0�d6� ������9�&�$��
�
�C� -�/�1�rrAc�R�\rSrSrSrSrSSjrSrSrSr	S	r
S
rSrSr
S
rg)r�i�z#Code stack viewer for debugger GUI.c��[R"5(a[R"X5 O[R"XSS9 X lX0l/Ulg)N�P)�width)r�isAquaTkrrr�rr�)r�masterr�rs    rr�StackViewer.__init__�s@���?�?���
�!�!�$�/��!�!�$�b�9��
�����
rNc��XlUR5 [[U55H�nXupEURSnUR
nURnURn	SSKn
U
RX�5nUR5nU	S;aSXeU4-nOSXiX[4-nX2:XaSU-nURU5 M� UbURU5 gg! SnN�=f)Nr$r6r)r6r�Nz%s, line %d: %sz%s.%s(), line %d: %sz> )
r��clear�range�lenr�r.r/r<�	linecache�getline�stripr��select)
rr��indexr�rr?�modnamer=r>�funcnamer%�
sourceline�items
             rr��StackViewer.load_stack�s����
��
�
���s�5�z�"�A�!�H�M�E�
��/�/�*�5���<�<�D��'�'�H��|�|�H��"�*�*�8�<�J�#�)�)�+�J��?�*�(�G�Z�+H�H��-��17�1E�E���z��d�{���K�K���'#�(���K�K�����!
���s�C�Cc�R�UR(a[R"X5$g��Override base method.N)r�r�popup_eventr^s  rr2�StackViewer.popup_event�s���:�:��+�+�D�8�8�rc��URnURSURS9 URSURS9 g)r1zGo to source line)�labelrhzShow stack frameN)�menu�add_command�goto_source_line�show_stack_frame)rr6s  r�	fill_menu�StackViewer.fill_menu�sI���y�y�����2�!%�!6�!6�	�	8����1�!%�!6�!6�	�	8rc��SUs=::a[UR5:a,O gURRURU5 gg)r1rN)r$r�rr��rr)s  r�	on_select�StackViewer.on_select�s7����'��D�J�J��'��H�H����
�
�5� 1�2�(rc�&�URU5 gr0)r�r=s  r�	on_double�StackViewer.on_double�s������rc�\�URRS5nURU5 g)N�active)�listboxr)r�r=s  rr8�StackViewer.goto_source_line�s$�����"�"�8�,������rc���URRS5nSUs=::a[UR5:a,O gURRURU5 gg)NrDr)rEr)r$r�rr�r=s  rr9�StackViewer.show_stack_frame�sK�����"�"�8�,����'��D�J�J��'��H�H����
�
�5� 1�2�(rc�P�SUs=::a[UR5:dg gURUup#URnURn[R
R
U5(a5URRU5nU(aURU5 gggr�)
r$r�r.r/r9r:�isfiler��open�gotoline)rr)rr?r=r>�edits       rr��StackViewer.show_source�s����U�,�S����_�,��-���
�
�5�)�
���|�|���#�#��
�7�7�>�>�(�#�#��:�:�?�?�8�,�D���
�
�f�%��$r)r�rr�r
)r$r%r&r'r(rr�r2r:r>rAr8r9r�r)rrrr�r��s2��)�
��49�
8�3�
 � �3�
	&rr�c�6�\rSrSrSrS	SjrSrS
SjrSrSr	g)r�i�z/Global/local namespace viewer for debugger GUI.Nc
���SnSnU(aS[U5-nXlX lSSKnUR	5UlSUR
lSUR
l[U5=Ul	nURRSSS9 [XrSS	S
9UlURRSS9 [US
S9=UlnURSSS9 [U[!S[#SU55SSXE4S9=Uln	U	RSSSS9 U	R&US'UR(U	S'[U	5=Uln
U	R-SSU
SS9UlUR1U5 g)Nr�(��<rrrr���groove)rg�borderwidth�reliefr{)r|�vbar)�name�right�y)rqr|�,)r~�scrollregionrp)rqr|r�rh�yscrollcommand�nw)�windowre)r$r�title�reprlib�Repr�repr�	maxstring�maxotherrrr�r�r5rrX�Canvas�min�max�canvas�yviewr��subframe�
create_window�sfidr�)rrra�odictrr~rbrrXrjrls           rr�NamespaceViewer.__init__�sO���������E�
�]�F����
���L�L�N��	� ��	�	����	�	��"�6�]�*��
�U��
�
���q�v��.��5�!�H�M��
��
�
���S��!�$�U��8�8��	�D��	�	�w�S�	�)�%�e�-0��c�"�f�o�-F�45�q�%�3H� J�	J���f�	����f�Q��7� �,�,��Y��#'�8�8��� �#(��=�0��
���(�(��A�h�t�(�L��	����u�rr�c�h�XRLaU(dgURnURn[URR55HnUR
5 M SUlU(d[USS9nURSSS9 O�UR5n[U5n	Sn
U	H{nXnURRU5n
U(aU
SSn
[XKS9nURU
SSS9 [USSS	9nURSU
5 URU
SSS9 U
S-n
M} XlUR5 UR5nUR!5nUR"nSSX�4UR"S
'US:�aSUS'UR%SS
9 gUUS'UR%SS
9 g)N�Noner�rrurrr�r_)rvrw�sticky)rrVr]r\r~)r�)�
prev_odictrlr�list�children�valuesr]r�r��keys�sortedrd�Entry�insert�update_idletasks�winfo_reqwidth�winfo_reqheightrjr�)rror�
rpc_clientrlr�c�l�	keys_list�namesrvrYr��svaluerr~rjs                 rr��NamespaceViewer.load_dicts����O�O�#�E���=�=���
�
���h�'�'�.�.�0�1�A�
�I�I�K�2������h�V�,�A�
�F�F�q��F�#��
�
��I��9�%�E��C������������.���#�A�b�\�F��(�.�����3�q���6��(�!��;������F�#����3�q���6��!�e��� ���!�!�#��'�'�)���)�)�+������'(�!�U�&;����N�#��C�<�"�F�8���J�J�a�J� �%�F�8���J�J�a�J� rc�8�URR5 gr
)rr]r�s rr[�NamespaceViewer.closeRs���
�
���r)
rjrr5rrtrdrnrlrarXr
)rN)
r$r%r&r'r(rrtr�r[r)rrrr�r��s��5��6�J�4!�lrr��__main__)�mainzidlelib.idle_test.test_debuggerrTF)�	verbosity�exit)r(�bdbr9�tkinter�tkinter.ttkrrr,r�idlelib.scrolledlistr�idlelib.windowr�Bdbr
rrrAr�r�r$�unittestr�rrr�<module>r�s����"�	��(��-�)�7�#�'�'�7�:
(�	�P�P�f
Q&�,�Q&�hW�W�t�z����	*�a�e�D�r