o
    [Zh
                     @   s@   d Z ddlZejeZejejejeZdd ZdS )z?Script injected into the debuggee process during attach-to-PID.    Nc                    s  d }zdd l  d jvrXz? fdd} fdd} fdd}tjtd	d
dd}tj|s1J  jd| dd l}|j	|||d  j
| W n   dd l}|    jdt z#dd l}dd l}ddlm}	m} dd l}
W  jd tks~J  jd= n jd tksJ  jd= w |
 }|d ur|jdd | d d ur|| d  |d|	|  | d dkr|| d  n| d dkr|j| d | d d ntt| W n   dd l}|  |d u r |  Y |d d S )Nr   	threadingc                       t |  jd d S N)fileprintstderrmsgsys Y/var/www/html/lang_env/lib/python3.10/site-packages/debugpy/server/attach_pid_injected.pyon_warn      zattach.<locals>.on_warnc                    r   r   r   r	   r   r   r   on_exception   r   zattach.<locals>.on_exceptionc                    r   r   r   r	   r   r   r   on_critical   r   zattach.<locals>.on_criticaldebugpyZ	_vendoredpydevdZpydevd_attach_to_process)r   r   r   )jsonlogF)waitlog_toz!Configuring injected debugpy: {0}modelistenaddressconnectZadapter_access_token)Zaccess_tokenzdebugpy injected successfully)r   modulesospathjoin_debugpy_direxistsinsertattach_scriptZfix_main_thread_idremove	traceback	print_excr   Zdebugpy.serverZdebugpy.commonr   r   r   Zget_global_debuggerZ#dispose_and_kill_all_pydevd_threadsr   inforeprr   r   AssertionErrorZreraise_exception)setupr   r   r   r   Zpydevd_attach_to_process_pathr$   r&   r   r   r   Zpy_dbr   r   r   attach   sr   




r,   )__doc__r   r   abspath__file__dirnamer!   r,   r   r   r   r   <module>   s
   