Sindbad~EG File Manager
�
%Μg�Q � � � d Z ddlZddlZddl� ddlmZmZ ddlmZ ddl m
Z
ddlmZ G d� d ej � Zd
� Zd� Z G d� d
� Z G d� de
� Z G d� d� Zedk( rddlmZ eddd�� yy)a� Debug user code with a GUI interface to a subclass of bdb.Bdb.
The Idb idb and Debugger gui instances each need a reference 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 �. � � e Zd ZdZ� fd�Zd� Zd� Z� xZS )�Idbz6Supply user_line and user_exception functions for Bdb.c �0 �� || _ t �| � � y �N)�gui�super�__init__)�selfr
� __class__s ��-/usr/local/lib/python3.12/idlelib/debugger.pyr zIdb.__init__ s �� ����
���� c � � t |� r| j � yt |� } | j j ||� y# t
$ r Y yw xY w)zmHandle 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_linez
Idb.user_line$ sM � �
����M�M�O�� ��'�� ��H�H� � ��%�0��� �� �s �A � A�Ac � � t |� r| j � yt |� }| j j |||� y)z)Handle an the occurrence of an exception.N)r r r r
r )r r �exc_infor s r �user_exceptionzIdb.user_exception2 s6 � �����M�M�O�� ��'�������W�e�X�6r )�__name__�
__module__�__qualname__�__doc__r r r �
__classcell__)r s @r r
r
s �� �<���7r r
c � � | j j j d� ry| j }|�y|j j }d|v rd|v ryt |� S )z)Determine if debugger is within RPC code.zrpc.pyTF�idlelib�debugger)�f_code�co_filename�count�f_backr )r �
prev_frame� prev_names r r r : s_ � ��|�|���%�%�h�/���\�\�
�����%�%�1�1� �� �!�j�I�&=� ��J�'�'r c �� � | j }|j }| j }t j j |� }|� d|� �}|j dk7 r|� d|j � d�}|S )z"Return a message string for frame.�:�?�: z())r( r) �f_lineno�os�path�basename�co_name)r �code�filename�linenor5 r s r r r I sj � ��<�<�D����H�
�^�^�F��w�w����)�H��
�!�F�8�$�G��|�|�s���I�R����~�R�0���Nr c � � e Zd ZdZdZdZdZdZdZdZ dZ
dd�Zd� Zdd�Z
d� Zdd�Zd� Zd � Zd
� Zd� Zd� Zd
� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zdd�Zd� Zd� Zd� Z d� Z!y)�Debuggerz�The debugger interface.
This class handles the drawing of the debugger window and
the interactions with the underlying debugger session.
Nc � � |�t | � }|| _ || _ d| _ | j � d| _ d| _ y)a 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)r r= r>