§
    ,P„j©  ã                   ó|   — d Z ddlZddlZddlZddlZddlZddlZddlZddlZ ej	        e
¦  «        Z	 	 dd„Zd„ ZdS )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Ú Fc                 óJ  — |skt           j                             | dd¦  «        }t          j        |¦  «        }|s4t	          j        dt           j                             | ¦  «        z  ¦  «         t          j        ¦   «         \  }}t          j	        |d¦  «        }	 | 
                    |¦  «         | 
                    t          j        dt          t          ¦  «        z   dz   ¦  «        ¦  «         |r�n|s‹t           j                             | dd¦  «        }	t          |	¦  «        }
	 |
                     ¦   «         }|
                     ¦   «          n# |
                     ¦   «          w xY w| 
                    d|z  ¦  «         | 
                    d	                     d
„ |D ¦   «         ¦  «        ¦  «         |s-| 
                    t          j        d|z   dz   ¦  «        ¦  «         | 
                    d¦  «         |                     ¦   «          n# |                     ¦   «          w xY w|S )NÚcython_debugzcython_debug_info_*z1No cython debug files were found in %s. Aborting.Úwa�              # 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
            try:
                # Activate virtualenv, if we were launched from one
                import os
                import sys
                virtualenv = os.getenv('VIRTUAL_ENV')
                if virtualenv:
                    scripts_dir = 'Scripts' if sys.platform == "win32" else 'bin'
                    path_to_activate_this_py = os.path.join(virtualenv, scripts_dir, '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
            except Exception as ex:
                from traceback import print_exc
                print("There was an error in Python code originating from the file " + z¡)
                print("It used the Python interpreter " + str(sys.executable))
                print_exc()
                exit(1)
            end
            Úinterpreterzfile %s
ú
c              3   ó    K  — | ]	}d |z  V — Œ
dS )zcy import %s
N© )Ú.0Úfns     úZ/root/disk_3tb/conda_envs/Huy-visual/lib/python3.11/site-packages/Cython/Debugger/Cygdb.pyú	<genexpr>z$make_command_file.<locals>.<genexpr>X   s(   è è € ÐJÐJ¸Ð.°Ñ3ÐJÐJÐJÐJÐJÐJó    a%                      python
                    import sys
                    # Check if the Python executable provides a symbol table.
                    if not hasattr(gdb.selected_inferior().progspace, "symbol_file"):
                        sys.stderr.write(
                            "z² was not compiled with debug symbols (or it was "
                            "stripped). Some functionality may not work (properly).\n")
                    end
                zsource .cygdbinit
)ÚosÚpathÚjoinÚglobÚsysÚexitÚabspathÚtempfileÚmkstempÚfdopenÚwriteÚtextwrapÚdedentÚreprÚ__file__ÚopenÚreadÚclose)Úpath_to_debug_infoÚprefix_codeÚ	no_importÚskip_interpreterÚpatternÚdebug_filesÚfdÚtempfilenameÚfr   Úinterpreter_filer   s               r   Úmake_command_filer,      sD  € àð IÝ”'—,’,Ð1Ø-Ø4ñ6ô 6ˆõ ”i Ñ(Ô(ˆàð 	IÝŒHÐHÝ#%¤7§?¢?Ð3EÑ#FÔ#FñHñ Iô Ið Iõ  Ô'Ñ)Ô)Ñ€BˆÝ
Œ	�"�cÑÔ€Að@Ø	�Š�ÑÔÐØ	�Š•”ð ![õ. ^bÕbjÑ]kÔ]kñ/!lð.oñ/!ñ ô ñ 	ô 	ð 	ð< ð 	+ñ à#ð 	3õ ”w—|’|Ð$6¸ÈÑVÔV�Ý#'¨¡:¤:Ð ð-Ø"2×"7Ò"7Ñ"9Ô"9�Kà$×*Ò*Ñ,Ô,Ð,Ð,øÐ$×*Ò*Ñ,Ô,Ð,Ð,øøøØ—’˜ kÑ1Ñ2Ô2Ð2à�GŠG�D—I’IÐJÐJ¸kÐJÑJÔJÑJÔJÑKÔKÐKà#ð 
Ø—’�œð )!ð $/ñ)/ð2ñ	)ñ 	ô 	ñ 	ô 	ð 	ð �GŠGÐ)Ñ*Ô*Ð*à	�Š‰	Œ	ˆ	ˆ	øˆ�Š‰	Œ	ˆ	ˆ	øøøàÐs&   ÂB
H
 Ä%E Ä9H
 ÅE$Å$BH
 È
