
    Mh^                       d Z ddlZej        dd         dk     r ed          ddlZej                            ej                            e                    Z	ej        
                    de	           ddlZddlmZ ddlmZmZ ddlmZ ddlZddlZddlZdd	lmZ dd
lmZ ddlm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"m#Z# ddlm$Z$m%Z% ddl&m'Z' ddl(m)Z) ddl*m+Z+ ddl,m-Z-m.Z.m/Z/m0Z0 ddlm1Z1m2Z2 ddl3m4Z4m5Z5 ddlm6Z6m7Z7m8Z8 ddlm9Z9 ddlm:Z: ddl;m<Z< ddl=m>Z>m?Z? ddl@mAZAmBZB ddlCmDZDmEZEmFZFmGZGmHZHmIZImJZJmKZKmLZLmMZMmNZNmOZOmPZPmQZQ ddlRmSZSmTZTmUZUmVZVmWZWmXZXmYZYmZZZm[Z[m\Z\m]Z]m^Z^m_Z_m`Z`maZambZbmcZcmdZdmeZemfZfmgZgmhZhmiZimjZjmkZk ddllmmZm ddlnmoZompZp ddl"mqZqmrZrmsZsmtZt ddlumvZv dd lwmxZxmyZymzZz dd!l{m|Z| dd"l}m~ZmZmZmZmZ dd#lmZmZmZ dd$lmZmZmZ ddlZdd%lmZ dd&lmZmZmZmZ dd'lmZ dd(l!mZmZmZ dd)l!mZmZ dd*lmZ ddlZdd+lmZmZmZmZ dd,lmZmZmZmZmZmZmZmZmZmZmZmZ dd-lmZmZ dd.lmZ dd/lmZ dd0lmZmZ dd1l@mZ dd2lmZmZmZ dd3lmZ dd4lmZ dd5lmZ dd6lmZ dd7lmZmZ ekrdd8lmZ dZehr.	 dd9lmZ  ej                     n#   e%j        d:           Y nxY wecrdd;lRmZ d<Zg ZeD ] ZeР                     eeѦ                     !d=                    eЦ          Zdd>Z e֦             dd?lmZ e-j        Ze-j        Z	 d@                    dA           n#  Y nxY wdBadBa e'            Zi Z e%j        dCejh                    e%j        dDej                    e%j        dEej                            e                      e%j        dFeji                   eji        r e%j        dGejj                   dHZdIZ G dJ dKe          Z G dL dMe          Z G dN dOe          Z G dP dQe          Z G dR dSe          Z G dT dUe          Z G dV dWe          ZdX ZdY ZdZ Zd[ Zdd\Zdd]Zd^ Zd_ Z	 	 	 	 	 ddaZddbZdc Z	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddfZ ee            Zdg Zdh Z G di dje          Z G dk dle          ZdmZdZ eadn ZddoZedp             Zdq Z G dr ds          Zdt Zeddu             ZddvZ	 e1j
        ev          D ]Ze                    eլw           ddyedzdfd{Zd| Zdd~Zd Z	 ej        ddm         e	gk    rej                            e	           n# e$ r Y nw xY wedk    r e             dS dS )zF
Entry point module (keep at root):

This module starts the debugger.
    N   )      zThe PyDev.Debugger requires Python 3.6 onwards to be run. If you need to use an older Python version, use an older version of the debugger.)pydevd_constants)OptionalTuple)	FrameType)defaultdict)contextmanager)partial)LIB_FILES_IN_DONT_TRACE_DIRS)pydev_imports	pydev_log)getfilesystemencoding)is_thread_alive)	overrides)	threadingtimethreadThreadingEvent)pydevd_extension_utilspydevd_frame_utils)FilesFilteringglob_matches_path)	pydevd_iopydevd_vm_typepydevd_defaults)pydevd_utils)pydevd_runpy)DebugConsoleStdIn)set_additional_thread_inforemove_additional_info)ExceptionBreakpointget_exception_breakpoint)CMD_THREAD_SUSPENDCMD_STEP_INTOCMD_SET_BREAKCMD_STEP_INTO_MY_CODECMD_STEP_OVERCMD_SMART_STEP_INTOCMD_RUN_TO_LINECMD_SET_NEXT_STATEMENTCMD_STEP_RETURNCMD_ADD_EXCEPTION_BREAKCMD_STEP_RETURN_MY_CODECMD_STEP_OVER_MY_CODEconstant_to_strCMD_STEP_INTO_COROUTINE)get_thread_idget_current_thread_idDebugInfoHolderPYTHON_SUSPENDSTATE_SUSPEND	STATE_RUN	get_frameclear_cached_thread_idINTERACTIVE_MODE_AVAILABLESHOW_DEBUG_INFO_ENVNULL	NO_FTRACEIS_IRONPYTHONJSON_PROTOCOL
IS_CPYTHONHTTP_JSON_PROTOCOL!USE_CUSTOM_SYS_CURRENT_FRAMES_MAPcall_only_onceForkSafeLockIGNORE_BASENAMES_STARTING_WITHEXCEPTION_TYPE_UNHANDLEDSUPPORT_GEVENT#PYDEVD_IPYTHON_COMPATIBLE_DEBUGGINGPYDEVD_IPYTHON_CONTEXTPYDEVD_USE_SYS_MONITORING)PydevdCustomization)CustomFramesContainercustom_frames_container_init)
DONT_TRACE
PYDEV_FILELIB_FILEDONT_TRACE_DIRS)DebuggerEventHandler)add_exception_to_frameremove_exception_from_frameshort_stack)NetCommandFactory)trace_dispatchglobal_cache_skipsglobal_cache_frame_skips&fix_top_level_trace_and_get_trace_funcUSING_CYTHON)save_main_moduleis_current_thread_main_threadimport_attr_from_module)frame_eval_funcdummy_trace_dispatchUSING_FRAME_EVAL)SourceMapping)ThreadingLoggerAsyncioLoggersend_concurrency_messagecur_time)wrap_threads)*get_abs_path_real_path_and_base_from_frame)get_abs_path_real_path_and_base_from_fileNORM_PATHS_AND_BASE_CONTAINER)get_fullnameget_package_dir)abspath)InternalThreadCommand!InternalThreadCommandForAnyThreadcreate_server_socketFSNotifyThread)InternalConsoleExec_queueReaderThreadGetGlobalDebuggerget_global_debuggerset_global_debuggerWriterThreadstart_clientstart_serverInternalGetBreakpointExceptionInternalSendCurrExceptionTrace'InternalSendCurrExceptionTraceProceeded)PyDBDaemonThreadmark_as_pydevd_daemon_thread)PyDevJsonCommandProcessor)process_net_command)
NetCommandNULL_NET_COMMAND)stop_on_unhandled_exception)collect_try_except_infocollect_return_info#collect_try_except_info_from_source)SuspendedFramesManager)	SHUT_RDWR)	PyDevdAPI)TimeoutTracker)suspend_all_threadsmark_thread_suspended)pydevd_sys_monitoring)pydevd_gevent_integrationzpydevd: GEVENT_SUPPORT is set but gevent is not available in the environment.
Please unset GEVENT_SUPPORT from the environment variables or install gevent.)constructed_tid_to_last_frame)r   r   r   .c                        fd t           j        dd         dk    r t           _        d S t           j        d         dk    rdd l}ndd l} |_         t           _        d S )Nc                      t          j        d          }|Kt          |          dk    r8t          t          d          r#t          j        k    rt	          j        | i | d S t          | i | d S )NPYTHONBREAKPOINTr   __breakpointhook__)osgetenvlenhasattrsysr   settrace)argskwargshooknamepydevd_breakpointhooks      _/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/debugpy/_vendored/pydevd/pydevd.pyr   z5install_breakpointhook.<locals>.pydevd_breakpointhook   s    y!344H$MMA%%C!566 &*.CCC&777777$)&)))))    r   r   )r      r   )r   version_infobreakpointhookbuiltins__builtin__
breakpointr   )r   r   s   ` r   install_breakpointhookr      s    $
	* 
	* 
	* 
	* 
	* !&& 3A!##***** "7!6r   )PluginManagerdummyzutf-8FzUsing GEVENT_SUPPORT: %sz&Using GEVENT_SHOW_PAUSED_GREENLETS: %szpydevd __file__: %sz-Using PYDEVD_IPYTHON_COMPATIBLE_DEBUGGING: %szPYDEVD_IPYTHON_CONTEXT: %sg?g{Gz?c                   x    e Zd Zd Z eej                  d             Z eej                  d             ZdS )PyDBCommandThreadc                 V    t          j        | |           |j        | _        d| _        d S )Nzpydevd.CommandThread)r   __init___py_db_command_thread_eventnameselfpy_dbs     r   r   zPyDBCommandThread.__init__  s+    !$...+0+L(*			r   c                    | j                             t                     | j        rd S 	 | j        sx	 | j                            d           n#  t          j        d           Y nxY w| j                                          | j                             t                     | j        vd S d S #  	 t          j	        t          j                    d                    Y d S #  Y Y d S xY wxY w)N*z#Finishing debug communication...(2)r   )r   waitTIMEOUT_SLOW_kill_receivedr   process_internal_commandsr   infocleardebugr   exc_infor   s    r   _on_runzPyDBCommandThread._on_run  s    	(--l;;; 	F	) DJJ88@@@@JN#HIIIII066888055lCCC ) D D D D D	q 1222222 s;   B+ A B+ A%#AB+ +C%.+CC"C%"C%c                 `    t          j        |            | j                                         d S N)r   do_kill_pydev_threadr   setr   s    r   r   z&PyDBCommandThread.do_kill_pydev_thread#  s.    -d333(,,.....r   N)__name__
__module____qualname__r   r   r   r   r    r   r   r   r     sw        + + +
 Y'((  )(4 Y455/ / 65/ / /r   r   c                       e Zd Zd Z eej                  d             ZddZ eej                  d             ZdS )CheckAliveThreadc                 r    t          j        | |           d| _        d| _        t	                      | _        d S )Nzpydevd.CheckAliveThreadF)r   r   r   daemonr   _wait_eventr   s     r   r   zCheckAliveThread.__init__0  s7    !$...-	)++r   c                 X   | j         fd}	 | j        sE| j                            t                      |            rn                                 | j        E |            r*t          j        d                                            d S d S #  t          j	                     Y d S xY w)Nc                      j         5  j        } | d uo|                                 }d d d            n# 1 swxY w Y                                    o|S r   )
_main_lockwriteremptyhas_user_threads_alive)r   writer_emptyr   s     r   can_exitz*CheckAliveThread._on_run.<locals>.can_exit:  s    ! E E %T1Dfllnn	E E E E E E E E E E E E E E E 33555F,Fs    599z)No threads alive, finishing debug session)
r   r   r   r   r   check_output_redirectr   r   #dispose_and_kill_all_pydevd_threads	exception)r   r   r   s     @r   r   zCheckAliveThread._on_run6  s    
	G 	G 	G 	G 	G	") . %%l3338:: ++--- ) . xzz < KLLL99;;;;;< <	"!!!!!!s   A>B B)Nc                 Z    |                                   t          j        | |           d S )Ntimeout)r   r   join)r   r   s     r   r   zCheckAliveThread.joinQ  s2     	!!###dG444444r   c                 `    t          j        |            | j                                         d S r   )r   r   r   r   r   s    r   r   z%CheckAliveThread.do_kill_pydev_threadW  s.    -d333r   r   )	r   r   r   r   r   r   r   r   r   r   r   r   r   r   .  s        , , , Y'((" " )("45 5 5 5 Y455  65  r   r   c                   d    e Zd ZdZg dZdZd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zed             ZdS )"AbstractSingleNotificationBehaviora  
    The basic usage should be:

    # Increment the request time for the suspend.
    single_notification_behavior.increment_suspend_time()

    # Notify that this is a pause request (when a pause, not a breakpoint).
    single_notification_behavior.on_pause()

    # Mark threads to be suspended.
    set_suspend(...)

    # On do_wait_suspend, use notify_thread_suspended:
    def do_wait_suspend(...):
        with single_notification_behavior.notify_thread_suspended(thread_id, thread, reason):
            ...
    )_last_resume_notification_time_last_suspend_notification_time_lock_next_request_time_suspend_time_request_suspended_thread_id_to_thread_pause_requested_py_db      ?c                 (   t          j        |          | _        t          t          t          j                              | _        d| _        d| _	        |                                 | _
        t          j                    | _        i | _        d| _        d S )NF)weakrefrefr   r   next	itertoolscountr   r   r   r   r   allocate_lockr   r   r   r   s     r   r   z+AbstractSingleNotificationBehavior.__init__~  sw    k%((")$	0A0A"B"B/1,.0+%)%<%<%>%>")++
.0+ %r   c                      t          d          Nz#abstract: subclasses must override.AssertionErrorr   	thread_idr   stop_reasons       r   send_suspend_notificationz<AbstractSingleNotificationBehavior.send_suspend_notification      BCCCr   c                      t          d          r   r   r   r   s     r   send_resume_notificationz;AbstractSingleNotificationBehavior.send_resume_notification  r   r   c                 x    | j         5  |                                 | _        d d d            d S # 1 swxY w Y   d S r   )r   r   r   r   s    r   increment_suspend_timez9AbstractSingleNotificationBehavior.increment_suspend_time  s    Z 	C 	C)-)@)@)B)BD&	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	Cs   /33c                     | j         5  d| _        | j        }d d d            n# 1 swxY w Y   |                                 }|+|j                            | j        | j        d|i           d S d S )NTglobal_suspend_time)r   )r   r   r   r   timeout_trackercall_on_timeoutNOTIFY_OF_PAUSE_TIMEOUT_notify_after_timeout)r   r  r   s      r   on_pausez+AbstractSingleNotificationBehavior.on_pause  s     Z 	= 	=$(D!"&"<	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= !11,d.HRgi|Q} 2      s   #''c                 D   | j         5  | j        rx|| j        k    rm|| _        t          j        d           t          t          | j                                                            \  }}|                     ||t                     d d d            d S # 1 swxY w Y   d S )Nz+Sending suspend notification after timeout.)
r   r   r   r   r   r   iteritemsr   r%   )r   r  r   r   s       r   r  z8AbstractSingleNotificationBehavior._notify_after_timeout  s    Z 	Z 	Z2 Z&)MMM;ND8N#PQQQ(,T$2U2[2[2]2]-^-^(_(_%Iv229fFXYYY	Z 	Z 	Z 	Z 	Z 	Z 	Z 	Z 	Z 	Z 	Z 	Z 	Z 	Z 	Z 	Z 	Z 	Zs   B BBBc                    | j         5  | j        }|rd| _        || j        |<   |t          k    s|ri| j        | j        k    r8t          j        d           | j        | _        |                     |||           n5t          j        d| j        | j	                   nt          j        d           d d d            d S # 1 swxY w Y   d S )NFzSending suspend notification.zHSuspend not sent (it was already sent). Last suspend % <= Last resume %szSSuspend not sent because stop reason is thread suspend and pause was not requested.)
r   r   r   r%   r   r   r   r   r   r   )r   r   r   r   pause_requesteds        r   on_thread_suspendz4AbstractSingleNotificationBehavior.on_thread_suspend  s/   Z 	 	"3O .(-%=CD/	: 000O0-0TTTN#BCCC;?;UD8229fkRRRRNb<;    i  -	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   B%B::B>B>c                 F   | j         5  | j                            |           | j        | j        k     r6t          j        d           | j        | _        |                     |           n t          j        d| j        | j                   d d d            d S # 1 swxY w Y   d S )NzSending resume notification.zHResume not sent (it was already sent). Last resume %s >= Last suspend %s)r   r   popr   r   r   r   r   )r   r   r   s      r   on_thread_resumez3AbstractSingleNotificationBehavior.on_thread_resume  s    Z 	 	/33I>>>2T5YYY=>>>6:6Z3--i8888^78  	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   BBBBc              #      K   |                      |||           	 d V  |                     ||           d S # |                     ||           w xY wr   )r  r  r   s       r   notify_thread_suspendedz:AbstractSingleNotificationBehavior.notify_thread_suspended  sd      y&+>>>	5EEE!!)V44444D!!)V4444s	   7 AN)r   r   r   __doc__	__slots__r  r   r   r   r   r  r  r  r  r   r  r   r   r   r   r   ^  s         $	 	 	I "& & &D D DD D DC C C
 
 
Z Z Z  6   5 5 ^5 5 5r   r   c                       e Zd Zej        g dz   Zd Zd Z eej                  d             Z eej	                  d             Z	 eej
                  ed                         Z
