
    +h                     x    d Z ddlZddlZddlZddlZddgZ ej                  d      Z G d de      Z	d
dZ
d	 Zy)zPThe debug module contains utilities and functions for better
debugging Gunicorn.    Nspewunspewz\W+c                       e Zd ZddZd Zy)SpewNc                      || _         || _        y )Ntrace_namesshow_values)selfr	   r
   s      A/var/www/html/venv/lib/python3.12/site-packages/gunicorn/debug.py__init__zSpew.__init__   s    &&    c                 t   |dk(  r||j                   }d|j                  v r\|j                  d   }|j                  d      s|j                  d      r|d d }|j                  d   }t        j                  ||      }nd}	 t        j                  |      }||   }| j                  || j                  v rt        |d	|d
|j                                | j                  s| S g }	t        j!                  |      }
|
D ]e  }||j                  v r#|	j#                  |d|j                  |          ||j$                  v sC|	j#                  |d|j$                  |          g |	rt        ddj'                  |	      z         | S # t        $ r) d|j                  j                  |j                  fz  }Y w xY w)Nline__file__z.pycz.pyo__name__z	[unknown]z,Unknown code named [%s].  VM instruction #%d:z: =z	%s )f_lineno	f_globalsendswith	linecachegetlineinspectgetsourcelinesIOErrorf_codeco_namef_lastir	   printrstripr
   _token_splitersplitappendf_localsjoin)r   frameeventarglinenofilenamenamer   srcdetailstokenstoks               r   __call__zSpew.__call__   s   F?^^FU__, ??:6%%f- ))&1'}Hz2 ((6:"=!007Cv;D '443C3C+CT64;;=AB''K'--d3! MCeoo-#us7K'LMenn,#u~~c7J'KL	M
 &388G#445!  =I,,emmM= =D=s    F .F76F7)NT)r   
__module____qualname__r   r3    r   r   r   r      s    'r   r   c                 B    t        j                  t        | |             y)zpInstall a trace hook which writes incredibly detailed logs
    about what code is being executed to stdout.
    N)syssettracer   r   s     r   r   r   ;   s     LLk;/0r   c                  .    t        j                  d       y)z-Remove the trace hook installed by spew.
    N)r8   r9   r6   r   r   r   r   B   s     LLr   )NF)__doc__r8   r   rer   __all__compiler$   objectr   r   r   r6   r   r   <module>r@      sI      	 8
F#%6 %P1r   