Ë
    Ç[;jZ  ã                   ó~   — 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y)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.
é    Nc                 óØ  — |smt         j                  j                  | dd«      }t        j                  |«      }|s5t	        j
                  dt         j                  j                  | «      z  «       t        j                  «       \  }}t        j                  |d«      }	 |j                  |«       |j                  t        j                  dt        t        «      z   dz   «      «       |rnÇ|sat         j                  j                  | dd«      }	t        |	«      }
	 |
j!                  «       }|
j#                  «        |j                  d|z  «       |j                  d	j                  d
„ D «       «      «       |s*|j                  t        j                  dz   dz   «      «       |j                  d«       |j#                  «        |S # |
j#                  «        w xY w# |j#                  «        w xY w)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  –— Œ y­w)zcy import %s
N© )Ú.0Úfns     ú^G:\00. PROJECTS\API\Inventory\templateJSON\kerjaOCR\Lib\site-packages\Cython/Debugger/Cygdb.pyÚ	<genexpr>z$make_command_file.<locals>.<genexpr>X   s   è ø€ ÐJ¹k¸Ð.°Õ3¹kùs   ‚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*      s´  € áÜ—'‘'—,‘,Ð1Ø-Ø4ó6ˆô —i‘i Ó(ˆáÜ�H‰HÐHÜ#%§7¡7§?¡?Ð3EÓ#FñHô Iô  ×'Ñ'Ó)Ñ€BˆÜ
�	‰	�"�cÓ€Að@Ø	�‰�ÔØ	�‰”—‘ð ![ô. ^bÔbjÓ]kñ/!lð.oñ/!ó ô 	ñ< ð á#ô —w‘w—|‘|Ð$6¸ÈÓV�Ü#'¨£:Ð ð-Ø"2×"7Ñ"7Ó"9�Kà$×*Ñ*Ô,Ø—‘˜ kÑ1Ô2à�G‰G�D—I‘IÑJ¹kÓJÓJÔKá#Ø—‘œŸ™ð )!ð $/ñ)/ð2ñ	)ó 	ô 	ð �G‰GÐ)Ô*à	�‰Œ	àÐøð+ %×*Ñ*Õ,ûð& 	
�‰�	ús&   ÂA9G ÄG Ä(BG ÇGÇG ÇG)c                  óš  — t        j                  dd¬«      } | j                  ddd¬«       | j                  dd	d
d¬«       | j                  dddd¬«       | j                  dddddd¬«       | j                  ddddd¬«       | j                  «       }|j                  }|j
                  }|d
u }|j                  €[|rYt        j                  j                  |d   «      r7dd
l	}|j
                  dd
 }|j
                  d   }|j                  d|› d�«       t        j                  }|j                  dk(  rt        j                  }|j                  d k\  rt        j                  }t        j                   |¬!«       |j"                  }t$        j'                  d"|«       t)        |||¬#«      }t$        j+                  d$|j,                  ||«       t/        |«      5 }	t$        j'                  d%| |	j0                  «       «       t$        j+                  d&|j,                  «       t3        j4                  |j,                  d'|g|z   «      }
t$        j+                  d(|j,                  |
j6                  «       	 	 t$        j'                  d)|
j6                  «       |
j9                  «       }t$        j'                  d*|
j6                  |«       	 t$        j'                  d+ |	j<                  «       «       d
d
d
«       t$        j'                  d,|«       t        j>                  |«       t$        j'                  d-|«       y
# t:        $ r Y nw xY wŒÒ# 1 sw Y   Œ[xY w).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Údefaultr2   z--gdb-executableÚgdbz$gdb executable to use [default: gdb]z	--verbosez-vÚ	verbosityÚcountr   z8Verbose mode. Multiple -v options increase the verbosity)r4   Úactionr5   r2   z--skip-interpreterr#   FÚ
store_truez]Do not automatically point GDB to the same interpreter used to generate debugging information)r4   r5   r9   r2   é   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)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: %szRemoving temp command file: %szRemoved temp command file: %s) ÚargparseÚArgumentParserÚadd_argumentÚ
parse_argsr3   r/   r   r   ÚisdirÚwarningsÚwarnÚloggingÚWARNr7   ÚINFOÚDEBUGÚbasicConfigr#   ÚloggerÚdebugr*   Úinfor6   r   r   Ú
subprocessÚPopenÚpidÚwaitÚKeyboardInterruptÚfilenoÚremove)ÚparserÚoptionsr    r/   r"   rC   Úlogging_levelr#   r'   r   ÚpÚrets               r   ÚmainrY   m   s  € ô ×$Ñ$ØØ%ô€Fð ×Ñ˜
¨#ØNð ô Pà
×Ñ˜¨KÀØGð ô Ià
×ÑÐ*Ø˜EØ3ð ô 5ð ×Ñ˜ TØ °!ØGð ô Ið ×ÑÐ,Ø-°uÀ\ðDð ô Eð
 ×ÑÓ!€GØ ×*Ñ*ÐØ×Ñ€HØ" dÐ*€Ià×ÑÐ ¡X´"·'±'·-±-ÀÈÁÔ2LÛØ×#Ñ# A BÐ'ˆØ$×-Ñ-¨aÑ0ÐØ�‰ÐhÐi{Ðh|ð  }Pð  Qô  	Rä—L‘L€MØ×Ñ˜AÒÜŸ™ˆØ×Ñ˜AÒÜŸ™ˆÜ×Ñ˜mÕ,à×/Ñ/Ðä
‡L�L� Ô)Ü$Ð%7Ø/8Ø6FôH€Lô ‡K�KÐEØ�‰�\ 8ô-ä	ˆlÔ	˜xÜ�‰Ð=¸|È]ÈXÏ]É]Ë_Ô]Ü�‰Ð$ g§k¡kÔ2Ü×Ñ˜gŸk™k¨:°|ÐDÀxÑOÓPˆÜ�‰Ð)¨7¯;©;¸¿¹Ô>ØðÜ—‘ÐBÀAÇEÁEÔJØ—f‘f“h�Ü—‘ÐRÐTU×TYÑTYÐ[^Ô_ð Ü�‰Ð<¸o¸h¿o¹oÓ>OÔP÷ 
ô ‡L�LÐ1°<Ô@Ü‡I�IˆlÔÜ
‡L�LÐ0°,Õ?øô %ò Ùðúð ÷ 
Ð	ús2   ÇBMÉ0AL1Ë&MÌ1	L=Ì:MÌ<L=Ì=MÍM
)Ú FF)Ú__doc__r   r   r   r   r   rM   r>   rE   Ú	getLoggerÚ__name__rJ   r*   rY   r	   ó    r   Ú<module>r_      sL   ðñ	ó 
Û 
Û Û Û Û Û Û à	ˆ×	Ñ	˜8Ó	$€ð 79Ø8=óPófD@r^   