dS )"ThreadsSuspendedSingleNotification)!multi_threads_single_notification
_callbacks_callbacks_lockc                     t                               | |           d| _        t          j                    | _        g | _        d S NF)r   r   r  r   Lockr  r  r   s     r   r   z+ThreadsSuspendedSingleNotification.__init__  s;    *33D%@@@16.(~//r   c                 z    | j         5  | j                            |           d d d            d S # 1 swxY w Y   d S r   )r  r  append)r   callbacks     r   add_on_resumed_callbackz:ThreadsSuspendedSingleNotification.add_on_resumed_callback  s    ! 	- 	-O""8,,,	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	-s   044c                    |                                  }|n|j                            |j                            |                     | j        5  | j        }g | _        d d d            n# 1 swxY w Y   |D ]} |             d S d S r   )r   r   add_commandcmd_factory&make_thread_resume_single_notificationr  r  )r   r   r   	callbacksr  s        r   r   z;ThreadsSuspendedSingleNotification.send_resume_notification  s    L$$U%6%]%]^g%h%hiii% % % O	"$% % % % % % % % % % % % % % % &  



  s   A++A/2A/c                     |                                  }|7|j                            |j                            ||||                     d S d S r   )r   r   r!  r"  'make_thread_suspend_single_notification)r   r   r   r   r   s        r   r   z<ThreadsSuspendedSingleNotification.send_suspend_notification  sm    L$$U%6%^%^_dfoqw  zE  &F  &F  G  G  G  G  G r   c              #      K   | j         rPt          j        d           t                              | |||          5  d V  d d d            d S # 1 swxY w Y   d S t          j        d           d V  d S )Nz(Thread suspend mode: single notificationz,Thread suspend mode: NOT single notification)r  r   r   r   r  r   s       r   r  z:ThreadsSuspendedSingleNotification.notify_thread_suspended  s       1 	NEFFF3KKDR[]cepqq                    NIJJJEEEEEs   AAAN)r   r   r   r   r  r   r  r   r   r   r  r   r   r   r   r  r    s        2<  @F  @F  @F  FI  - - - Y1JKK
 
 LK
 Y1KLLG G MLG
 Y1IJJ  ^ KJ  r   r  c                   .    e Zd Zg dZd Zd Zd Zd ZdS )_Authenticationaccess_tokenclient_access_token_authenticated_wrong_attemptsc                 >    d | _         d | _        d | _        d| _        d S Nr   r*  r   s    r   r   z_Authentication.__init__  s,     !
 $( " r   c                 0    | j         	| j        d u S | j         S r   )r-  r+  r   s    r   is_authenticatedz _Authentication.is_authenticated  s"    &$,,""r   c                     | j         dk    rd S || j        k    | _        | j        s| xj         dz  c_         d S d| _         d S )N
      r   )r.  r+  r-  )r   r+  s     r   loginz_Authentication.login  sX    2%%F*d.??" 	%  A%    #$D   r   c                 "    d | _         d| _        d S r0  )r-  r.  r   s    r   logoutz_Authentication.logout)  s    " r   N)r   r   r   r  r   r2  r6  r8  r   r   r   r)  r)    s[        \\\I! ! !# # #
% % %! ! ! ! !r   r)  c            	          e Zd ZdZ e            ZdgdZd Zd Zd Z	d Z
d Zd	 Zd
 Zd Zd Zd ZdhdZd Zd Zd Zd Zd ZdefdZd ZefdZd ZdidZd ZdjdZdjdZe d             Z!e!j"        d             Z!e d              Z#d! Z$dhd"Z%d# Z&d$ Z'd% Z(d& Z)d' Z*d( Z+d) Z,d* Z-d+ Z.d, Z/d- Z0d. Z1dgd/Z2d0 Z3d1 Z4d2 Z5d3 Z6e d4             Z7d5 Z8 G d6 d7e9          Z:d8e;e<j=        e>f         fd9Z?d: Z@d; ZAd< ZBd= ZCd> ZDd? ZEd@ ZFdA ZGdgdBZHdgdCZIdD ZJdhdEeKeL         fdFZMdG ZN	 djdHZO	 	 	 	 dkdJePdKeQdLePdMeQfdNZRdO ZSdP ZTdQ ZUdR ZVdS ZWdT ZXdU ZYdV ZZdhdWZ[dX Z\dY Z]dZeKeP         fd[Z^d\ Z_d] Z`d^ Zad_ ZbdldaZcdb Zddc ZedmddZfde Zgdf ZhdS )nPyDBa7  Main debugging class
    Lots of stuff going on here:

    PyDB starts two threads on startup that connect to remote debugger (RDB)
    The threads continuously read & write commands to RDB.
    PyDB communicates with these threads through command queues.
       Every RDB command is processed by calling process_net_command.
       Every PyDB net command is sent to the net by posting NetCommand to WriterThread queue

       Some commands need to be executed on the right thread (suspend/resume & friends)
       These are placed on the internal command queue.
    Tc                 \    |rt          j                     t                       _        d  _        d  _        d  _        i  _        d  _        t                       _
        d  _        d  _        d  _        t                       _        t!          t"          j                   _        t!          t                     _        t+                       _        t/                       _        t3                      _        t7           j                   _        d _        d _        d _         i  _!        i  _"        i  _#        tI                      %                     dtL          j'                   tI          j(                     _)        d _*        i  _+        i  _,        i  _-        i  _.        i  _/        d _0        tc          j2                     _3        tc          j2                     _4        tc          j2                     _5        t                       _6        |r j6        tn          _6        d _8        d _9        tc          j2                     _:        t                       _;        d _<        tc          j2                     _=        d  _>        t           j?         _?        d _@        d _A        d _B        d _C        d _D        d _E        d _F        d _G        i  _H        d _I        d _J        i  _K        d  _L        d _M        d _N        d  _O        d  _P        d _Q        d _R        d _S        d  _T        d _U        i  _V        i  _W        d _X         j        Y                                 _Z         j        [                                 _\         jZ        p j\         _]        d _^        d __        d _`        d _a        d _b        t                      _d        d _e        t          jg                     _h        d  _i        t                       _j        d  _k        t          r fd}| _m        nt          t                      _m        t           _p        t           _q        t           _r        	 t          js         _t        t          ju         _v        n@#  	 t          jw         _t        t          ju         _v        n#  d  _t        d  _v        Y nxY wY nxY wt          jx         _y        t           _z        t           _{        t           _|        t           _}        t          j         _        t          j         _        t           _        t           _        i  _        i  _        i  _        t                       _        g  _        |rt                      t          j                    t          j        t                      d S )N)on_source_mapping_changedTFr   r   
matplotlibc                 (    t          | ||          S r   )_trace_dispatch)frameeventargr   s      r   new_trace_dispatchz)PyDB.__init__.<locals>.new_trace_dispatch  s    &tUE3???r   )pydevd_tracingreplace_sys_set_trace_funcr)  authenticationreaderr   _fsnotify_threadcreated_pydb_daemon_threads_waiting_for_connection_threadr   _on_configuration_done_eventcheck_alive_threadpy_db_command_threadquittingrW   r"  r
   rt   Queue
_cmd_queue_thread_eventsr   suspended_frames_managerr   _files_filteringr   r  rc   _clear_cachessource_mappingterminate_child_processesterminate_keyboard_interruptkeyboard_interrupt_requestedapi_received_breakpointsbreakpoints&function_breakpoint_name_to_breakpointr   set_protocolrL   DEFAULT_PROTOCOLVariablePresentationvariable_presentationmtimefile_to_id_to_line_breakpointfile_to_id_to_plugin_breakpointbreak_on_uncaught_exceptionsbreak_on_caught_exceptions!break_on_user_uncaught_exceptionsready_to_runr   r   r   _lock_running_thread_ids_lock_create_fs_notifyr   rM   pydb_disposed"_wait_for_threads_to_finish_called'_wait_for_threads_to_finish_called_lock(_wait_for_threads_to_finish_called_eventterminate_requested_disposed_locksignature_factorySetTrace)skip_on_exceptions_thrown_in_same_context7ignore_exceptions_thrown_in_lines_with_ignore_exception$skip_suspend_on_breakpoint_exceptionskip_print_breakpoint_exceptiondisable_property_tracedisable_property_getter_tracedisable_property_setter_tracedisable_property_deleter_trace_running_thread_ids_enable_thread_notifications_set_breakpoints_with_id.filename_to_lines_where_exceptions_are_ignoredpluginhas_plugin_line_breakshas_plugin_exception_breaksthread_analyserasyncio_analyser_gui_event_loop_installed_gui_support
gui_in_useactivate_gui_functionmpl_hooks_in_debug_consolempl_modules_for_patching_filename_to_not_in_scopefirst_breakpoint_reacheduse_exclude_filters_exclude_filters_enableduse_libraries_filter_is_libraries_filter_enabledis_files_filter_enabledshow_return_valuesremove_return_values_flagredirect_outputis_output_redirecteduse_frame_evalr  &_threads_suspended_single_notificationstepping_resumes_all_threadsr   local_local_thread_trace_func_client_socket_server_socket_ready_event_server_socket_namer?   rX   r   r?  r[   r`   ra   	get_identthreading_get_ident_activethreading_active
_get_identcurrentThreadthreading_current_threadr!   r   r   r$   rO   get_dont_trace_get_file_typerR   _dont_trace_dirs_get_file_typerP   rQ   _in_project_scope_cache_exclude_by_filter_cache_apply_filter_cacher   _ignore_system_exit_codes_dap_messages_listenersrx   r   on_pydb_initatexitregister	stoptrace)r   set_as_globalrC  s   `  r   r   zPyDB.__init__@  sL    	85777-// $+-(.2+,:,<,<)"&$(!,..%fl33).99(>(@(@% . 0 0-d33
 ,dFXYYY *.& -2) -2) )+% 683 	  q*=*NOOO%.%C%E%E" 
