Your IP : 216.73.216.213


Current Path : /opt/alt/python37/lib64/python3.7/site-packages/Cython/Debugger/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/site-packages/Cython/Debugger/__pycache__/Cygdb.cpython-37.pyc

B

��Fda�@sjdZddlZddlZddlZddlZddlZddlZddlZddlZe�	e
�Zd
dd�ZdZ
ddd	�ZdS)a
The Cython debugger

The current directory should contain a directory named 'cython_debug', or a
path to the cython project directory should be given (the parent directory of
cython_debug).

Additional gdb args can be provided only if a path to the project directory is
given.
�N�FcCs�|s<tj�|dd�}t�|�}|s<t�dttj�|�f�t�	�\}}t�
|d�}z�|�|�|�t�
d��|rvnhtj�|dd�}t|�}	z|	��}
Wd|	��X|�d|
�|�d�d	d
�|D���|�t�
d��Wd|��X|S)NZcython_debugzcython_debug_info_*z.%s.
No debug files were found in %s. Aborting.�waV            # This is a gdb command file
            # See https://sourceware.org/gdb/onlinedocs/gdb/Command-Files.html

            set breakpoint pending on
            set print pretty on

            python
            # Activate virtualenv, if we were launched from one
            import os
            virtualenv = os.getenv('VIRTUAL_ENV')
            if virtualenv:
                path_to_activate_this_py = os.path.join(virtualenv, 'bin', 'activate_this.py')
                print("gdb command file: Activating virtualenv: %s; path_to_activate_this_py: %s" % (
                    virtualenv, path_to_activate_this_py))
                with open(path_to_activate_this_py) as f:
                    exec(f.read(), dict(__file__=path_to_activate_this_py))

            from Cython.Debugger import libcython, libpython
            end
            �interpreterzfile %s
�
css|]}d|VqdS)z
cy import %s
N�)�.0�fnrr�H/opt/alt/python37/lib64/python3.7/site-packages/Cython/Debugger/Cygdb.py�	<genexpr>Isz$make_command_file.<locals>.<genexpr>a�                python
                import sys
                try:
                    gdb.lookup_type('PyModuleObject')
                except RuntimeError:
                    sys.stderr.write(
                        'Python was not compiled with debug symbols (or it was '
                        'stripped). Some functionality may not work (properly).\n')
                end

                source .cygdbinit
            )�os�path�join�glob�sys�exit�usage�abspath�tempfile�mkstemp�fdopen�write�textwrap�dedent�open�read�close)�path_to_debug_infoZprefix_code�	no_import�patternZdebug_files�fd�tempfilename�frZinterpreter_filerrrr	�make_command_files6



r"z0Usage: cygdb [options] [PATH [-- GDB_ARGUMENTS]]c	Cs�tjtd�}|jddddd�|jdddd	d
dd�|��\}}|d
krdt|�dkr^|d
}ntj}|d
krx|dd
�}|dkr�d}tj	}|j
dkr�tj}|j
dkr�tj}tj
|d�t�d|j
�t�d||�t�d||�t||d�}t�d|j||�t|���}t�d||���t�d|j�t�|jd|g|�}	t�d|j|	j�xJy*t�d|	j�|	��}
t�d|	j|
�Wntk
�r�YnXP�qRWt�d|���Wd
QRXt�d|�t�|�t�d |�d
S)!ab
    Start the Cython debugger. This tells gdb to import the Cython and Python
    extensions (libcython.py and libpython.py) and it enables gdb's pending
    breakpoints.

    path_to_debug_info is the path to the Cython build directory
    gdb_argv is the list of options to gdb
    no_import tells cygdb whether it should import debug information
    )rz--gdb-executable�gdbz$gdb executable to use [default: gdb])�dest�default�helpz	--verbosez-v�	verbosity�countrz8Verbose mode. Multiple -v options increase the verbosity)r$�actionr%r&N�z--T�)�levelzverbosity = %rzoptions = %r; args = %rzIDone parsing command-line options. path_to_debug_info = %r, gdb_argv = %r)rz3Launching %s with command file: %s and gdb_argv: %sz%Command file (%s) contains: """
%s"""zSpawning %s...z-commandzSpawned %s (pid %d)z#Waiting for gdb (pid %d) to exit...z3Wait for gdb (pid %d) to exit is done. Returned: %rz%Closing temp command file with fd: %szRemoving temp command file: %szRemoved temp command file: %s)�optparse�OptionParserr�
add_option�
parse_args�lenr�curdir�logging�WARNr'�INFO�DEBUG�basicConfig�logger�info�debugr"r#rr�
subprocess�Popen�pid�wait�KeyboardInterrupt�fileno�remove)rZgdb_argvr�parser�options�argsZ
logging_levelr r�p�retrrr	�main^s\





rG)rF)NNF)�__doc__rrrrrr;r-r3�	getLogger�__name__r8r"rrGrrrr	�<module>s

D