
    Xh                     H    d Z ddlZddlZddlZddlZddlZddlmZ d Zd Z	y)zFProvides facilities to dump all stacks of all threads in the process.
    N)logc            	      (   t        j                         j                  } t        j                         }t        j                  d|       t        j                         j                         D ]  \  }}|| k(  rt        j                         D ]+  }|j                  | k(  s|j                  }|j                  } n dx}}dj                  t        j                  |            }t        j                  d|||||        t        j                  d|       y)zJDump stacks of all threads in this process, except for the current thread.z!Dumping stacks for process {0}...z	<unknown> z8Stack of thread {0} (tid={1}, pid={2}, daemon={3}):

{4}z(Finished dumping stacks for process {0}.N)	threadingcurrent_threadidentosgetpidr   infosys_current_framesitems	enumeratenamedaemonjoin	tracebackformat_stack)tidpidt_identframett_namet_daemonstacks           I/var/www/html/myenv/lib/python3.12/site-packages/debugpy/common/stacks.pydumpr      s     
"
"
$
*
*C
))+CHH0#6--/557 
c>$$& 	,Aww#~88		, !,+FX	..u56H	

, HH7=    c                 j      fd}t        j                  |      }d|_        |j                          y)zKInvokes dump() on a background thread after waiting for the specified time.c                  |    t        j                          	 t                y #  t        j                          Y y xY w)N)timesleepr   r   swallow_exception)secss   r   dumperzdump_after.<locals>.dumper5   s,    

4	$F	$!!#s   
# ;)targetTN)r   Threadr   start)r%   r&   threads   `  r   
dump_afterr+   2   s*    $ V,FFM
LLNr   )
__doc__r	   r   r"   r   r   debugpy.commonr   r   r+    r   r   <module>r/      s)   
 
 
    >Br   