-/*/1, -/)*,'13.! .00(.(<(>(>%&,&:&<&<#+9+;+;( 	a@D@`!="27/7=7K7M7M48F8H8H5#( $244!%&/9>6GKD 571/1, ',#-2*-2*.3+ $& ,1)(-% ?A; &+#+0(# $  ,&+# &*" +0'(*%)+&(-%(,(=(Q(Q(S(S%,0,A,V,V,X,X)'+'D'iHi$"').&$ %*! # 7YY]6^6^3 -2)(1(9(9%"*8*:*:'#' 
  	A@ @ @ @ @ #5D")/4"@"@D6\3.$8!		-'0':D$$-$5D!!	--+4+?((1(9%%-+/((,%%%(1(?%*D'+F(#6 (@%)3&.=.A+$ ')$(*%#% ),& (*$ 	&%%%$T***	"""""s$   "Q< <R9?"R"!R9"R42R9c                    |j         }	 t          j                            |          rqt	          j        d|           t          |          }|rIdt          j        t          j
        |          D ]\  }}||k    r||k     r|fd|D             }|S n#  t	          j        d|           Y nxY wt	          j        d|           t          |          S )Nz.Collecting try..except info from source for %sr   c                 >    g | ]}|j         cxk    rk    n n|S r   )try_line).0xmax_linemin_lines     r   
<listcomp>z0PyDB.collect_try_except_info.<locals>.<listcomp>%  s?    'j'j'jaxSTS]GiGiGiGiaiGiGiGiGiGiGiGiGir   z2Error collecting try..except info from source (%s)z0Collecting try..except info from bytecode for %s)co_filenamer   pathexistsr   r   r   r   maxsizedisfindlinestartsr   r   )r   code_objfilenametry_except_infos_liner  r  s         @@r   r   zPyDB.collect_try_except_info  s   '	`w~~h'' ( PRZ[[[#Fx#P#P # k!H"{H#&#5h#?#? 0 04+#h+/#h+/'j'j'j'j'j3C'j'j'j$''("	` TV^_____JHUUU&x000s   BB B5c                    	 | j         5  | j         | j                                         d | _        |s	 d d d            d S t                    t                    i ffd	}i ffd	}t	          | t                      |          | _        | j        j        }||_        ||_        ||_	        ||_
        | j                                         d d d            d S # 1 swxY w Y   d S #  t          j        d           Y d S xY w)Nc                     	 ||          S #  | r| d         dvr| t           j        j        z  } D ]}t          | |          r	d|| <    Y dS D ]}t          | |          r	d|| <    Y dS d|| <   Y dS xY w)Nr   )/\TF)r   r  sepr   absolute_filenamecacheinclude_patternexclude_patternexclude_patternsinclude_patternss       r   accept_directoryz8PyDB.setup_auto_reload_watcher.<locals>.accept_directory<  s    $$%677$, =1B21Fk1Y1Y .<- 0@ , ,O01BOTT ,;?&7 8'+ttt,
 0@ - -O01BOTT -;@&7 8',uuu-
 48/0#tts    <A1
A1(A1c                     	 ||          S #  D ]}t          | |          r	d|| <    Y dS D ]}t          | |          r	d|| <    Y dS d|| <   Y dS xY w)NTF)r   r  s       r   accept_filez3PyDB.setup_auto_reload_watcher.<locals>.accept_fileU  s    %$%677%/? , ,O01BOTT ,;?&7 8'+ttt,
 0@ - -O01BOTT -;@&7 8',uuu-
 49/0$uus    AAAzError setting up auto-reload.)rh  rH  r   tuplerr   r   watcherr  r  target_time_for_single_scantarget_time_for_notificationstartr   r   )	r   enable_auto_reload
watch_dirspoll_target_timer  r  r  r  r  s	       ``   r   setup_auto_reload_watcherzPyDB.setup_auto_reload_watcher.  s   C	A, @. @.(4)>>@@@,0D)) @. @. @. @. @. @. @. @. $))9#:#: #()9#:#: >@ $ $ $ $ $ $ $2 :< % % % % % % %( )7tY[[*(U(U%/7+;(&1#6F37G4%++---A@. @. @. @. @. @. @. @. @. @. @. @. @. @. @. @. @. @.B	A ?@@@@@@s:   C. +C!C. BC!C. !C%%C. (C%)C. .Dc                     	 t           j        }|r#t          |                    dd                    S n#  t	          j        d           Y nxY wdS )Nppidr   zError getting ppid.)SetupHoldersetupintr  r   r   )r   r  s     r   get_arg_ppidzPyDB.get_arg_ppidt  s^    	7%E 1599VQ//0001	7 566666qs	   04 Ac                     | j         sU|                                  | j                                         | j                            t
                     | j         Sd S d S r   )rf  r   r   r   r   TIMEOUT_FASTr   s    r   wait_for_ready_to_runzPyDB.wait_for_ready_to_run~  sr    # 	@**,,,,22444,11,???	 # 	@ 	@ 	@ 	@ 	@r   c                 8    | j                                          dS zP
        Note: only called when using the DAP (Debug Adapter Protocol).
        N)rK  r   r   s    r   on_initializezPyDB.on_initialize  s     	)//11111r   c                 j    | j                                          | j                                         dS r  )rK  r   r   r   s    r   on_configuration_donezPyDB.on_configuration_done  s4     	)--///(,,.....r   c                 4    | j                                         S r   )rK  is_setr   s    r   is_attachedzPyDB.is_attached  s    077999r   c                 j    | j                                          | j                                         dS r  )rF  r8  rK  r   r   s    r   on_disconnectzPyDB.on_disconnect  s4     	""$$$)//11111r   c                 v    t          |t          t          t          f          sJ t          |          | _        d S r   )
isinstancelistr  r   r  )r   ignore_system_exit_codess     r   set_ignore_system_exit_codesz!PyDB.set_ignore_system_exit_codes  s7    2T5#4FGGGGG),-E)F)F&&&r   c                 P    t          |d          r|j        | j        v S || j        v S )Ncode)r   r  r  )r   system_exit_excs     r   ignore_system_exit_codezPyDB.ignore_system_exit_code  s4    ?F++ 	E"'4+III"d&DDDr   Nc                 b   |t           }|                                s| j                                        r|                                 d S |                                  | j                                         | j                            t                     |                                d S d S r   )	r=   r  rK  r   r   r   r   r   r  )r   cancels     r   block_until_configuration_donez#PyDB.block_until_configuration_done  s    >F--// 	@07799 

**,,,,22444,11,??? --// 	@ 	@ 	@ 	@ 	@r   c                 >    | j                             |||           d S r   )rR  add_fake_frame)r   r   frame_idr@  s       r   r  zPyDB.add_fake_frame  s#    %44Y%PPPPPr   c                    |j         }	 |                    |          r		 d\  }}}dS |s		 d\  }}}dS t          ||j        |j                  d\  }}}S # t
          $ rX}t          || j                  st          j	                    }	t          j                    \  }}}t          j        |||j        |	           d|d|	                                }
t!                      }|                    | |
           t          || j                  s	 t          j                    \  }}}d                    t          j        ||                    }t          j        |j        j                  }d	|z   d
z   |z   |f|_        n#  t3          j                     Y nxY wY d }~d\  }}}dS Y d }~d\  }}}dS d }~ww xY w# d\  }}}w xY w)NNNNTF)filez=Error while evaluating expression in conditional breakpoint: 
 )fzCondition:
z	

Error:
)	conditionhandle_hit_conditioneval	f_globalsf_locals	Exceptionr  rt  ioStringIOr   r   	tracebackprint_exceptiontb_nextgetvaluer   send_error_messagers  r   format_exception_onlyextract_stacktb_framef_back conditional_breakpoint_exceptionr   r   )r   r   pybreakpoint	new_framer  etypevaluetbestack_tracemsgapierrorstacks                 r   handle_breakpoint_conditionz PyDB.handle_breakpoint_condition  s9    *	#	000;; B  0E5"""?  <  0E5"""9 	9#6	8JKK8  0E5""7  	 	 	a!EFF 2 kmm#&<>> ub)%
UUUUU_h_h_hjuj~j~  kA  kA  kA  Bkk&&tS111a!JKK 
*'*|~~$E5"GGI$CE5$Q$QRRE%3bk6HIIIE >Li=WZh=hkp=prw<xD99*')))))ttt
  0E5""" 555  0E5"""7	6  0E5"////sS   A A A F6B/F1A0E?>F1?FF1F9 %F9 1F66F9 9Gc                     	 	 t          |j        |j        |j                  }n #  t	          j                    d         }Y nxY w|t          |          |_        d S d S # |t          |          |_        w xY wNr5  )r  
expressionr  r  r   r   strpydev_message)r   r  r   r  vals        r   handle_breakpoint_expressionz!PyDB.handle_breakpoint_expression  s    	.(<2I4GI[\\(lnnQ'%(XX""" s%(XX"----s    $ A AA A6c                 N   |d         }|                     t                    s |d                              t                    r| j        S |                     |          }||S |                     d          s	|t          v r|d         }t          |                    d          |                    d                    }|rd|d|         }t          |                    d          |                    d                    }|r"||dz   d          }|                     |          S d S )Nr   r   __init__.pyr  r  r5  )
startswithrF   rP   r  r   maxrfindr  )r   abs_real_path_and_basenamebasename	file_typeabs_pathidirnames          r   _internal_get_file_typezPyDB._internal_get_file_type  s=   -b1=>> 	#B\]^B_BjBj  lJ  CK  CK 	# ?"228<<	 }-- 	H=Y1Y1Y 2!4HHNN3'')=)=>>A H#AaC=s++X^^D-A-ABB H&q1uvv.G  >>wGGGtr   c                     dS )a5  
        :param abs_path:
            The result from get_abs_path_real_path_and_base_from_file or
            get_abs_path_real_path_and_base_from_frame.

        :return
            True :
                If files should NOT be traced.

            False:
                If files should be traced.
        Fr   )r   r/  s     r   dont_trace_external_fileszPyDB.dont_trace_external_files  s	     ur   c                 &   |/	 t           |j        j                 }n#  t          |          }Y nxY w|j        j        |d         |j        f}	 ||         S #  |d         dk    rk|j        }|Z|                     |          | j        k    r3t          j	        |j        j                  dvrt          ||<   t          cY S |j        }|Zd||<   Y dS |                     |          }|"|                     |d                   rt          }|||<   |cY S xY w)aZ  
        :param abs_real_path_and_basename:
            The result from get_abs_path_real_path_and_base_from_file or
            get_abs_path_real_path_and_base_from_frame.

        :return
            _pydevd_bundle.pydevd_dont_trace_files.PYDEV_FILE:
                If it's a file internal to the debugger which shouldn't be
                traced nor shown to the user.

            _pydevd_bundle.pydevd_dont_trace_files.LIB_FILE:
                If it's a file in a library which shouldn't be traced.

            None:
                If it's a regular user file which should be traced.
        Nr   <string>)zrunpy.pyr6  )rk   f_coder  ri   co_firstlinenor  get_file_typerP   pydevd_file_utilsr-  rQ   r2  r4  )r   r@  r,  _cache_file_type	cache_keyr  r.  s          r   r9  zPyDB.get_file_type  s`   " &-_-J5<Kc-d**_-WX]-^-^*** \02LQ2OQVQ]^	#	#I..!	)!,
::Lm))!,,??DUD^_`_g_sDtDt } E E 7?(3'A# m* 37$Y/44445OPPI 112LQ2OPP + *I*3Y's"    /A A&D=DA Dc                     t            S r   )_CACHE_FILE_TYPEr   s    r   is_cache_file_type_emptyzPyDB.is_cache_file_type_emptyZ  s    ###r   c                     |S r   r   )r   _caches     r   get_cache_file_typezPyDB.get_cache_file_type]  s    r   c                 P    	 | j         j        }n# t          $ r
 | j        }Y nw xY w|S r   )r  thread_trace_funcAttributeErrorrX   )r   rD  s     r   get_thread_local_trace_funcz PyDB.get_thread_local_trace_func`  sF    	4 $ = O 	4 	4 	4 $ 3	4  s    ##Fc                    t           rt          j        |           dS t          t          j                     | j        Q|                                  t          j        | j                   t          r|rt          j
        | j                   dS |r|J n#||                                 }n|| j        _        t          j        |           t          r|rt          j
        |           dS dS dS )a  
        Enables tracing.

        If in regular mode (tracing), will set the tracing function to the tracing
        function for this thread -- by default it's `PyDB.trace_dispatch`, but after
        `PyDB.enable_tracing` is called with a `thread_trace_func`, the given function will
        be the default for the given thread.

        :param bool apply_to_all_threads:
            If True we'll set the tracing function in all threads, not only in the current thread.
            If False only the tracing for the current function should be changed.
            In general apply_to_all_threads should only be true if this is the first time
            this function is called on a multi-threaded program (either programmatically or attach
            to pid).
        all_threadsN)rK   r   start_monitoringr   enable_gevent_integrationr`   rD  rp  ra   rA   set_trace_to_threadsrF  r  rD  )r   rD  apply_to_all_threadss      r   enable_tracingzPyDB.enable_tracingg  s'     % 	!2?STTTTF$0%?AAA+  """#D$=>>> O2 O3D4MNNNF 	T$0000 ($($D$D$F$F!!BS-? 1222 	C. 	C/0ABBBBB	C 	C 	C 	Cr   c                 j    t           rt          j        d           d S t          j        d            d S )NFrH  )rK   r   stop_monitoringrD  rp  r   s    r   disable_tracingzPyDB.disable_tracing  s;    $ 	*!1eDDDDDD#D)))))r   c                     | j         sdS | xj        dz  c_        |s,|                                  |                     d           dS dS )zh
        When breakpoints change, we have to re-evaluate all the assumptions we've made so far.
        Nr5  T)breakpoints_changed)rf  r`  rT  !set_tracing_for_untraced_contexts)r   removeds     r   on_breakpoints_changedzPyDB.on_breakpoints_changed  si       	F

a

 	M    22t2LLLLL	M 	Mr   c                    t           r|rt          j                     t          rmt	          j                    }t          d t                      D                       }|                                D ]\  }}||vr| 	                    ||            n	 t                      }|D ]p}t          |dd          st          |dd          r%t          |          }|                    |          }	 || 	                    |j        |           d }j# d }w xY w	 d }d }d }d }n# d }d }d }d }w xY wt           rt          j                     d S d S )Nc              3   h   K   | ]-}t          |d d          st          |dd          $|j        V  .dS )is_pydev_daemon_threadFpydev_do_not_traceN)getattridentr  ts     r   	<genexpr>z9PyDB.set_tracing_for_untraced_contexts.<locals>.<genexpr>  se       $ $16>>$ CJ!MachBiBi$$ $ $ $ $ $r   rY  FrZ  )rK   r   update_monitor_eventsrA   r   _current_framesr   threadingEnumerater	  set_trace_for_frame_and_parentsr[  r!   get_topmost_framer\  restart_events)	r   rS  tid_to_frameignore_thread_idsthread_identr@  threadsr^  additional_infos	            r   rT  z&PyDB.set_tracing_for_untraced_contexts  s    % 	:)< 	:!7999 !	' .00L # $ $+--$ $ $ ! ! (4'9'9';'; N N#e'88888uMMMN
',..  
% 
%Aq":EBB !gaQeglFmFm ! &@&C&CO+==a@@E% , @@%PPP $
% "& "&&&&&$ 	3!022222	3 	3s%   AD ,D	D DD 
D'c                     | j         j        S r   r  r  r   s    r   r  z&PyDB.multi_threads_single_notification  s    :\\r   c                     || j         _        d S r   rl  )r   notifys     r   r  z&PyDB.multi_threads_single_notification  s    X^3UUUr   c                     | j         S r   )r  r   s    r   %threads_suspended_single_notificationz*PyDB.threads_suspended_single_notification  s    ::r   c                 F    | j         t          |           | _         | j         S r   )r}  r   r   s    r   get_plugin_lazy_initzPyDB.get_plugin_lazy_init  s!    ;'--DK{r   c                 >   	 |7	 t           |j        j                 }n#  t          |          }Y nxY w|d         }|j        j        ||j        f}| j        |         S # t          $ r | j        }	 | n# t          $ r t          |          }Y nw xY w|                     ||          }|| j	        k    rd||<   nZ|dk    r|| j
        k    rd||<   nCd||<   n=| j                            |          rd||<   n| j                            |          ||<   ||         cY S w xY w)a  
        Note: in general this method should not be used (apply_files_filter should be used
        in most cases as it also handles the project scope check).

        :param frame:
            The frame we want to check.

        :param absolute_filename:
            Must be the result from get_abs_path_real_path_and_base_from_frame(frame)[0] (can
            be used to speed this function a bit if it's already available to the caller, but
            in general it's not needed).
        Nr   Fr6  T)rk   r7  r  ri   r8  r  KeyError	NameErrorr9  rP   rQ   rU  has_mapping_entryrS  in_project_roots)r   r@  r  r,  r<  r  r.  s          r   in_project_scopezPyDB.in_project_scope  s   &	$ (c1Nu|Og1h..c1[\a1b1b...$>q$A!46GVI/	:: 	$ 	$ 	$0E_*** _ _ _-WX]-^-^***_ **52LMMIDO++#(i  "j00--',E)$$'+E)$$$667HII ]#'i   $(#8#I#IJ[#\#\i ####3	$sH   A  A 0-A D.A10D1B
DBBDDc                 6    | j                             |          S r   )rS  rw  )r   r  s     r   "in_project_roots_filename_uncachedz'PyDB.in_project_roots_filename_uncached  s    $556GHHHr   c                    t          j                     t          j                     | j                                         | j                                         | j                                         | j                                        | _        | j        	                                | _
        | j        p| j
        | _        | xj        dz  c_        t          r(t          j                     t          j                     d S d S r!  )rY   r   rZ   r  r  r  rS  r  r  r  r  r  r`  rK   r   r`  re  r   s    r   rT  zPyDB._clear_caches!  s     """ &((( 	$**,,,%++--- &&((((,(=(Q(Q(S(S%,0,A,V,V,X,X)'+'D'iHi$

a

$ 	3!7999!022222	3 	3r   c                     |                                   t                                           |                                  d S r   )rV  r>  r   rT  r   s    r   *clear_dont_trace_start_end_patterns_cachesz/PyDB.clear_dont_trace_start_end_patterns_caches3  s@     	##%%%   r   c                 d   ||j         j        |j         j        f}	 | j        |         S # t          $ r} | j        }|                     |          | j        k    rd||<   nGd}| j        j        r|j	        
                    dd          }| j                            ||          ||<   ||         cY S w xY w)z
        :return: True if it should be excluded, False if it should be included and None
            if no rule matched the given file.

        :note: it'll be normalized as needed inside of this method.
        TNr   r   )r7  co_namer8  r  rt  r9  rP   rS  require_moduler  r  exclude_by_filter)r   r@  r  r<  r  module_names         r   _exclude_by_filterzPyDB._exclude_by_filter;  s     '(<el>YZ		$0;; 	$ 	$ 	$1E !!%((DO;;#'i  "(7 F"'/"5"5j""E"EK#'#8#J#JK\^i#j#ji ####	$s   ( BB/.B/c                 @   |j         j        |||j         f}	 | j        |         S # t          $ rn d}| j        M| j        s| j        r?| j                            | |          s$|rt          j	        d|           d| j        |<   Y dS | j
        rvt          j        |          }|                     ||          }|J|r$|rt          j	        d|           d| j        |<   Y dS |rt          j	        d|           d| j        |<   Y dS | j        s|rS|                     |          s>d| j        |<   |r|rt          j	        d|           n|rt          j	        d|           Y dS |r|rt          j	        d	|           n|rt          j	        d
|           d| j        |<   Y dS w xY w)a  
        Should only be called if `self.is_files_filter_enabled == True` or `force_check_project_scope == True`.

        Note that it covers both the filter by specific paths includes/excludes as well
        as the check which filters out libraries if not in the project scope.

        :param original_filename:
            Note can either be the original filename or the absolute version of that filename.

        :param force_check_project_scope:
            Check that the file is in the project scope even if the global setting
            is off.

        :return bool:
            True if it should be excluded when stepping and False if it should be
            included.
        TNz%File traced (included by plugins): %sFz)File not traced (excluded by filters): %sz0File traced (explicitly included by filters): %sz$File not traced (not in project): %sz@File not traced (not in project - force_check_project_scope): %sz+File traced: %s (force_check_project_scope)zFile traced: %s)r7  r8  r  rt  r}  r~  r  can_skipr   
debug_oncer  r:  absolute_pathr  r  rx  )r   r@  original_filenameforce_check_project_scoper<  DEBUGr  r  s           r   apply_files_filterzPyDB.apply_files_filterS  sF   $ \02CE^`e`lm	1	+I66 /	 /	 /	E{&D,G&4Kk&{++D%88 ! i!,-TVghhh:?D,Y7 55, %$5$CDU$V$V!$($;$;ECT$U$U!$0( %  q%01\^oppp>B0;#tt  x%01cevwww>C0;$uu1 
5N 
X\XmXmnsXtXt 
6:(3, D h!,-SUfggg D!,-o  rC  D  D  Dtt( O k()VXijjj O():<MNNN27D$Y/55_/	s*   $ AFAF!FAF;FFc                    |j         s	| j        sdS |dS |j         }| j        }|r|                     |j                  r>|r>|                     |j        t          j        |j        j        j                            rdS dS )NFT)	ignore_librariesr  rx  r  r  r:  r  r7  r  )r   exception_breakpointtracer  exclude_filters_enableds        r   exclude_exception_by_filterz PyDB.exclude_exception_by_filter  s    #4 	T=Z 	5=4/@"&"? 	T%:%:5>%J%J 	#	''8I8WX]XfXmXy8z8z{{	 4ur   c                 b    | j                             |           |                                  d S r   )rS  set_project_rootsrT  )r   project_rootss     r   r  zPyDB.set_project_roots  s1    //>>>r   c                 b    | j                             |           |                                  d S r   )rS  set_exclude_filtersrT  )r   exclude_filterss     r   r  zPyDB.set_exclude_filters  s1    11/BBBr   c                 b    | j                             |           |                                  d S r   )rS  set_use_libraries_filterrT  )r   r  s     r   r  zPyDB.set_use_libraries_filter  s2    667KLLLr   c                 4    | j                                         S r   )rS  r  r   s    r   get_use_libraries_filterzPyDB.get_use_libraries_filter  s    $99;;;r   c                     | j         j        S r   )rS  r  r   s    r   get_require_module_for_filtersz#PyDB.get_require_module_for_filters  s    $33r   c                     t          j                    D ]T}t          |t                    rt	          j        d           t          |          r|j        rt          |d          r dS UdS )NzWError in debugger: Found PyDBDaemonThread not marked with is_pydev_daemon_thread=True.
__pydevd_main_threadTF)	r   get_non_pydevd_threadsr  r   r   
error_oncer   r   r   )r   r^  s     r   r   zPyDB.has_user_threads_alive  s    466 	  	 A!-.. A$%  A  A  Aq!!  x  71.D#E#E  44ur   c                    |J 	 |                     d            n#  Y nxY wt          | dd           }t          | dd           }|r|                                 |r|                                 t          || |          | _        t          || t          t          |          | _        | j        	                                 | j        	                                 t          j        d           d S )NrG  r   terminate_on_socket_close)r   r   r  皙?)
settimeoutr[  r   ry   r   ru   r   r   rG  r  r   sleep)r   sockr  curr_readercurr_writers        r   initialize_networkzPyDB.initialize_network  s   	OOD!!!!	DdHd33dHd33 	/,,... 	/,,..."4Ibccc"&? 3&?
 
 
 	
3s     c                     |rt          ||          }|| _        nt          |          }|                     |           d S r   )rz   r  r{   r  )r   hostportss       r   connectzPyDB.connect  sK     	#T4((A"#DT""A"""""r   c                     | j         t          d          | j                                         |                     |           | _         | j                                          d S )Nz9There is already another thread waiting for a connection.)rJ  r   r  r   _WaitForConnectionThreadr  r   s    r   !create_wait_for_connection_threadz&PyDB.create_wait_for_connection_thread  s`    .: !\]]]'--///.2.K.KD.Q.Q++1133333r   c                 8    | j                                          d S r   )r  r   r   s    r   set_server_socket_readyzPyDB.set_server_socket_ready  s    '++-----r   c                 8    | j                                          d S r   )r  r   r   s    r   wait_for_server_socket_readyz!PyDB.wait_for_server_socket_ready  s    ',,.....r   c                     | j         S r   )r  r   s    r   dap_messages_listenerszPyDB.dap_messages_listeners  s    ++r   c                 :    | j                             |           d S r   )r  r  )r   listeners     r   add_dap_messages_listenerzPyDB.add_dap_messages_listener  s    $++H55555r   c                        e Zd Zd Zd Zd ZdS )PyDB._WaitForConnectionThreadc                 >    t          j        | |           d | _        d S r   )r   r   _server_socketr   s     r   r   z&PyDB._WaitForConnectionThread.__init__  s#    %dE222"&Dr   c                 $   t           j        d         }t           j        d         }t          ||          | _        | j                                        | j        _        | j                                         | j        s	 | j        }|d S |	                    d           |
                                \  }}| j        rt          j        d           d S t          j        d           t          | j        dd           }|*t                      }|                    | j        d	           | j                            |d
           n?#  t"          j        dk    r(t          j                     t          j        d|           Y nxY w| j        d S d S )Nclientr  )r  r  r5  zTConnection (from wait_for_attach) accepted but ignored as kill was already received.z+Connection (from wait_for_attach) accepted.rG  F)resume_threadsr  r   z%Exiting _WaitForConnectionThread: %s
)r  r  rq   r  getsocknamer   r  r  r   listenacceptr   r   r[  r   request_disconnectr  r5   DEBUG_TRACE_LEVELr   r   )r   r  r  r  
new_socket_addrrG  r  s           r   runz!PyDB._WaitForConnectionThread.run  s   $X.D$V,D"6Dt"L"L"LD-1-@-L-L-N-NDJ*J..000) XX+AyHHQKKK()

%J* !'}~~~N#PQQQ$TZ4@@F) (kk..tz%.PPPJ11*X]1^^^^X&81<<!+---!(PRVWWW3 ) X X X X Xs    	E AE A2E :Fc                     t          j        |            | j        }|&	 |                                 n#  Y nxY wd | _        d S d S r   )r   r   r  close)r   r  s     r   r   z2PyDB._WaitForConnectionThread.do_kill_pydev_thread)  sW    1$777#A}GGIIIID&*### }s   4 8N)r   r   r   r   r  r   r   r   r   r  r     sE        	' 	' 	'!	X !	X !	XF	+ 	+ 	+ 	+ 	+r   r  returnc                     |                     d          r ||                    d          dz   d         }| j        |         | j        |         fS )zkreturns internal command queue for a given thread.
        if new queue is created, notify the RDB about it	__frame__|r5  N)r)  r+  rP  rQ  r   s     r   get_internal_queue_and_eventz!PyDB.get_internal_queue_and_event3  sU     ,, 	=!)//#"6"6":";";<Iy)4+>y+IIIr   c                     |dk    rt          ||g|R i |}nt          ||g|R i |}|                     ||           d S )Nr   )rp   ro   post_internal_command)r   r   methodr   r   internal_cmds         r   post_method_as_internal_commandz$PyDB.post_method_as_internal_command:  sk    <Y`QU```Y_``LL0FTTTTTVTTL""<;;;;;r   c                     |                      |          \  }}|                    |           |dk    r| j                                         dS |                                 dS )z(if thread_id is *, post to the '*' queuer   N)r  putr   r   )r   int_cmdr   queuerA  s        r   r  zPyDB.post_internal_commandA  sb    88CCu		',0022222IIKKKKKr   c                 x    |a |a|p|| _        t           rt                       t          rt	                       d S d S r   )!_global_redirect_stdout_to_server!_global_redirect_stderr_to_serverr  _init_stdout_redirect_init_stderr_redirect)r   redirect_stdoutredirect_stderrs      r   enable_output_redirectionzPyDB.enable_output_redirectionJ  sU     -<),;).A/, 	$!###, 	$!#####	$ 	$r   c                 ^    t           rt                       t          rt                       d S d S r   )r  r  r  r  r   s    r   r   zPyDB.check_output_redirectV  s<     - 	$!###, 	$!#####	$ 	$r   c                     | j         rd S d| _          G d d          fd}ddlm}m}  ||           | j        dk    rddlmm}m}m	 fd	||d
| _
        d S || _        d S )NTc                       e Zd ZdZdS ):PyDB.init_gui_support.<locals>._ReturnGuiLoopControlHelperFN)r   r   r   _return_control_oscr   r   r   _ReturnGuiLoopControlHelperr  h  s        "'r   r  c                  ,     j           _          j         S r   )r  )r  s   r   return_controlz-PyDB.init_gui_support.<locals>.return_controlk  s     C^Bq>q';.BBr   r   )set_return_control_callback
enable_guir=  )activate_matplotlibactivate_pylabactivate_pyplotdo_enable_guic                                  S r   r   )r  r  s   r   <lambda>z'PyDB.init_gui_support.<locals>.<lambda>{  s    &9&9-&H&H r   )r=  zmatplotlib.pyplotpylab)r  pydev_ipython.inputhookr  r  r  pydev_ipython.matplotlibtoolsr  r  r  r  r  r  )	r   r  r  r  r  r  r  r  r  s	         @@@r   init_gui_supportzPyDB.init_gui_support`  s    & 	F&*#
	( 	( 	( 	( 	( 	( 	( 	(	C 	C 	C 	C 	C 	TSSSSSSS##N333<//yyyyyyyyyyyy IHHHH%4'- -D))) *4D&&&r   c                    | j         rd S t          | j                  dk    rat                      rSt	          | j                  D ]>}|t
          j        v r.| j                            |d           }|
 |             d| _         ?| j        rt                      r	 |                     | j	                   d | _        d| _         d S # t          $ r ddlm} 	 t          | j	                  } ||           d| _         nD# t          $ r7}t          j        d                    | j	        |                     Y d }~nd }~ww xY wd | _        Y d S # d | _        w xY ww xY wd S d S )Nr   T)set_inputhookz,Cannot activate custom GUI event loop {}: {})r  r   r  r^   r  r   modulesr  r  r  
ValueErrorr  r  r_   r  r   r   format)r   moduleactivate_functionr  inputhook_functionr  s         r   _activate_gui_if_neededzPyDB._activate_gui_if_needed  s   ? 	Ft,--11,.. /"4#@AA / /F,,,0,I,M,MfVZ,[,[),8--///*.% 	:,.. ::..t/CDDD15D.&*DOOO! : : :EEEEEE:-DTEY-Z-Z*%&8999*.$ x x x!(V(](]^b^rtu(v(vwwwwwwwwx 6:2222T29999:	: 	:: :sH   (C E&C;:E	;
D<-D72E	7D<<E	?E		EEc                 T    	 ddl m}  |            }|r |             d S d S #  Y d S xY w)Nr   )get_inputhook)r  r  )r   r  	inputhooks      r   _call_input_hookzPyDB._call_input_hook  sU    	======%I 	 	DDs   " 'c                 l    | j                             | j                            | |                     d S r   )r   r!  r"  'make_skipped_step_in_because_of_filters)r   r@  s     r   )notify_skipped_step_in_because_of_filtersz.PyDB.notify_skipped_step_in_because_of_filters  s3     0 X XY]_d e efffffr   c                    | j         d S |r| j        nt          5  | j        s	 d d d            d S || j        v r	 d d d            d S t          |          }|j        r	 d d d            d S || j        |<   d d d            n# 1 swxY w Y   | j                             | j        	                    |                     d S r   )
r   rg  r=   rz  ry  r!   pydev_notify_killr!  r"  make_thread_created_message)r   r   r   use_lockrj  s        r   notify_thread_createdzPyDB.notify_thread_created  so   ;
 F.6@T**D 	9 	94 	9 	9 	9 	9 	9 	9 	9 	9 D444	9 	9 	9 	9 	9 	9 	9 	9 9@@O0  	9 	9 	9 	9 	9 	9 	9 	9 39D$Y/	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	 0 L LV T TUUUUUs"   	B
BB+
BBBc                    | j         dS |r| j        nt          5  | j        s	 ddd           dS | j                            |d          }|	 ddd           dS t          |          }|j        }|sd|_        t          |           ddd           n# 1 swxY w Y   | j         	                    | j
                            |                     dS )z8if thread is not alive, cancel trace_dispatch processingNT)r   rg  r=   rz  ry  r  r!   r	  r"   r!  r"  make_thread_killed_message)r   r   r  r   rj  was_notifieds         r   notify_thread_not_alivezPyDB.notify_thread_not_alive  s[   ;F.6@T**D 	4 	44 	4 	4 	4 	4 	4 	4 	4 	4 -11)TBBF~	4 	4 	4 	4 	4 	4 	4 	4 9@@O*<L 9481"?333	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	 0 K KI V VWWWWWs   	BB.BBBc                 |    | j         5  | j        |k    r|| _        |ri | _        d d d            d S # 1 swxY w Y   d S r   )rg  rz  ry  )r   enables     r   set_enable_thread_notificationsz$PyDB.set_enable_thread_notifications  s    * 	2 	20F::4:1 2 02D,	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2s   155process_thread_idsc                    | j         }d}| j        5  i }|r9|                                  t                      }g }| j        5  | j         }|D ]}t          |dd          rt          |t                    rt          j
        d           >t          |          r=|rt          |           t          |          }	|||	<   |                     |	|d           t          | j                                                  }
|
D ]}	|	|vr|                    |	           |D ]}	|                     |	d           	 ddd           n# 1 swxY w Y   g }t'          |          dk    r|rd}nt)          t+                                }|	|r|df}nd	}|D ]}	|                     |	          \  }}g }	 	 |                    d          }	 |                    |          r|                    |           n*t          j        d
|           |                    |           n#  t          j                      xY w# t6          j        $ r |D ]}|                    |           Y w xY wddd           n# 1 swxY w Y   |r|                                  dS |D ]H}t          j        d|           	 |                    |            .#  t          j        d           Y FxY wdS )z<
        This function processes internal commands.
        FrY  zVError in debugger: Found PyDBDaemonThread not marked with is_pydev_daemon_thread=True.)r  Nr   Tr   r   $NOT processing internal command: %s processing internal command: %s"Error processing internal command.) rf  r   r   rb  rg  ry  r[  r  r   r   r  r   r:   r3   r  r  keysr  r  r   r4   threadingCurrentThreadr  r  can_be_executed_byverboser   rt   Emptyr  r   do_it)r   r  rf  disposeprogram_threads_aliverI  program_threads_deadreset_cacher^  r   
thread_idscmds_to_executecurr_thread_idr  _eventcmds_to_add_backr  s                    r   r   zPyDB.process_internal_commands  sy    (_ N	4 N	4$&! #P**,,,022')$2 P P&*&>">K( U U"1&>FF U '+;<< U%0  2J  K  K  K  K,Q// U* : !7q 9 9 9(5a(8(8I?@1)< 66y!e6TTT "&d&>&C&C&E&E!F!FJ%/ C C	$,AAA077	BBB%9 P P	44Y4OOOOP;P P P P P P P P P P P P P P P@ !O ())Q..<.!67M7O7O!P!P%- $ 4.<c-B**-3*!3 4 4I$($E$Ei$P$PME6 (*$4
&+099U+;+;L&#/#B#B>#R#R !J$3$:$:<$H$H$H$H$-$56\^j$k$k$k$4$;$;L$I$I$I& ) 3 5 5 5 %
& "< 4 4 4,< 4 4L!IIl33334 44WN	4 N	4 N	4 N	4 N	4 N	4 N	4 N	4 N	4 N	4 N	4 N	4 N	4 N	4 N	4`  
	N4466666 !0 N N!"C\RRRN &&t,,,,N'(LMMMMMN Nsz   1I1C6E9I1E			I1E		A!I1/H6AHH6H22H66)I"I1!I""I11I58I5.KKc                     i }|                                 D ]\  }}|||j        <   |||<   |                                  d S r   )r	  r  rT  )r   canonical_normalized_filenameid_to_breakpointfile_to_line_to_breakpoints
break_dict_breakpoint_idr  s          r   consolidate_breakpointszPyDB.consolidate_breakpointsM  s[    
,<,B,B,D,D 	9 	9(NL,8J|())EO#$ABr   c	           
         	 t          ||||||||          }	n&# t          $ r t          j        d|           Y d S w xY w|	j        r:| j                                        }
|	|
|<   t          j        d|
           |
| _        |	j        r:| j	                                        }
|	|
|<   t          j        d|
           |
| _	        |	j
        r:| j                                        }
|	|
|<   t          j        d|
           |
| _        |	S )NzQError unable to add break on exception for: %s (exception could not be imported).z$Exceptions to hook on terminate: %s.zExceptions to hook always: %s.z-Exceptions to hook on user uncaught code: %s.)r#   ImportErrorr   criticalnotify_on_unhandled_exceptionsrc  copyr   notify_on_handled_exceptionsrd  #notify_on_user_unhandled_exceptionsre  )r   r   r  r"  r4  r2  r5  notify_on_first_raise_onlyr  ebcps              r   add_break_on_exceptionzPyDB.add_break_on_exceptionU  s9   	$,.3* 	 	BB  	 	 	rt}~~~44	 , 	327799BByMNA2FFF02D-* 	105577BByMN;R@@@.0D+1 	87<<>>BByMNJBOOO57D2	s    <<r   r   suspend_other_threadsoriginal_step_cmdsuspend_requestedc                 0   | j                                          |r| j                                          t          |||          }|s|rt          rt          j        d           |r=|                    |          }|&	 |                     |j	        |           d}n# d}w xY w|t          k    r+|j        $|j        }	d|_        |                     ||	           |s	| j        rd}|rt          | |           t          rt          j                     dS dS )a=  
        :param thread:
            The thread which should be suspended.

        :param stop_reason:
            Reason why the thread was suspended.

        :param suspend_other_threads:
            Whether to force other threads to be suspended (i.e.: when hitting a breakpoint
            with a suspend all threads policy).

        :param is_pause:
            If this is a pause to suspend all threads, any thread can be considered as the 'main'
            thread paused.

        :param original_step_cmd:
            If given we may change the stop reason to this.

        :param suspend_requested:
            If the execution will be suspended right away then this may be false, otherwise,
            if the thread should be stopped due to this suspend at a later time then it
            should be true.
        )r;  Tr<  N)except_thread)r  r   r  r   rK   r   r`  rd  rc  r\  r'   r  $_send_breakpoint_condition_exceptionr  r   re  )
r   r   r   r:  is_pauser;  r<  r   r@  &conditional_breakpoint_exception_tuples
             r   set_suspendzPyDB.set_suspend  sf   @ 	3JJLLL 	C7@@BBB$V[L]^^^ 	P 	P/H 	P!7$OOOO 		!**622E !88uMMM EEDELLLL -''D,Q,]595Z248D155f>deee$ 	))O 	) %)!  	<F;;;;$ 	3!022222	3 	3s   B B#c                     t          |          }|rAt          |          dk    r0|\  }}t          |||          }|                     ||           dS dS dS )zoIf conditional breakpoint raises an exception during evaluation
        send exception details to java
        r   N)r3   r   r|   r  )r   r   rB  r   exc_type
stacktracer  s          r   r@  z)PyDB._send_breakpoint_condition_exception  st     "&))	1 	;c:`6a6aef6f6f#I Hj4Y*UUG&&w	:::::	; 	;6f6fr   c                 r    t          |          }t          |||          }|                     ||           dS )zSends details on the exception which was caught (and where we stopped) to the java side.

        arg is: exception type, description, traceback object
        N)r3   r}   r  )r   r   rB  curr_frame_idr   r  s         r   send_caught_exception_stackz PyDB.send_caught_exception_stack  s>    
 "&))	0COO""7I66666r   c                     t          |          }t          |          }|                     ||           |                                  dS )zOSends that some thread was resumed and is no longer showing an exception trace.N)r3   r~   r  r   )r   r   r   r  s       r   %send_caught_exception_stack_proceededz*PyDB.send_caught_exception_stack_proceeded  sJ    !&))	9)DD""7I666&&(((((r   c                     | j         | j        dS | j                                        }| j                             |           dS )4Sends a message that a new process has been created.N)r   r"  make_process_created_messager!  )r   cmds     r   send_process_created_messagez!PyDB.send_process_created_message  sG    ;$"2":F;;==$$$$$r   c                    | j         | j        dS | j                                        }|t          u rdS dgfd}|                    |           | j                             |           d}t          j                    }d         sOt          j        d           t          j                    |z
  |k    rt          j	        d|           dS d         MdS dS )rM  NFc                      dd<   d S )NTr   r   )r   r   sents     r   
after_sentz:PyDB.send_process_about_to_be_replaced.<locals>.after_sent  s    DGGGr      r   g?zTpydevd: Sending message related to process being replaced timed-out after %s seconds)
r   r"  )make_process_about_to_be_replaced_messager   call_after_sendr!  r   r  r   r1  )r   rO  rT  r   initial_timerS  s        @r   !send_process_about_to_be_replacedz&PyDB.send_process_about_to_be_replaced  s   ;$"2":FHHJJ"""Fw	 	 	 	 	 	J'''$$$y{{q' 	Jt	l*g55"#y  |C  D  D  D q' 	 	 	 	 	r   c                     d}d}|j         }|dk    s|dk    r8|j        j        }|dv rd}|dk    s||k    r|}	| j        |_        |	|_         d}nd}|||fS )	NFr   r  r   )?z<module>r   Tz.jump is available only within the bottom frame)f_linenor7  r  rX   f_trace)
r   r@  rA  	func_name	next_linestopresponse_msgold_linecurr_func_namer  s
             r   set_next_statementzPyDB.set_next_statement  s    >F??e{22
 #\1N !222!#C>Y#>#>  $ 3!%OX|++r   c                 D   | j         5  	 t                      }|D ]R}t          |dd          r?t          |d          r/|j        |k    r$|j        |k    r|j                                         Sn#  t          j	                     Y nxY wd d d            d S # 1 swxY w Y   d S )NrY  Fcancel_event)
r   rb  r[  r   r   r  rf  r   r   r   )r   r   r  rI  r^  s        r   cancel_async_evaluationzPyDB.cancel_async_evaluation  s   _ 	& 	&&022$ - -A#;UCC-#A~66- K944J(22**,,,-&#%%%%%	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	&s)   BA#A.-B.BBBBc                 8    | j                             ||          S )z7returns a frame on the thread that has a given frame_id)rR  
find_frame)r   r   r  s      r   ri  zPyDB.find_frame+  s    ,77	8LLLr   c                    t           r t          j                    t          |j        <   |                     d           t          |          }|j        j        }|j        j	        }d|j        _	        |j
        }	d}
|'|dk    r!|\  }}}|t          j        |||||          }
|
t          j        |          }
t          j        dk    rt!          j        d|j        j        |j        |j        j        ||t-          |j        j                  t-          |j        j                  ||t3          |                     |
D ]2}t!          j        d|j        j        |j        j        |j                   3| j                            |           5 }|                    ||
           |                    ||	||||j                  }| j                            |           t@          j!        5  g }t@          j"        #                                D ]\  }}|j$        |j        k    r|                    |t          j        |j%                  |	           | j                            | j&        '                    ||j(                             | j                            |                    |tR          d
|||j                             |*                    |           	 ddd           n# 1 swxY w Y   | j+        ,                    |||	          5  | -                    |||||||          }ddd           n# 1 swxY w Y   ddd           n# 1 swxY w Y   d}
|r2| j+        .                                 | /                    |||||           t          j        dk    r&t!          j        d||t3          |                     dS dS )a  busy waits until the thread state changes to RUN
        it expects thread's state as attributes of the thread.
        Upon running, processes any outstanding Stepping commands.

        :param exception_type:
            If pausing due to an exception, its type.
        r   r  Nr   )exception_typer   zPyDB.do_wait_suspend
name: %s (line: %s)
 file: %s
 event: %s
 arg: %s
 step: %s (original step: %s)
 thread: %s, thread id: %s, id(thread): %sz  Stack: %s, %s, %s)frame_custom_thread_idr   z(Leaving PyDB.do_wait_suspend: %s (%s) %s)0rC   r   	_getframer   r\  r   r4   rj  r$  trace_suspend_typer   r   !create_frames_list_from_tracebackcreate_frames_list_from_framer5   r  r   r   r7  r  r\  r  r1   pydev_step_cmdpydev_original_step_cmdidrR  track_framestrackcreate_thread_suspend_commandr   r!  rM   custom_frames_lockcustom_framesr	  r   r@  r"  !make_custom_frame_created_messager   r%   r  r  r  _do_wait_suspendr   do_wait_suspend)r   r   r@  rA  rB  rk  r   messagern  r   frames_listrE  exc_desc	trace_objr  frames_trackerrO  from_this_threadrl  custom_framekeep_suspendeds                        r   r{  zPyDB.do_wait_suspend/  s    - 	J:=-//)&,7 	&&v...)&11	 (6#3F4;1(?u33,/)Hh	$0Ruh   ,J5QQK,q00O h$( 6 EFF 6 NOO6

   ! k k 5qx7KQXM]_`_ijjjj*77==  	H  K888 >>;1CVVMc C K##C(((&9 D D#% <Q<_<e<e<g<g D D8*L#-==&,,%.L\M_``3I -    // ,NNOegsgxyy   //*HH 68JBPbdjlr  mC    %++,BCCCC'DD D D D D D D D D D D D D D D0 <TTU^`fhstt H H!%!6!6vueSRdfv  yG  "H  "HH H H H H H H H H H H H H H H? 	H  	H  	H  	H  	H  	H  	H  	H  	H  	H  	H  	H  	H  	H  	HD  	L7NNPPP  sNKKK,q00OFPY[]^d[e[efffff 10s\   	AM%C/K!M!K%	%M(K%	)ML0$M0L4	4M7L4	8MMMc           	      F   |j         }	 d|_        |                                 d |_        d}	| j        5  |j        t          k    o| j         }
d d d            n# 1 swxY w Y   t                      }|
r|r| 	                                 t          t                                }|                     |          \  }}t          }	 | j        5  |j        t          k    s| j        r| j        s	 d d d            nd d d            n# 1 swxY w Y   |r"| j        rt           }|                                  	 |                    d          }|                    |          rGt)          j        d|           	 |                    |            nb#  t)          j        d           Y nJxY wt)          j        d|           |                    |           t           }n# t2          j        $ r Y nw xY w|                    |           |                                 S	 d|_        |                                 n # d|_        |                                 w xY w|                     t          |          t=          t?          |                               |j         tB          tD          fv rq||j#        f|_        |j$        j%        dz  r0tL          |_         ||_'        | (                    |j)        |           nd |_'        | (                    |j)        |           n|j         tT          tV          tX          fv r$||_'        | (                    |j)        |           n~|j         tZ          k    s|j         t\          k    rd |_'        | (                    |j)        |           d}d}	 | /                    |||j0        |j1                  \  }}}n# td          $ r}d|z  }Y d }~nd }~ww xY w|j3        }| j4        5                    |||          }| j6        7                    |           d|_3        nI# |j3        }| j4        5                    |||          }| j6        7                    |           d|_3        w xY w|rw|8                                 | j4        9                    | t          |          |j                   }| j6        7                    |           t          |_        t\          |_:        d}	nd	|_;        d	|_         t          |_        tx          |_:        | =                    |||||||          S |j         t|          t~          fv r|j@        }|j         t~          k    }|s| jA        r0|.| B                    ||j$        jC        |          r
|}|j@        }nn|.|#||_'        | (                    |j)        |           n!d |_'        d	|_;        d	|_         t          |_        t          rd|_F        |j         tT          tV          tB          tD          fv rd|j@        }|rZ|j$        jG        t          d
         k    r?|j@        }|r6|j$        jG        t          d         k    rd|_F        t)          jI        d           ~~| j4        9                    | t          |          |j                   }| j6        7                    |           t          jK        5  |D ]4}| j6        7                    | j4        L                    |                     5	 d d d            n# 1 swxY w Y   |                                 |	S )NTFr  r  r     r   %sr   r5  r   z Using (ipython) scoped stepping.)Mrj  is_in_wait_loopupdate_stepping_infostep_in_initial_locationr   pydev_stater7   ri  r^   r   r4   r  r  r   rm  r  r  r  r  r  r   r  r  r   r  rt   r  r   r   rg  r#  rs  rq  r&   r(   r\  r7  co_flagsr2   pydev_step_stoprc  r\  r)   r0   r*   r+   r,   rd  pydev_func_namepydev_next_liner  r$  r"  "make_set_next_stmnt_status_messager   r!  untrack_allmake_thread_run_messager   rr  r%   rz  r-   r/   r  r  r  r  r8   rI   pydev_use_scoped_step_framer  rJ   r   rM   rw  r  )r   r   r@  rA  rB  rn  r  r  r   r  activate_guiin_main_threadr%  r  notify_eventwait_timeoutr  r`  ra  	_old_liner  seqrO  
back_framer  r  r  s                              r   rz  zPyDB._do_wait_suspend  s   %=	(#'D %%''',0D)"N \ \#/=@[I[E[\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ;<<N / / ,,... 33I3K3KLLN"&"C"CN"S"SE<'L%_  '=88T=O8X\Xp8                     
 " ,do ,#/L))+++4#(99U#3#3L $66~FF 
4!)*K\ZZZV(..t4444V%/0TUUUUU ")*PR^___		,///'3 |   D !!,///""$$$?%B $)D %%'''' $)D %%''''$$%:6%B%BC5		NNSSS =2G"HHH-2EN,CD)|$t+ J&=#',$44V\5IIII'+$44V\5IIII ]4IK^$___#(D 00uEEEE O33t7JNd7d7d#'D 00uEEEDL(040G0GuVZVjlp  mA  1B  1B-i ( ( (#ax( (&II#tUabb'',,,%'"" (&II#tUabb'',,,%'"'''' ~**,,,&>>tEZ[aEbEbdhdwxx'',,,#0 %;"!% 02,&(##0 %7" ,,VUE3HZ\ln|}}} _6M$NNNJ(,(;?V(V%( D,H  ,..z:;L;XZstt  *%/%6

 !, %',$44V\5IIII
 (,$/1,&(##, . 	/4D,"}6K]\q&rrr L K)-CA-FFFA KQX-1G1JJJ;?8!'IJJJ66t=RSY=Z=Z\`\opp$$$"5 	_ 	_, _ _''(8(S(ST\(](]^^^^_	_ 	_ 	_ 	_ 	_ 	_ 	_ 	_ 	_ 	_ 	_ 	_ 	_ 	_ 	_ 	!!###s   +H5 AH5 AH5  A!A+H5  D,H5 D		H5 D	'H5 5G 
*H5 5F 
H5 F#!7H5 G*'H5 )G**.H5 5I&O P' 
OOP' OP' 'AQ-=8\\	\c                    t          j        d           	 t          ||           |                     ||t	          |                     	 |                     |t                     |                     ||d|t                     n#  | 	                    |           Y nxY wn"#  t          j
        d|d                    Y nxY wt          |           d }d S # t          |           d }w xY w)Nz'We are stopping in unhandled exception.r   z=We've got an error while stopping in unhandled exception: %s.r   )r   r   rT   rI  rs  rC  r.   r{  rG   rK  r   rU   )r   r   r@  frames_byidrB  s        r   do_stop_on_unhandled_exceptionz#PyDB.do_stop_on_unhandled_exception@	  s   ABBB	"5#...,,VS"U))DDDC  )@AAA$$VUKF^____C::6BBBBB	i _adefaghhhhh'...EEE (...ELLLLs5   4B" 9B B" BB" !C "C?C C*rh  c                    |                     dd          }|rJ d}|t          |t                    s|j        } |                     |          }t
          r||rG|r*t          j        d|j        j	        |j        j
                   t          j        |j                   n:|r*t          j        d|j        j	        |j        j
                   t          j        ||j        |           n|r*t          j        d|j        j	        |j        j
                   n||rN|r*t          j        d|j        j	        |j        j
                   |j        |j        t          urt          |_        ns|j        | j        ur8|r*t          j        d|j        j	        |j        j
                   | j        |_        n,|r*t          j        d|j        j	        |j        j
                   |j        }|~d S )NdisableFTz!Disable tracing of frame: %s - %szSet tracing of frame: %s - %sz"SKIP set tracing of frame: %s - %s)r  r  r	   r  r9  rK   r   r   r7  r  r  r   disable_code_tracingenable_code_tracingr]  r>   rX   )r   rh  r@  r   r  r  r.  s          r   rc  z$PyDB.set_trace_for_frame_and_parentsP	  s   **Y..eY//  **511I( ~$ e  A%O,OQVQ]Qikpkwk  A  A  A-B5<PPPP ! }%O,KU\Meglgsg{|||-A,PUP\^cdddd ~!(LelNfhmhth|}}} $ 	<  A%O,OQVQ]Qikpkwk  A  A  A =4i9W9W,5EMd.AAA  }%O,KU\Meglgsg{|||(,(; ~!(LelNfhmhth|}}}LEO R EEr   c                     | j         }||                                 t          |           x}| _         |                                 d S r   )rM  r   r   r  )r   curr_pydb_command_threadnew_pydb_command_threads      r   _create_pydb_command_threadz PyDB._create_pydb_command_thread	  sR    #'#< #/$99;;;>OPT>U>UU$";%%'''''r   c                     | j         }||                                 t          |           x}| _         |                                 d S r   )rL  r   r   r  )r   curr_output_checker_threadrL  s      r   _create_check_output_threadz PyDB._create_check_output_thread	  sQ    %)%<"%1&;;===7G7M7MMT4  """""r   c                 V    |                                   |                                  d S r   )r  r  r   s    r   start_auxiliary_daemon_threadsz#PyDB.start_auxiliary_daemon_threads	  s,    ((***((*****r   c                     	  j         5   j        }d _        d d d            n# 1 swxY w Y   |r j                            |           d S 	  fd}t	          j        d           t          j                    }t          j                    ||z   k     rJt           |                      dk    rnlt          j        d           t          j                    ||z   k     Jd  |            D             }|r(t	          j        dd		                    |                      j        
                                 d S #  j        
                                 w xY w#  t	          j                     Y d S xY w)
NTr   c                      t          j                  } |                     j                   |                     t	          j                               | S r   )r   rI  discardrL  r   current_thread)pydb_daemon_threadsr   s    r   get_pydb_daemon_threads_to_waitzJPyDB.__wait_for_threads_to_finish.<locals>.get_pydb_daemon_threads_to_wait	  sN    .1$2R.S.S++33D4KLLL+33I4L4N4NOOO22r   zRPyDB.dispose_and_kill_all_pydevd_threads waiting for pydb daemon threads to finishr   r  c                     g | ]	}|j         
S r   )r   r]  s     r   r  z5PyDB.__wait_for_threads_to_finish.<locals>.<listcomp>	  s    'Z'Z'Z1'Z'Z'Zr   z>The following pydb threads may not have finished correctly: %sz, )rk  rj  rl  r   r   r   r   r   r  r   r   r   )r   r   !wait_for_threads_to_finish_calledr  
started_atthread_namess   `     r   __wait_for_threads_to_finishz!PyDB.__wait_for_threads_to_finish	  s    	"= ? ?484[1:>7? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 1 H=BB7BSSSSSH3 3 3 3 3 O$xyyy!%J )++
W(<<<>>@@AAQFF!
8,,, )++
W(<<<
 (['Z8W8W8Y8Y'Z'Z'Z' G%O,lnrnwnw  yE  oF  oF  G  G  GAEEGGGGGDAEEGGGG	"!!!!!!s?   E %E )E ) E CD9 E 9EE E/r   c                 T   	 t          j                    j        }t          j        d|j        j        |j        |j        j                   d}| j	        5  | j
        }d| _
        ddd           n# 1 swxY w Y   |r~|r*t          j        d           |                     |           nt          j        d           	 | j        r | j                                         d| _        t          j        d           dS t          j        d           t          j                    }t          j                    ||z   k     rx| j        5  | j        }||                                r!t          j        d           	 ddd           nF	 ddd           n# 1 swxY w Y   t          j                    ||z   k     xt          j        d	           t%          | j                  }|D ];}t)          |d
          r)t          j        d|           |                                 <|r|                     |           nt          j        d           t-                      }	|	| u rt/          d           nG#  t          j        d           	 t0          j        dk    rt          j                     n#  Y nxY wY nxY w| j        r | j                                         d| _        t          j        d           dS # | j        r | j                                         d| _        t          j        d           w xY w)a>  
        When this method is called we finish the debug session, terminate threads
        and if this was registered as the global instance, unregister it -- afterwards
        it should be possible to create a new instance and set as global to start
        a new debug session.

        :param bool wait:
            If True we'll wait for the threads to be actually finished before proceeding
            (based on the available timeout).
            Note that this must be thread-safe and if one thread is waiting the other thread should
            also wait.
        zQPyDB.dispose_and_kill_all_pydevd_threads (called from: File "%s", line %s, in %s)NTzBPyDB.dispose_and_kill_all_pydevd_threads (already disposed - wait)zEPyDB.dispose_and_kill_all_pydevd_threads (already disposed - no wait)z2PyDB.dispose_and_kill_all_pydevd_threads: finishedz5PyDB.dispose_and_kill_all_pydevd_threads (first call)zEPyDB.dispose_and_kill_all_pydevd_threads no commands being processed.zRPyDB.dispose_and_kill_all_pydevd_threads timed out waiting for writer to be empty.r   z;PyDB.dispose_and_kill_all_pydevd_threads killing thread: %sz1PyDB.dispose_and_kill_all_pydevd_threads: no waitz3PyDB.dispose_and_kill_all_pydevd_threads: exceptionr   )r   rm  r  r   r   r7  r  r\  r  rn  ri  !_PyDB__wait_for_threads_to_finishr  r  r   r   r   r   r   rI  r   r   rw   rx   r5   r  r   )
r   r   r   r  disposedr  r   r  r^  r   s
             r   r   z(PyDB.dispose_and_kill_all_pydevd_threads	  s   <	R/JOc!-#!)	   J$ * *-%)"* * * * * * * * * * * * * * *   mO$hiii55g>>>>O$klllJ " +#))+++&*#OPQQQQQO OSTTT J)++
W 444_  ![F~~!(oppp	      %               )++
W 444  tuuu"%d&F"G"G( - -1455 -O$acdeee**,,, U11':::: STTT'))E}}#D)))	OQRRR"499')))" +#))+++&*#OPQQQQQ	 " +#))+++&*#OPQQQQs   AI& A."I& .A22I& 5A26AI& 9AI& 3F4I& I& FI& FCI& %K* &J*=#J! J*!J%#J*(K* *=L'c                 V    |                                   |                                  dS )zMShared code to prepare debugging by installing traces and registering threadsN)patch_threadsr  r   s    r   prepare_to_runzPyDB.prepare_to_run
  s,    ++-----r   c                     t           rt          j        d           n"	 t          j        | j                   n#  Y nxY wddlm}  |             d S )NTrH  r   )patch_thread_modules)rK   r   rJ  r   r   rX   _pydev_bundle.pydev_monkeyr  )r   r  s     r   r  zPyDB.patch_threads
  sr    $ 	!2tDDDDD"4#67777CCCCCCs   9 =c                 j	   d }d}|rdt           j        vr t           j                            dd           |                    d          \  }}}|}t	          |          }	|	qt          |          }
|
$t           j                            d|z             d S t	          d|z            }	|	$t           j                            d|z             d S |	}n1|	}t          j        	                    |	          }
t          j        
                    |
d          }t          j        
                    |
d          }|	                    d          rDt          j                            |          r|}	nt          j                            |          r|}	nw|	                    d	          rbt          j                            |          r"t          j                            |          s|}	n!t          j                            |          r|}	|	t           j        d<   t          j                            |          rAt          j        
                    |d          }t          j                            |          r|}d }|3t!          |d
          }|j        }	 t$          |d<   n# t&          $ r Y nw xY w||}t           j        d         dk    r9|7|j                            t           j        d                   rt           j        d= |sPt           j                            dt          j                            t/          |                    d                    |r(|                                  |                                  t5                      }t7          |          }| j        Rt;                       | j                            t?                                 tA          dd|j!        |dd|dd |
  
         | j"        tA          dddddd|dd d 
  
         	 tF          r| $                                 n#  tK          j&        d           Y nxY wtO          t           d          rt          j(                     | )                    ||           |r| *                                 | +                    ||||||          S )Nr   r   :zNo module named %s
z%s.__main__z__main__.pyz__main__.pycz__init__.pycr(  pydevd__builtins__threading_eventr   r  r5  )parentasyncio_eventTaskr`  )r@  r  %Matplotlib support in debugger failed	exc_clear),r   r  insert	partitionrl   rm   stderrwriter   r1  r   endswithr  argvisdirisfiler]   __dict__r  ru  __file__r)  splitos_path_abspathr  r  r  r4   r  rh   set_start_timerg   rf   r   r  r;   r  r   r   r   r  r  rN  _exec)r   r  globalslocals	is_module	set_tracer  entry_point_fnr  r  mod_dirmain_pymain_pyc
new_targetmr^  r   s                    r   r  zPyDB.run
  s    '	# !!2&&&&*nnS&9&9#D!^K#D))H)+66?J$$%;d%BCCCF+MK,GHHH'
(()?$)FGGG''//(33',,w>>7<<@@$$^44 	+w~~h// +#+00 +#*&&}55 +w~~h// +w8O8O +#+00 +#*"CHQK7== 	"dM::Jw~~j)) "!? x00AjG*6''    >F 8A;"1:3H3HRS3U3U 	H
 HOOArw}}_T-B-BCCAFGGG 	"&&((( !!!"$$)!,,	+NNN //

;;;$%6169hX_aeghjn  xA  B  B  B  B ,$_aSY[_abjnw{||||	I) (%%'''	I GHHHHH3$$ 	MOOO 	""9a000  	"!!!zz)^[$QWXXXs   
J 
J'&J'P, ,Qc                     t          j                    }|st          j        ||d          }nH|r0t	          |d|g||          }t          ||          }	 |	             nt          j        |d          }|S )zs
        This function should have frames tracked by unhandled exceptions (the `_exec` name is important).
        __main__r   )levelfromlistr  r  F)
alter_argv)r   r  r   run_path
__import__r[  _run_module_as_main)
r   r  r  r  r  r  r  r^  modfuncs
             r   r  z
PyDB._exec
  s     $&& 	Z"+D':FFGG
  Z A@PZajpqqqsN33 ':;SXYYYr   c                    |                                   t          j                    }ddlm}  |j        d d |j        dt          j        	                    t          j        
                    t                                        ||          }t          |          }|                     |t          |          |           | j                            | ||          }| j        | j                            |           	 | j        r|                                  |                                  t-          j        d           D)Nr   )r   r   ConsoleTg{Gz?)r   r   r  _pydevd_bundler   FrameFCoder   r  rn   r1  r  r4   r  rs  r"  make_show_console_messager   r!  r  r  r   r   r  )r   r  r   r   r@  r   rO  s          r   wait_for_commandszPyDB.wait_for_commands
  s1   $$&&&)++555555("(".(.y"'//"'//ZbJcJc:d:deegnpw
 
 *&11	Ir%yy%88888y%PP;"K##C(((	 (%%'''**,,,Jt	r   Tr   r  )F)FFr   F)Tr   )NNFT)ir   r   r   r  r   dont_terminate_child_pidsr   r   r  r  r  r  r  r  r  r  r  r  r  r  r&  r2  r4  r>  r9  r?  rB  rF  rN  rQ  rV  rT  propertyr  setterrp  rr  rx  rz  rT  r}  r  r  r  r  r  r  r  r  r   r  r  r  r  r  r  r  r   r  r   rt   rO  r   r  r  r  r  r   r  r   r  r  r  r  r  r   r  r   r.  r9  r  boolrC  r@  rI  rK  rP  rY  rd  rg  ri  r{  rz  r  rc  r  r  r  r  r   r  r  r  r  r  r   r   r   r:  r:  .  s         !$R# R# R# R#h1 1 14DA DA DAL  @ @ @2 2 2/ / /: : :2 2 2G G GE E E@ @ @ @Q Q Q%0 %0 %0N. . .  4  " ?CUe F F F FP$ $ $ *:    ! ! !*C *C *C *CX* * *M M M M&*3 *3 *3 *3X ] ] X] '-_ _ .-_ ; ; X;  
3$ 3$ 3$ 3$jI I I3 3 3$  $ $ $0D D DL  $      < < <4 4 4	 	 	   4# # #4 4 4. . ./ / / , , X,6 6 61+ 1+ 1+ 1+ 1+#3 1+ 1+ 1+fJv|^?[9\ J J J J< < <  
$ 
$ 
$$ $ $ 4  4  4D: : :B  g g gV V V V2X X X X*2 2 2cN cNHUO cN cN cN cNJ  " , , , ,d %*! %D3 D3 D3  $	D3 D3  D3 D3 D3 D3L	; 	; 	;7 7 7) ) )% % %  2, , ,0& & &M M Mfg fg fg fgPg g gR   /HSM / / / /b( ( (# # #+ + +!" !" !"FIR IR IR IRV. . .
  tY tY tY tYl  (    r   r:  c                       e Zd Zd Zd ZdS )IDAPMessagesListenerc                     dS )zg
        Called just before a message is sent to the IDE.

        :type message_as_dict: dict
        Nr   r   message_as_dicts     r   before_sendz IDAPMessagesListener.before_send
        r   c                     dS )zl
        Called just after a message is received from the IDE.

        :type message_as_dict: dict
        Nr   r  s     r   after_receivez"IDAPMessagesListener.after_receive
  r  r   N)r   r   r   r  r  r   r   r   r  r  
  s2              r   r  c                 n    t                      }|t          d          |                    |            dS )a  
    Adds a listener for the DAP (debug adapter protocol) messages.

    :type dap_messages_listener: IDAPMessagesListener

    :note: messages from the xml backend are not notified through this API.

    :note: the notifications are sent from threads and they are not synchronized (so,
    it's possible that a message is sent and received from different threads at the same time).
    NzPyDB is still not setup.)rw   r   r  )dap_messages_listenerr   s     r   r  r  
  s>      !!E}7888	##$9:::::r   c                     t                      }|dS |j        }|dS t          dd| d          }|                    |           dS )z
    API to send some custom json message.

    :param dict|pydevd_schema.BaseSchema msg:
        The custom message to be sent.

    :return bool:
        True if the message was added to the queue to be sent and False otherwise.
    NFr   r   T)is_json)rw   r   r   r!  )r  r   r   rO  s       r   send_json_messager  
  sY      !!E}u\F~u
RC
.
.
.C
s4r   c                 <    ddl m} |                    |            d S )Nr   )pydev_monkey_qt)_pydev_bundler  patch_qt)qt_support_moder  s     r   enable_qt_supportr	  
  s.    ------_-----r   c                                            d          dk    sJ d              fd}t          j        |          }t          |           |                                 dS )a^  
    Helper to dump threads after a timeout.

    :param filename_template:
        A template filename, such as 'c:/temp/thread_dump_%s.txt', where the %s will
        be replaced by the time for the dump.
    :param timeout:
        The timeout (in seconds) for the dump.
    :param recurrent:
        If True we'll keep on doing thread dumps.
    r  r5  zExpected one %s to appear in: c                     	 	 t          j                   t          j                     fz  } 	 t          j        t          j                            |                      n# t          $ r Y nw xY wt          | d          5 }t          |           d d d            n# 1 swxY w Y   sd S # t          $ r t          j
                     Y d S w xY w)NTw)r   r  r   makedirsr  r1  r  opendump_threadsr   r   )r  streamfilename_template	recurrentr   s     r   _threads_on_timeoutz6start_dump_threads_thread.<locals>._threads_on_timeout  s,   	"

7###,	~=K 9 9::::    D(C(( )F ((() ) ) ) ) ) ) ) ) ) ) ) ) ) )  F
  	" 	" 	"!!!!!!	"s^   ,B. 1A" !B. "
A/,B. .A//B. BB. B""B. %B"&B. -B. .CC)targetN)r   r   Threadr   r  )r  r   r  r  r^  s   ```  r   start_dump_threads_threadr  
  s     ""4((A----VgVg/i---" " " " " " "  	 3444A ###GGIIIIIr   c                 .    t          j        |            dS )zE
    Helper to dump thread info (default is printing to stderr).
    N)r   r  )r  s    r   r  r    s     f%%%%%r   c                     t           j                            d           t           j                            d           | rt          j        d           d S d S )NzUsage:
zUpydevd.py --port N [(--client hostname) | --server] --file executable [file_options]
r   )r   stdoutr  exit)doExits    r   usager  "  sR    JZ   Jmnnn  r   c                  0    t          j        d           d S )Nr  stdr   #redirect_stream_to_pydb_io_messagesr   r   r   r  r  )      1h??????r   c                  0    t          j        d           d S )Nr  r  r   r   r   r   r  r  -  r"  r   r   c                 P   | d         }t          | d                   }t          j        <|t          j        d         k    r&t          d|dt          j        d         d          t	          ||ddd|||||	
  
         t                      }|                                 |j        S )
an  
    Starts accepting connections at the given host/port. The debugger will not be initialized nor
    configured, it'll only start accepting connections (and will have the tracing setup in this
    thread).

    Meant to be used with the DAP (Debug Adapter Protocol) with _wait_for_attach().

    :param address: (host, port)
    :type address: tuple(str, int)
    r   r5  Nr  zUnable to listen in port: z (already listening in port: )F)
r  r  suspendr  block_until_connecteddont_trace_start_patternsdont_trace_end_patternspatch_multiprocessingr+  r,  )r  r  r  r   r   rw   r  r  )	addressr(  r)  r*  r+  r,  r  r  r   s	            r   _enable_attachr,  1  s    $ 1:Dwqz??D$;$V,,, .cgcgcgitiz  |B  jC  jC  jC  "D  E  E  E##"; 73!/     !!E	&&((($$r   c                 p    t                      }|t          d          |                    |            dS )z
    Meant to be called after _enable_attach() -- the current thread will only unblock after a
    connection is in place and the DAP (Debug Adapter Protocol) sends the ConfigurationDone
    request.
    NzXDebugger still not created. Please use _enable_attach() before using _wait_for_attach().)r  )rw   r   r  )r  r   s     r   _wait_for_attachr.  [  s@      !!E}wxxx	(((77777r   c                  N    t                      } | duo|                                 S )z
    Can be called any time to check if the connection was established and the DAP (Debug Adapter Protocol) has sent
    the ConfigurationDone request.
    N)rw   r  )r   s    r   _is_attachedr0  h  s+    
  !!E65#4#4#6#66r   .  Tc                 x   |r3|                                 dk    rt          j        t          j        _        |p|                    dd          }|p|                    dd          }|                    d          }t          5  t          | ||||||||	|
||||||           ddd           dS # 1 swxY w Y   dS )a(  Sets the tracing function with the pydev debug function and initializes needed facilities.

    :param host: the user may specify another host, if the debug server is not in the same machine (default is the local
        host)

    :param stdout_to_server: when this is true, the stdout is passed to the debug server

    :param stderr_to_server: when this is true, the stderr is passed to the debug server
        so that they are printed in its console and not in this process console.

    :param port: specifies which port to use for communicating with the server (note that the server must be started
        in the same port). @note: currently it's hard-coded at 5678 in the client

    :param suspend: whether a breakpoint should be emulated as soon as this function is called.

    :param trace_only_current_thread: determines if only the current thread will be traced or all current and future
        threads will also have the tracing enabled.

    :param overwrite_prev_trace: deprecated

    :param patch_multiprocessing: if True we'll patch the functions which create new processes so that launched
        processes are debugged.

    :param stop_at_frame: if passed it'll stop at the given frame, otherwise it'll stop in the function which
        called this method.

    :param wait_for_ready_to_run: if True settrace will block until the ready_to_run flag is set to True,
        otherwise, it'll set ready_to_run to True and this function won't block.

        Note that if wait_for_ready_to_run == False, there are no guarantees that the debugger is synchronized
        with what's configured in the client (IDE), the only guarantee is that when leaving this function
        the debugger will be already connected.

    :param dont_trace_start_patterns: if set, then any path that starts with one fo the patterns in the collection
        will not be traced

    :param dont_trace_end_patterns: if set, then any path that ends with one fo the patterns in the collection
        will not be traced

    :param access_token: token to be sent from the client (i.e.: IDE) to the debugger when a connection
        is established (verified by the debugger).

    :param client_access_token: token to be sent from the debugger to the client (i.e.: IDE) when
        a connection is established (verified by the client).

    :param notify_stdin:
        If True sys.stdin will be patched to notify the client when a message is requested
        from the IDE. This is done so that when reading the stdin the client is notified.
        Clients may need this to know when something that is being written should be interpreted
        as an input to the process or as a command to be evaluated.
        Note that parallel-python has issues with this (because it tries to assert that sys.stdin
        is of a given type instead of just checking that it has what it needs).

    :param protocol:
        When using in Eclipse the protocol should not be passed, but when used in VSCode
        or some other IDE/editor that accepts the Debug Adapter Protocol then 'dap' should
        be passed.
    dapstdoutToServerFstderrToServer__setup_holder__)r6  notify_stdinN)	lowerr   rB   r   rL   r]  r  _set_trace_lock_locked_settrace)r  stdout_to_serverstderr_to_serverr  r&  trace_only_current_threadoverwrite_prev_tracer*  stop_at_framer'  r  r(  r)  r+  r,  r7  protocolr   r6  s                      r   r   r   t  s*   \  cHNN$$--?O?b+<'N6::6F+N+N'N6::6F+N+N zz"455	 
 
%!!!%#-%!	
 	
 	
 	

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
s    B//B36B3c                 L	   |r#	 ddl m} |                                 n#  Y nxY w| ddl m} |                                } t                      }|r|t          _        |t                      }t          j
                     t          j        "| dt          |          || d}|t          _        |||j        _        |t          j        d<   |||j        _        |t          j        d<   |r|                    | |           n0t!          t"          |d          |_        |                                 |
s|r#t)                                          ||
|           |a|at,          rt1                       t.          rt3                       |rt5                       t7                      }t9          |          }|	sd	|_        |                                 |                                 	 t@          r|!                                 n#  tE          j#        d
           Y nxY w|r|$                                 nD|%                                 |$                    |j&        d	           |'                                 |(                    |j)        tU                      j+                   tX          j-        5  tX          j.        /                                D ] \  }}|(                    d |j0                   !	 d d d            n# 1 swxY w Y   n|||j        _        |||j        _        t7                      }|(                    |j)        tU                      j+                   t9          |          }|r|$                                 n0|%                                 |$                    |j&        d	           |rtb          |_2        |wtf          |_4        tj          |_6        ||_7        tp          |_9        |:                                 tv          r0ty          j=        d	           |(                    |j)        |           nI|>                    |tb          d	           |(                    |j)        tU                      j+                   tv          rty          j?                     d S d S d S )Nr   pydev_monkey)pydev_localhostF)r  serverr  multiprocessskip-notify-stdinaccess-tokenclient-access-tokenr  Tr  )rM  r>  )@r  rC  patch_new_process_functionsrD  get_localhostrw   r  r  r:  r   
setup_typer  rF  r+  r,  r  ry   r=   r   r  r   !set_dont_trace_start_end_patternsr  r  r  r  patch_stdinr  r!   rf  r  r  r;   r  r   r   rN  r  rX   rT  rc  r\  r9   r  rM   rw  rx  r	  r@  r'   rr  r8   r  r)   rq  r  r6   suspend_typer  rK   r   r`  rC  re  )r  r;  r<  r  r&  r=  r*  r?  r'  r  r(  r)  r+  r,  r6  r7  rC  rD  r   r  r^  rj  _frameIdr  s                           r   r:  r:    s<   $  7	7222222 446666	D |111111,,..
  !!E -,}!###$D		 5)5%5 E !&K#0<E -0<Kn-*7JE 47JK34  	6MM$%%%% (euUUUEL33555$ 	u(? 	uKK99%AZ\sttt,<),<), 	$!###, 	$!### 	MMM"$$4Q77$ 	&!%E##%%%,,...	I) )&&(((	I GHHHHH$ 		6  """" !!!  !5D QQQ 33555--agy{{7IJJJ"5 	P 	P*?*M*S*S*U*U P P&,55dL<NOOOOP	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P #0<E -*7JE 4"$$--agy{{7IJJJ4Q77$ 	R  """" !!!  !5D QQQ  32?/$ +4O'-:O*.;O++9O(00222( N%;dSSSS55ag}MMM a$GGG11!'9;;;MNNN$ 	3!022222'3 3$	3 	3s'    #'H H1A K>>LLc                     t          j        d           t          j                     t          rt          j        d           n1t          j        d            	 t          j        d            n#  Y nxY wddl
m}   |              	 t          j                                         n#  Y nxY w	 t          j                                         n#  Y nxY wt                      }||                                 d S d S )Nzpydevd.stoptrace()TrH  r   )undo_patch_thread_modules)r   r   rD  restore_sys_set_trace_funcrK   r   rP  r   r   r   r  rR  r  flushr  rw   r   )rR  r   s     r   r  r  |  s   O()))-///  -$?????T	t$$$$	DDDDDDD

!!E1133333 s$   A/ /A3B& &B*.C Cc                        e Zd Zd Zd Zd ZdS )
Dispatcherc                     d | _         d S r   )r  r   s    r   r   zDispatcher.__init__  s    			r   c                     || _         || _        t          | j         | j                  | _        t	          |           | _        d| j        _        | j                                         d S r  )r  r  rz   r  DispatchReaderrG  rZ  r  )r   r  r  s      r   r  zDispatcher.connect  sV    		"49di88$T**).&r   c                 J    	 | j                                          d S #  Y d S xY wr   )rG  r   r   s    r   r  zDispatcher.close  s1    	K,,.....	DDs    "N)r   r   r   r   r  r  r   r   r   rV  rV    sA                r   rV  c                   ~    e Zd Zd Z eej                  d             Z eej                  d             Zd Z	dS )rY  c                     || _         t          j        | t                      | j         j        t
          t                     d S )N)r   r   )
dispatcherru   r   rw   r  r   r   )r   r]  s     r   r   zDispatchReader.__init__  sG    $!!O"&? 3	
 	
 	
 	
 	
 	
r   c                 ^    t          j                    }d|_        t          j        |           S r  )r   r  rY  ru   r   )r   dummy_threads     r   r   zDispatchReader._on_run  s)     /11.3+#D)))r   c                     | j         s`t          j        |            	 | j                            t
                     n#  Y nxY w	 | j                                         d S #  Y d S xY wd S r   )r   ru   r   r  shutdownr   r  r   s    r   r   z#DispatchReader.do_kill_pydev_thread  s    " 		-d333	""9----	!!!!!		 		s   = AA   A%c                 V    |dk    r"t          |          | j        _        d| _        d S d S )Nc   T)r  r]  r  r   )r   cmd_idr  texts       r   process_commandzDispatchReader.process_command  s0    R<<#&t99DO "&D <r   N)
r   r   r   r   r   ru   r   r   r   rf  r   r   r   rY  rY    s        	
 	
 	
 Y|#$$* * %$*
 Y455
 
 65
' ' ' ' 'r   rY  r5  c                     t           j        } | d         }| d         }t          t          k    rZt	                      }	 |                    ||           |j        }|                                 n# |                                 w xY w||fS )Nr  r  )r  r  DISPATCH_APPROACH%DISPATCH_APPROACH_EXISTING_CONNECTIONrV  r  r  r  )r  r  r  r]  s       r   dispatchrj    s    E?D=DAAA\\
	tT***?DJ:s   A. .Bc           
         ddl m} |j        }|	i |_        d}d|_        dt	          j                    _        t          j        }|i }n-t                      
                                |t          j        <   |                    d          }|                    d          }| rddlm} t!                      \  }}ddl}	 |	j                     | r5|5t'                       |
 |             t)          ||dddd||	           dS dS dS )
zo
    When creating a fork from a process in the debugger, we need to reset the whole debugger environment!
    r   )GlobalDebuggerHolderNrH  rI  )clear_thread_local_infoFT)r  r&  r=  r>  r*  r+  r,  )_pydevd_bundle.pydevd_constantsrl  
global_dbgrI  r   r  rj  r  r  r   get_ppidr   ARGUMENT_PPIDr  )_pydevd_frame_eval.pydevd_frame_eval_mainrm  rj  rD  rS  rN   r   )
setup_tracingrl  r   r  r+  r,  rm  r  r  rD  s
             r   settrace_forkedrt    sb    EDDDDD +E,.)&*#15I. E} 1:0D0D0F0F,-99^,,L))$9::  UUUUUUZZ
d-N-/// (***&2'')))*/%)&*)$7	 	 	 	 	 	 r   c               #   x   K   ddl m}  |                                 5  dV  ddd           dS # 1 swxY w Y   dS )z
    May be used to skip the monkey-patching that pydevd does to
    skip changing arguments to embed the debugger into child processes.

    i.e.:

    with pydevd.skip_subprocess_arg_patch():
        subprocess.call(...)
    r   rB  N)r  rC  skip_subprocess_arg_patchrB  s    r   rv  rv     s       +*****		/	/	1	1                   s   /33c                 ^    t                      }||j                            |            dS dS )a$  
    May be used to ask pydevd to skip the termination of some process
    when it's asked to terminate (debug adapter protocol only).

    :param int pid:
        The pid to be ignored.

    i.e.:

    process = subprocess.Popen(...)
    pydevd.add_dont_terminate_child_pid(process.pid)
    N)rw   r  add)pidr   s     r   add_dont_terminate_child_pidrz  1  s:      !!E'++C00000 r   c                       e Zd ZdZdS )r  N)r   r   r   r  r   r   r   r  r  C  s        EEEr   r  c                 ^   ddd}|                     |            |} t                      }| d         r[t          j                    t          j        j        k    r t          j                            d           nddl	m
}  |            |_        | d         rt          | d                    d	S d	S )
z/

    :type setup_options: dict[str, bool]
    Fr   )save-signatures
