Your IP : 216.73.216.213


Current Path : /opt/alt/python35/lib64/python3.5/site-packages/Cython/Debugger/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/site-packages/Cython/Debugger/__pycache__/Cygdb.cpython-35.pyc



���^a�@s�dZddlZddlZddlZddlZddlZddlZddlZddlZej	e
�Zdddd�ZdZ
ddddd	�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�FcCsH|sVtjj|dd�}tj|�}|sVtjdttjj|�f�tj	�\}}tj
|d�}z�|j|�|jtj
d��|r�n�tjj|dd�}t|�}	z|	j�}
Wd|	j�X|jd|
�|jdjd	d
�|D���|jtj
d��Wd|j�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/python35/lib64/python3.5/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]]cCs�tjdt�}|jddddddd�|jdd	dd
dddd
dd�|j�\}}|dkr�t|�dkr�|d
}n	tj}|dkr�|dd�}|dkr�d}tj	}|j
dkr�tj}|j
dkrtj}tj
d|�tjd|j
�tjd||�tjd||�t|d|�}tjd|j||�t|���}tjd||j��tjd|j�tj|jd|g|�}	tjd|j|	j�xSy9tjd|	j�|	j�}
tjd|	j|
�Wntk
r=Yq�XPq�Wtjd |j��WdQRXtjd!|�tj|�tjd"|�dS)#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�dest�gdb�default�helpz$gdb executable to use [default: gdb]z	--verbosez-v�	verbosity�action�countrz8Verbose mode. Multiple -v options increase the verbosityN�z--T��levelzverbosity = %rzoptions = %r; args = %rzIDone parsing command-line options. path_to_debug_info = %r, gdb_argv = %rrz3Launching %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�DEBUGZbasicConfig�logger�info�debugr"r$rr�
subprocess�Popen�pid�wait�KeyboardInterrupt�fileno�remove)rZgdb_argvr�parser�options�argsZ
logging_levelr r�p�retrrr	�main^s\

					
	

rF)�__doc__rrrrrr:r-r3Z	getLogger�__name__r7r"rrFrrrr	�<module>sD