a „oe,ã@s„dZddlZddlmZddlmZmZmZddlm Z m Z m Z Gdd„dej ƒZ Gd d „d ej ƒZ Gd d „d ƒZGd d„dƒZdS)z\Support for stack-frames. Provides Implements a nearly complete wrapper for a stack frame. éN)Ú COMExceptioné)ÚaxdebugÚ expressionsÚgateways)Ú RaiseNotImplÚ_wrapÚtracec@s(eZdZdZdd„Zdd„Zdd„ZdS) ÚEnumDebugStackFrameszcA class that given a debugger object, can return an enumerator of DebugStackFrame objects. cCs–g}|j}|r‚|j |jj¡}|durzz|jd}WntyNt ¡}Yn0t ||j d|ƒ||dddf}|  |¡|j }q t j ||d¡dS)NZ__axstack_address__rr)Z currentframeZcodeContainerProviderZ FromFileNameÚf_codeÚ co_filenameÚf_localsÚKeyErrorrZGetStackAddressÚDebugStackFrameÚf_linenoÚappendÚf_backrr Ú__init__)ÚselfÚdebuggerZinfosÚframeZccZaddressZ frameInfo©rú?C:\Program Files\Certbot\pkgs\win32comext\axdebug\stackframe.pyrs$ û zEnumDebugStackFrames.__init__cCstj ||¡S©N)rr ÚNext)rÚcountrrrr7szEnumDebugStackFrames.NextcCs8|\}}}}}t|tjƒ}|r*t|tjƒ}|||||fSr)rrZIID_IDebugStackFrameÚ pythoncomZ IID_IUnknown)rÚobjZobFrameÚminZlimZfFinalZobFinalrrrr>s   zEnumDebugStackFrames._wrapN)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrrrrrrr s"r c@sDeZdZdd„Zdd„Zdd„Zdd„Zd d „Zd d „Zd d„Z dS)rcCs||_||_||_d|_dSr)rÚlinenoÚ codeContainerÚexpressionContext)rrr#r$rrrrHszDebugStackFrame.__init__cCs4|tjkr0|jdur*tt |j¡tjƒ|_|jSdS)Nr)rZIID_IDebugExpressionContextr%rrZExpressionContextr)rÚiidrrrÚ_query_interface_Ps   þz!DebugStackFrame._query_interface_cCs tdƒdS)zoReturns the thread associated with this stack frame. Result must be a IDebugApplicationThread Ú GetThreadN©r©rrrrr(^szDebugStackFrame.GetThreadcCs|j |j¡}|j |¡Sr)r$ZGetPositionOfLiner#ZGetCodeContextAtPosition)rÚoffsetrrrÚGetCodeContexteszDebugStackFrame.GetCodeContextcCs4|jjj}d}|jjjr(||jjj}n|d}|S)NÚz)rr r Úco_name)rÚfLongÚfilenameÚsrrrÚGetDescriptionStringks   z$DebugStackFrame.GetDescriptionStringcCs|rdSdSdS)NzPython ActiveX Scripting EngineÚPythonr)rr/rrrÚGetLanguageStringvsz!DebugStackFrame.GetLanguageStringcCstt|jƒtjƒSr)rÚStackFrameDebugPropertyrrÚIID_IDebugPropertyr*rrrÚGetDebugProperty|sz DebugStackFrame.GetDebugPropertyN) rr r!rr'r(r,r2r4r7rrrrrGs rc@s*eZdZdgZejgZdd„Zdd„ZdS)ÚDebugStackFrameSnifferÚEnumStackFramescCs||_tdƒdS)Nz#DebugStackFrameSniffer instantiated)rr )rrrrrr„szDebugStackFrameSniffer.__init__cCstdƒtt|jƒtjƒS)Nz-DebugStackFrameSniffer.EnumStackFrames called)r rr rrZIID_IEnumDebugStackFramesr*rrrr9Šs ÿz&DebugStackFrameSniffer.EnumStackFramesN) rr r!Ú_public_methods_rZIID_IDebugStackFrameSnifferÚ_com_interfaces_rr9rrrrr8€sr8c@sLeZdZejgZgd¢Zdd„Zdd„Zdd„Z dd „Z d d „Z d d „Z dS)r5)ÚGetPropertyInfoÚGetExtendedInfoÚSetValueAsStringÚ EnumMembersÚ GetParentcCs ||_dSr)r)rrrrrrœsz StackFrameDebugProperty.__init__cCs tdƒdS)Nz(StackFrameDebugProperty::GetPropertyInfor))rÚ dwFieldSpecÚnRadixrrrr<Ÿsz'StackFrameDebugProperty.GetPropertyInfocCs tdƒdS)Nz(StackFrameDebugProperty::GetExtendedInfor)r*rrrr=¢sz'StackFrameDebugProperty.GetExtendedInfocCs tdƒdS)NzDebugProperty::SetValueAsStringr))rÚvalueÚradixrrrr>¥sz(StackFrameDebugProperty.SetValueAsStringcCs2td|||ƒddlm}| |jj||||j¡S)Nr?r)r)Úprintr-rZMakeEnumDebugPropertyrr )rrArBr&rrrrr?©s  ÿz#StackFrameDebugProperty.EnumMemberscCs tdƒdS)NzDebugProperty::GetParentr)r*rrrr@±sz!StackFrameDebugProperty.GetParentN) rr r!rr6r;r:rr<r=r>r?r@rrrrr5’sr5)r"rZwin32com.server.exceptionrr-rrrÚutilrrr r rr8r5rrrrÚs 79