qt-supportr}  zACollecting run-time type information is not supported for Jython
r   )SignatureFactoryr~  N)updaterw   r   get_vm_typePydevdVmTypeJYTHONr   r  r  _pydevd_bundle.pydevd_signaturer  ro  r	  )setup_optionsdefault_optionsdebuggerr  s       r   apply_debugger_optionsr  G  s    
 +0rBBO=)))#M"$$H&' <%''>+F+MMMJabbbb IHHHHH)9)9););H&\" 7-5666667 7r   c                  <    t          d t          t                     d S r   )_internal_patch_stdinr   getpass_modr   r   r   rN  rN  ^  s    $[11111r   c                     j         t          |           _         |j        t          j                  fd            }||_        dS )z
    Note: don't use this function directly, use `patch_stdin()` instead.
    (this function is only meant to be used on test-cases to avoid patching the actual globals).
    c                      t          j                  5  	 j        }|u r_         | i ||_        cd d d            S # |_        w xY w# 1 swxY w Y   d S r   )r    notify_input_requestedstdin)r   r   
curr_stdin_original_getpassdebug_console_stdinoriginal_sys_stdinr   s      r   getpassz&_internal_patch_stdin.<locals>.getpasso  s    56IJJ 	' 	'' Y
!444 2CI(($9&99&		' 	' 	' 	' 	' 	' 	' 	' '	&&&&	' 	' 	' 	' 	' 	' 	' 	' 	' 	's'   AAA	AAAAN)r  r    r  	functoolswraps)r   r   r  r  r  r  r  s    `  @@@r   r  r  c  s     +E3EFF#CI#+_&''' ' ' ' ' ' ' ('' "Kr   )debugger_versionr   log_filer  c                 0    t          j        | |           dS )a  
    In pydevd it's possible to log by setting the following environment variables:

    PYDEVD_DEBUG=1 (sets the default log level to 3 along with other default options)
    PYDEVD_DEBUG_FILE=</path/to/file.log>

    Note that the file will have the pid of the process added to it (so, logging to
    /path/to/file.log would actually start logging to /path/to/file.<pid>.log -- if subprocesses are
    logged, each new subprocess will have the logging set to its own pid).

    Usually setting the environment variable is preferred as it'd log information while
    pydevd is still doing its imports and not just after this method is called, but on
    cases where this is hard to do this function may be called to set the tracing after
    pydevd itself is already imported.
    N)r   log_to)r  	log_levels     r   r  r    s      Xy)))))r   c                  T   t          j        dt          j        f           t          j        dt	          j                               t          j        dt                     t          j        dt                     t          j        dt          t          t                               d S )NzInitial arguments: %szCurrent pid: %szUsing cython: %szUsing frame eval: %sz:Using gevent mode: %s / imported gevent module support: %s)r   r   r   r  r   getpidr\   rb   rH   r  r   r   r   r   _log_initial_infor    s    O+ch[999O%ry{{333O&555O*,<===OPR`bf  hA  cB  cB  C  C  C  C  Cr   r   c                 |    t          j        d| ||           | t          _        |t          _        |t          _        d S )Nz3Config: protocol: %s, debug_mode: %s, preimport: %s)r   r   rL   r]  
