
    %
i                         d Z ddlZddlmZmZmZ ddlmZmZm	Z	  G d dej
                  Z
 G d d	ej                  Z G d
 d          Z G d d          ZdS )z\Support for stack-frames.

Provides Implements a nearly complete wrapper for a stack frame.
    N   )axdebugexpressionsgateways)RaiseNotImpl_wraptracec                   $    e Zd ZdZd Zd Zd ZdS )EnumDebugStackFrameszcA class that given a debugger object, can return an enumerator
    of DebugStackFrame objects.
    c                    g }|j         }|r|j                            |j        j                  }|h	 |j        d         }n## t          $ r t          j                    }Y nw xY wt          ||j
        dz
  |          ||dz   dd f}|                    |           |j        }|t          j                            | |d           d S )N__axstack_address__r   r   )currentframecodeContainerProviderFromFileNamef_codeco_filenamef_localsKeyErrorr   GetStackAddressDebugStackFramef_linenoappendf_backr   r   __init__)selfdebuggerinfosframeccaddress	frameInfos          C:\Users\Dell Inspiron 16\Desktop\tws\AgrotaPowerBi\back-agrota-powerbi\mcp-client-agrota\venv\Lib\site-packages\win32comext/axdebug/stackframe.pyr   zEnumDebugStackFrames.__init__   s    % 	! /<<U\=UVVB~8#n-BCGG 8 8 8 &577GGG8
 $E5>A+=rBBaK	 Y''' LE/  	!2 	%..tUA>>>>>s   A A! A!c                 B    t           j                            | |          S N)r   r   Next)r   counts     r"   r%   zEnumDebugStackFrames.Next6   s    ,11$>>>    c                     |\  }}}}}t          |t          j                  }|rt          |t          j                  }|||||fS r$   )r   r   IID_IDebugStackFrame	pythoncomIID_IUnknown)r   objobFrameminlimfFinalobFinals          r"   r   zEnumDebugStackFrames._wrap=   sO    -0*c67!=>> 	=GY%;<<GS&'11r'   N)__name__
__module____qualname____doc__r   r%   r    r'   r"   r   r      sL         ? ? ?D? ? ?2 2 2 2 2r'   r   c                   8    e Zd Zd Zd Zd Zd Zd Zd Zd Z	dS )	r   c                 >    || _         || _        || _        d | _        d S r$   )r   linenocodeContainerexpressionContext)r   r   r9   r:   s       r"   r   zDebugStackFrame.__init__G   s&    
*!%r'   c                     |t           j        k    rD| j        6t          t	          j        | j                  t           j                  | _        | j        S dS )Nr   )r   IID_IDebugExpressionContextr;   r   r   ExpressionContextr   )r   iids     r"   _query_interface_z!DebugStackFrame._query_interface_O   sS    '555%-).1$*==7* *& )) qr'   c                 $    t          d           dS )zoReturns the thread associated with this stack frame.

        Result must be a IDebugApplicationThread
        	GetThreadNr   r   s    r"   rB   zDebugStackFrame.GetThread]   s    
 	[!!!!!r'   c                 t    | j                             | j                  }| j                             |          S r$   )r:   GetPositionOfLiner9   GetCodeContextAtPosition)r   offsets     r"   GetCodeContextzDebugStackFrame.GetCodeContextd   s1    #55dkBB!::6BBBr'   c                     | j         j        j        }d}	 | j         j        j        r|| j         j        j        z  }n|dz  }|S )N r   z<lambda>)r   r   r   co_name)r   fLongfilenamess       r"   GetDescriptionStringz$DebugStackFrame.GetDescriptionStringj   sK    :$0	:$ 	"**AAOAr'   c                     |rdS dS )NzPython ActiveX Scripting EnginePythonr6   )r   rM   s     r"   GetLanguageStringz!DebugStackFrame.GetLanguageStringu   s     	448r'   c                 Z    t          t          | j                  t          j                  S r$   )r   StackFrameDebugPropertyr   r   IID_IDebugPropertyrD   s    r"   GetDebugPropertyz DebugStackFrame.GetDebugProperty{   s     ,TZ88':TUUUr'   N)
r2   r3   r4   r   r@   rB   rI   rP   rS   rW   r6   r'   r"   r   r   F   s        & & &
 
 
" " "C C C	 	 	  V V V V Vr'   r   c                   0    e Zd ZdgZej        gZd Zd ZdS )DebugStackFrameSnifferEnumStackFramesc                 2    || _         t          d           d S )Nz#DebugStackFrameSniffer instantiated)r   r	   )r   r   s     r"   r   zDebugStackFrameSniffer.__init__   s     344444r'   c                 x    t          d           t          t          | j                  t          j                  S )Nz-DebugStackFrameSniffer.EnumStackFrames called)r	   r   r   r   r   IID_IEnumDebugStackFramesrD   s    r"   rZ   z&DebugStackFrameSniffer.EnumStackFrames   s5    =>>> //1R
 
 	
r'   N)	r2   r3   r4   _public_methods_r   IID_IDebugStackFrameSniffer_com_interfaces_r   rZ   r6   r'   r"   rY   rY      sG        )*;<5 5 5
 
 
 
 
r'   rY   c                   J    e Zd Zej        gZg dZd Zd Zd Z	d Z
d Zd ZdS )	rU   )GetPropertyInfoGetExtendedInfoSetValueAsStringEnumMembers	GetParentc                     || _         d S r$   )r   )r   r   s     r"   r   z StackFrameDebugProperty.__init__   s    


r'   c                 $    t          d           d S )Nz(StackFrameDebugProperty::GetPropertyInforC   )r   dwFieldSpecnRadixs      r"   rb   z'StackFrameDebugProperty.GetPropertyInfo       ?@@@@@r'   c                 $    t          d           d S )Nz(StackFrameDebugProperty::GetExtendedInforC   rD   s    r"   rc   z'StackFrameDebugProperty.GetExtendedInfo   rk   r'   c                 $    t          d           d S )NzDebugProperty::SetValueAsStringrC   )r   valueradixs      r"   rd   z(StackFrameDebugProperty.SetValueAsString   s    677777r'   c                 x    t          d|||           ddlm}  |j        | j        j        |||| j                  S )Nre   r   )r   )printrK   r   MakeEnumDebugPropertyr   r   )r   ri   rj   r?   r   s        r"   re   z#StackFrameDebugProperty.EnumMembers   sQ    m[&#666!!!!!!0{0Jfc4:
 
 	
r'   c                 $    t          d           d S )NzDebugProperty::GetParentrC   rD   s    r"   rf   z!StackFrameDebugProperty.GetParent   s    /00000r'   N)r2   r3   r4   r   rV   r`   r^   r   rb   rc   rd   re   rf   r6   r'   r"   rU   rU      s        23    A A AA A A8 8 8
 
 
1 1 1 1 1r'   rU   )r5   r*   rK   r   r   r   utilr   r   r	   r   r   rY   rU   r6   r'   r"   <module>ru      s   
     , , , , , , , , , , , , , , , , , , , ,42 42 42 42 4288 42 42 42n6V 6V 6V 6V 6Vh. 6V 6V 6Vr
 
 
 
 
 
 
 
$!1 !1 !1 !1 !1 !1 !1 !1 !1 !1r'   