AlkantarClanX12
Current Path : /opt/alt/python39/lib64/python3.9/__pycache__/ |
Current File : //opt/alt/python39/lib64/python3.9/__pycache__/pdb.cpython-39.pyc |
a R�f� � @ s� d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddlZddlZddl Z ddlZddlZG dd� de�Zg d�Zdd� Zdd � Zd d� ZG dd � d e�ZdZG dd� dejej�Ze du�rg d�ZeD ] Ze eede �j �� d 7 Z q�e ej j 7 Z [[d,dd�Z!d-dd�Z"dd� Z#dd� Z$dd�dd�Z%d.dd �Z&d!d"� Z'd#Z(d$d%� Z)d&d'� Z*d(Z+d)d*� Z,e-d+k�r�ddl.Z.e.�,� dS )/a� The Python Debugger Pdb ======================= To use the debugger in its simplest form: >>> import pdb >>> pdb.run('<a statement>') The debugger's prompt is '(Pdb) '. This will stop in the first function call in <a statement>. Alternatively, if a statement terminated with an unhandled exception, you can use pdb's post-mortem facility to inspect the contents of the traceback: >>> <a statement> <exception traceback> >>> import pdb >>> pdb.pm() The commands recognized by the debugger are listed in the next section. Most can be abbreviated as indicated; e.g., h(elp) means that 'help' can be typed as 'h' or 'help' (but not as 'he' or 'hel', nor as 'H' or 'Help' or 'HELP'). Optional arguments are enclosed in square brackets. Alternatives in the command syntax are separated by a vertical bar (|). A blank line repeats the previous command literally, except for 'list', where it lists the next 11 lines. Commands that the debugger doesn't recognize are assumed to be Python statements and are executed in the context of the program being debugged. Python statements can also be prefixed with an exclamation point ('!'). This is a powerful way to inspect the program being debugged; it is even possible to change variables or call functions. When an exception occurs in such a statement, the exception name is printed but the debugger's state is not changed. The debugger supports aliases, which can save typing. And aliases can have parameters (see the alias help entry) which allows one a certain level of adaptability to the context under examination. Multiple commands may be entered on a single line, separated by the pair ';;'. No intelligence is applied to separating the commands; the input is split at the first ';;', even if it is in the middle of a quoted string. If a file ".pdbrc" exists in your home directory or in the current directory, it is read in and executed as if it had been typed at the debugger prompt. This is particularly useful for aliases. If both files exist, the one in the home directory is read first and aliases defined there can be overridden by the local file. This behavior can be disabled by passing the "readrc=False" argument to the Pdb constructor. Aside from aliases, the debugger is not directly programmable; but it is implemented as a class from which you can derive your own debugger class, which you can make as fancy as you like. Debugger commands ================= � Nc @ s e Zd ZdZdS )�RestartzBCauses a debugger to be restarted for the debugged python program.N)�__name__� __module__�__qualname__�__doc__� r r �(/opt/alt/python39/lib64/python3.9/pdb.pyr W s r ) �run�pm�Pdb�runeval�runctx�runcall� set_trace�post_mortem�helpc C s� t �dt �| � �}zt�|�}W n ty6 Y d S 0 |�L t|dd�D ].\}}|�|�rJ| ||f W d � S qJW d � n1 s�0 Y d S )Nzdef\s+%s\s*[(]� )�start)�re�compile�escape�tokenize�open�OSError� enumerate�match)�funcname�filenameZcre�fp�lineno�liner r r � find_function^ s <r! c C sX t �| �\}}t �| �r,| j| ju r,|dfS t �| �r>|dfS t �||d � �|d fS )Nr )�inspectZ findsourceZisframe� f_globals�f_localsZismoduleZgetblock)�obj�linesr r r r �getsourcelinesk s r'