DEBUG_MODE	PREIMPORT)r@  
debug_mode	preimports      r   configr    s<    OI8U_ajkkk+3(%/"$-!!!r   c                  ~   t                       t          j        d d          } 	 ddlm}  |t          j                  }|t
          _        n2# t          $ r% t          j	                     t          d           Y nw xY w|                    d          }|r|t          j        _        |                    d          }|r|t          j        _        |                    d          }|                    d          }|r3t           j        |k    r#t%          |||nd           t                       n||t           _        t          j        d	|            |d
         rC	 dt+          j                    z  }n	#  d}Y nxY wt          j                            d|z             t          j        d|d                    t          j        dt          j        f           t3          j        |                    dd                      |d         }|d         }	|d         }
d}t7                      }|t9                      }	 ddlm} |d         r|                                 n2|d         rt          j        d           t@          a!tE                      }	 |#                    |	|           |j$        u|j$        }t          j        d|           t          j%        dt+          j                    z             	 |                                 n/#  t          j	        d           Y nxY wt          j&        d           |'                                 nD# |'                                 w xY w	 |(                                 n#  t          j	        d           Y nxY w|
)                    d          dk    rt*          j*        +                    |
          ,                    d          rt*          j*        -                    |
          }t*          j*        .                    |d          }t*          j*        /                    |          rF	 ta          |d           }	 |1                                2                                D ]}|3                                }|,                    d!          r|d"d          3                                }|4                    d#d          }|5                    d$          }tm          |d                   dk    rd%}n4tm          |d                   dk    rtm          |d                   d&k    rd%} n|'                                 n# |'                                 w xY wn"#  t          j	                     Y nxY wn#  Y nxY w	 dd'l7m8} |9                                 n8#  	 tu          t          d(          rt          j;                     n#  Y nxY wY nxY w|d)         }|d*         sty                       |tz          j>                 r)t                      @                    |dt                     n|tz          jB                 r)t                      @                    |dt                     n|tz          jD                 r.t                      @                    |dtz          jE                   n?|tz          jF                 r-t                      @                    |dtz          jG                   |d+         }|r||jH        _I        |d,         }|r||jH        _J        |r,t          j                            d-           t*          j*        -                    t                    }t*          j*        .                    |d.          }t          j        L                    dd/|z              dd lM}t          |d0<   t          j        L                    d1d2|N                    |          z             t          j        L                    dd3           t          j        L                    d4d5           |O                    |d         d d |d6           d S |d7         rt                      |_Q        |d8         rt                      |_S        t          |           	 |#                    |	|           nT#  t          j                            d9|	d:|d;           t          j	                     t          jU        d           Y nxY w|O                    |d         d d |          }|d<         r|V                    |           d S d S )=Nr   )process_command_liner5  r  z