H c                  ó´  — t          j        dd¬¦  «        } |                      ddd¬¦  «         |                      dd	d
d¬¦  «         |                      dddd¬¦  «         |                      dddddd¬¦  «         |                      ddddd¬¦  «         |                      ¦   «         }|j        }|j        }|d
u }|j        €`|r^t          j                             |d         ¦  «        r9dd
l	}|j        dd
…         }|j        d         }| 
                    d|› d�¦  «         t          j        }|j        dk    rt          j        }|j        d k    rt          j        }t          j        |¬!¦  «         |j        }t$                               d"|¦  «         t)          |||¬#¦  «        }t$                               d$|j        ||¦  «         t/          |¦  «        5 }	t$                               d%| |	j        ¦   «         ¦  «         t$                               d&|j        ¦  «         t3          j        |j        d'|g|z   ¦  «        }
t$                               d(|j        |
j        ¦  «         	 	 t$                               d*|
j        ¦  «         |
                     ¦   «         }t$                               d+|
j        |¦  «         n# t:          $ r Y nw xY wŒht$                               d, |	j        ¦   «         ¦  «         d
d
d
¦  «         n# 1 swxY w Y   t$                               d-|¦  «         t          j        |¦  «         t$                               d.|¦  «         d
S )/z°
    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.
    ÚcygdbzCython debugger)ÚprogÚdescriptionÚgdb_argvÚ*z/Arguments to forward to gdb; specified after --)ÚnargsÚhelpz--build-dirÚ	build_dirNz(Directory containing cython_build/ files)ÚdestÚdefaultr4   z--gdb-executableÚgdbz$gdb executable to use [default: gdb]z	--verbosez-vÚ	verbosityÚcountr   z8Verbose mode. Multiple -v options increase the verbosity)r6   Úactionr7   r4   z--skip-interpreterr%   FÚ
store_truez]Do not automatically point GDB to the same interpreter used to generate debugging information)r6   r7   r;   r4   é   zPUsing deprecated positional parameter to find build directory. Use "--build-dir z" argument instead.é   )Úlevelzoptions = %r)r$   r%   z3Launching %s with command file: %s and gdb_argv: %sz%Command file (%s) contains: """
%s"""zSpawning %s...z-commandzSpawned %s (pid %d)Tz#Waiting for gdb (pid %d) to exit...z3Wait for gdb (pid %d) to exit is done. Returned: %rz%Closing temp command file with fd: %szRemoving temp command file: %szRemoved temp command file: %s) ÚargparseÚArgumentParserÚadd_argumentÚ
parse_argsr5   r1   r   r   ÚisdirÚwarningsÚwarnÚloggingÚWARNr9   ÚINFOÚDEBUGÚbasicConfigr%   ÚloggerÚdebugr,   Úinfor8   r   r    Ú
subprocessÚPopenÚpidÚwaitÚKeyboardInterruptÚfilenoÚremove)ÚparserÚoptionsr"   r1   r$   rE   Úlogging_levelr%   r)   r   ÚpÚrets               r   Úmainr[   m   s
  € õ Ô$ØØ%ðñ ô €Fð ×Ò˜
¨#ØNð ñ Pô Pð Pà
×Ò˜¨KÀØGð ñ Iô Ið Ià
×ÒÐ*Ø˜EØ3ð ñ 5ô 5ð 5ð ×Ò˜ TØ °!ØGð ñ Iô Ið Ið ×ÒÐ,Ø-°uÀ\ðDð ñ Eô Eð Eð
 ×ÒÑ!Ô!€GØ Ô*ÐØÔ€HØ" dÐ*€IàÔÐ  XÐ µ"´'·-²-ÀÈÄÑ2LÔ2LÐ ØˆˆˆØÔ# A B BÔ'ˆØ$Ô-¨aÔ0ÐØ�Šð  QÐi{ð  Qð  Qð  Qñ  	Rô  	Rð  	Rå”L€MØÔ˜AÒÐÝœˆØÔ˜AÒÐÝœˆÝÔ˜mÐ,Ñ,Ô,Ð,àÔ/Ðå
‡L‚L� Ñ)Ô)Ð)Ý$Ð%7Ø/8Ø6FðHñ Hô H€Lõ ‡K‚KÐEØŒ�\ 8ñ-ô -ð -å	ˆlÑ	Ô	ð Q˜xÝ�ŠÐ=¸|È]ÈXÌ]É_Ì_Ñ]Ô]Ð]Ý�ŠÐ$ g¤kÑ2Ô2Ð2ÝÔ˜gœk¨:°|ÐDÀxÑOÑPÔPˆÝ�ŠÐ)¨7¬;¸¼Ñ>Ô>Ð>ð	ðÝ—’ÐBÀAÄEÑJÔJÐJØ—f’f‘h”h�Ý—’ÐRÐTUÔTYÐ[^Ñ_Ô_Ð_ð øõ %ð ð ð Ø�ðøøøð	õ 	�ŠÐ<¸o¸h¼oÑ>OÔ>OÑPÔPÐPðQð Qð Qñ Qô Qð Qð Qð Qð Qð Qð Qøøøð Qð Qð Qð Qõ ‡L‚LÐ1°<Ñ@Ô@Ð@Ý„IˆlÑÔÐÝ
‡L‚LÐ0°,Ñ?Ô?Ð?Ð?Ð?s8   ÇBLÉ(AJ>Ê=LÊ>
KËLË
KË,LÌLÌ
L)r   FF)Ú__doc__r   r   r   r   r   rO   r@   rG   Ú	getLoggerÚ__name__rL   r,   r[   r
   r   r   ú<module>r_      s²   ðð	ð 	ð 
€	€	€	Ø 
€
€
€
Ø €€€Ø €€€Ø €€€Ø Ð Ð Ð Ø €€€Ø €€€à	ˆÔ	˜8Ñ	$Ô	$€ð 79Ø8=ðPð Pð Pð PðfD@ð D@ð D@ð D@ð D@r   