debug-modez	log-levelzlog-filer   zOriginal sys.argv: %szprint-in-debugger-startupz
 (pid: %s)r   zpydev debugger: starting%s
zExecuting file %sr  zarguments: %svm_typer  r  FrB  rF  	multiproczStarted in multiproc mode
zReceived port %d
z)pydev debugger: process %d is connecting
z!Error patching process functions.z8pydev debugger: couldn't get port for new debug process.zdev_appserver.pyr   VERSIONrzrelease:   "r   Tr   )pydevd_stacklessr  r  rG  rH  rI  z6pydev debugger: google app engine integration enabled
z!pydev_app_engine_debug_startup.pyz--python_startup_script=r  r   z--python_startup_args=%sz--automatic_restart=no   z--max_module_instances=1)r  zsave-threadingzsave-asynciozCould not connect to z: r  zcmd-line)Wr  r   r  +_pydevd_bundle.pydevd_command_line_handlingr  r  r  r  r   r   r  r  r   rL   r  r  r5   PYDEVD_DEBUG_FILEr  r  r   r   r  r  r  r   rL  rw   r:  r  rC  rJ  ri  rh  rV  r  r  r   r1  r  (patch_new_process_functions_with_warningfindr  r-  r)  r1  r   r  r  read
splitlinesstripreplacer  r  r  r  patch_stacklessr   r  rN  r   ARGUMENT_JSON_PROTOCOLr   r\  r@   ARGUMENT_HTTP_JSON_PROTOCOLrB   ARGUMENT_HTTP_PROTOCOLHTTP_PROTOCOLARGUMENT_QUOTED_LINE_PROTOCOLQUOTED_LINE_PROTOCOLrF  r+  r,  r  r  jsondumpsr  rd   r  re   r  r  r  r  )original_argvr  r  r  r  log_trace_levelnew_debug_filery  r  r  r  fix_app_engine_debugr  rC  r]  appserver_dirversion_filer  r  versionr  r  r+  r,  curr_dirapp_engine_startup_filer  r  s                               r   mainr    s	   HQQQKMTTTTTT$$SX..!   a 		+&&I B8A+5<((J D9C+6ii,,O YYz**N </;~MM 	~/2MSTUUU		$,;)O+];;;() ?	,CC	CCC
7#=>>>O'v777OOch[111eii	488999=D?DfA "$$H66=2......   8	2446666; 5	2O9::: E#J#""4...?.%?DO$8$???N#ORTR[R]R]#]^^^Q$@@BBBBQ!+,OPPPPP&'abbb  """"
  """"IEEGGGGI#$GHHHHH vv())R//7##A&&112DEE 2$&GOOA$6$6M#%7<<y#I#ILw~~l33 22%),%<%<F/,2KKMM,D,D,F,F !. !.D+/::<<D'+z'B'B %./3ABBx~~/?/?26,,sB2G2G29--2D2D+.wqz??Q+>+>CG,@,@-0__-A-A/271:!/C/CGK0D(-%. !'2%/11111wx 	433333((****	sK((  	DhI$% 45 
U  1m<<<<	;	< U  1.@AAAA	6	7 U  1.>.LMMMM	=	> U  1.>.STTT(L </;, 56 J6I3 $0
RSSS7??8,,"$',,x9\"]"]58OOPPP"h&E):)::	
 	
 	
 	34445666 	U6]D$	UKKKKK!" 	9'6'8'8H$  	8(5H%u%%%	T4((((	JdddKLLL!!!HQKKKKK,,uV}dD)DD 	0&&w/////	0 	0s   'A ,A;:A;E0 0E67V A!M	 /L M	 LM	 	M#M8 8N U+ C+U <U+ U''U+ +VV
V) )W,(WWWWb, ,Ac=r  r   )r   )r   r   FNN)NFFr1  TFFFNTTr   r   NNTNr  r  )r   )r   r   r   (  r  r   r   RuntimeErrorr   r  r1  rn   r  this_dirr  r  r  r   typingr   r   typesr	   r  r  r  collectionsr
   
contextlibr   r  r   r   r
  r   r  r  r:  &_pydevd_bundle.pydevd_dont_trace_filesr   r   r   (_pydev_bundle._pydev_filesystem_encodingr   #_pydev_bundle.pydev_is_thread_aliver   _pydev_bundle.pydev_overrider   "_pydev_bundle._pydev_saved_modulesr   r   r   r   r   r   _pydevd_bundle.pydevd_filteringr   r   r   r   r   r   r   !_pydev_bundle.pydev_console_utilsr    ,_pydevd_bundle.pydevd_additional_thread_infor!   r"   !_pydevd_bundle.pydevd_breakpointsr#   r$   $_pydevd_bundle.pydevd_comm_constantsr%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   rn  r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   _pydevd_bundle.pydevd_defaultsrL   #_pydevd_bundle.pydevd_custom_framesrM   rN   rO   rP   rQ   rR   #_pydevd_bundle.pydevd_extension_apirS   !_pydevd_bundle.pydevd_frame_utilsrT   rU   rV   -_pydevd_bundle.pydevd_net_command_factory_xmlrW   $_pydevd_bundle.pydevd_trace_dispatchrX   r?  rY   rZ   r[   r\   _pydevd_bundle.pydevd_utilsr]   r^   r_   rr  r`   ra   rb   pydev_ipython$_pydevd_bundle.pydevd_source_mappingrc   D_pydevd_bundle.pydevd_concurrency_analyser.pydevd_concurrency_loggerrd   re   rf   rg   A_pydevd_bundle.pydevd_concurrency_analyser.pydevd_thread_wrappersrh   ri   rj   rk   rl   rm   os.pathr  rD  _pydevd_bundle.pydevd_commro   rp   rq   rr   rs   rt   ru   rv   rw   rx   ry   rz   r{   r|   r}   r~   #_pydevd_bundle.pydevd_daemon_threadr   r   ._pydevd_bundle.pydevd_process_net_command_jsonr   )_pydevd_bundle.pydevd_process_net_commandr   !_pydevd_bundle.pydevd_net_commandr   r   r   +_pydevd_bundle.pydevd_collect_bytecode_infor   r   r   &_pydevd_bundle.pydevd_suspended_framesr   socketr   _pydevd_bundle.pydevd_apir   _pydevd_bundle.pydevd_timeoutr   &_pydevd_bundle.pydevd_thread_lifecycler   r   _pydevd_sys_monitoringr   r   log_gevent_debug_infor   r   __version_info____version_info_str__vr  r#  r   __version__r   "_pydevd_bundle.pydevd_plugin_utilsr   	enumeraterb  r  r  encoder  r  file_system_encodingr>  r   GEVENT_SHOW_PAUSED_GREENLETSr   r  r   r   objectr   r  r)  r:  r  r  r  r	  r  r  r  r  r  r,  r.  r0  r   r9  r:  r  rV  rY   DISPATCH_APPROACH_NEW_CONNECTIONri  rh  rj  rt  rv  rz  r  r  rN  r  extensions_of_typehandleron_debugger_modules_loadedr  r  r  r  remover  r   r   r   r   <module>r     s    


BQB&  
, 	V   
			 7??27??84455 8        , + + + + + " " " " " " " "        



 				 # # # # # # % % % % % %                            O O O O O O 2 2 2 2 2 2 2 2 J J J J J J ? ? ? ? ? ? 2 2 2 2 2 2 V V V V V V V V V V V V E E E E E E E E M M M M M M M M E E E E E E E E E E ' ' ' ' ' ' ' ' ' ' ' ' ? ? ? ? ? ? k k k k k k k k [ [ [ [ [ [ [ [                                                                                     6 ? > > > > > c c c c c c c c d d d d d d d d d d d d D D D D D D n n n n n n n n n n K K K K K K              q p p p p p p p p p m m m m m m m m m m     > > > > > >            [ Z Z Z Z Z         
 < ; ; ; ; ; ; ; . . . . . .     F  F  F  F  F  F  F  F  F  F  F  F                            _ ^ ^ ^ ^ ^ ^ ^ T T T T T T I I I I I I J J J J J J J J I I I I I I J  J  J  J  J  J  J  J  J  J I I I I I I       / / / / / / 8 8 8 8 8 8 ] ] ] ] ] ] ] ] =<<<<<<   	::<<<<<< 	8!79999
	\	
 	
 	
 	
 	
 % NMMMMMM  	 ( (AA''''hh+,,
"7 "7 "7 "7L      < < < < < <( "1 	NN7	D$) !$) !,,..   	*,<,K L L L 	8:J:g h h h 	%rwx'@'@ A A A 	?AQAu v v v7 [IO02B2YZZZ&/ &/ &/ &/ &/( &/ &/ &/Z- - - - -' - - -`z5 z5 z5 z5 z5 z5 z5 z5z* * * * *)K * * *Z#! #! #! #! #!f #! #! #!LG" G" G" G" G"6 G" G" G"TD    6   "; ; ;$  .. . .     F& & & &   @ @ @@ @ @ !'% '% '% '%T
8 
8 
8 
87 7 7 
	# #i
 i
 i
 i
X ,..V3 V3 V3r4 4 4D       (#' #' #' #' #'\ #' #' #'L $%  () %4   2 2 2 2j    1 1 1$       7 7 7. 2 2 2" " " "8 9%89MNN E EG&&&DDDD* *S *$ * * * *&C C C. . . .Q0 Q0 Q0h	 x|z!!!!! 	 	 	D	 zDFFFFF s*   J# #J7!L7 7L;0/U   U)(U)