Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Sets or gets the current stack frame.
Namespace: EnvDTE
Assembly: EnvDTE (in EnvDTE.dll)
Syntax
'Declaration
Property CurrentStackFrame As StackFrame
StackFrame CurrentStackFrame { get; set; }
property StackFrame^ CurrentStackFrame {
StackFrame^ get ();
void set (StackFrame^ value);
}
abstract CurrentStackFrame : StackFrame with get, set
function get CurrentStackFrame () : StackFrame
function set CurrentStackFrame (value : StackFrame)
Property Value
Type: EnvDTE.StackFrame
A StackFrame object.
Remarks
CurrentStackFrame sets or returns a StackFrame object. See Memory Management: Frame Allocation for more information about the stack frame.
Examples
The following example demonstrates how to use the CurrentStackFrame property.
To test this property:
Set a breakpoint in the target application. Run the add-in.
The current stack frame is empty.
Set a breakpoint in the target application. Run the target application in the debug mode. When the program stops at the breakpoint, run the add-in.
The current stack frame contains the method name and the return type.
public static void CurrentStackFrame(DTE dte)
{
// Setup the debug Output window.
Window w = (Window)dte.Windows.Item(EnvDTE.Constants.vsWindowKindOutput);
w.Visible = true;
OutputWindow ow = (OutputWindow)w.Object;
OutputWindowPane owp = ow.OutputWindowPanes.Add("Current StackFrame Test");
owp.Activate();
owp.OutputString("Current Stack Frame Info: ");
EnvDTE.StackFrame sf = dte.Debugger.CurrentStackFrame;
if(sf == null)
owp.OutputString("No program is being debugged, Stack Frame is empty.");
else
owp.OutputString("Function " + sf.FunctionName +
" returns type " + sf.ReturnType);
}
Shared Sub CurrentStackFrame(ByRef dte As EnvDTE.DTE)
Dim sf As EnvDTE.StackFrame = dte.Debugger.CurrentStackFrame
If sf Is Nothing Then
MessageBox.Show("No program is being debugged, Stack Frame is empty.", _
"Debugger Test - Current Stack Frame Info")
Else
MessageBox.Show("Function " + sf.FunctionName + " returns type " + _
sf.ReturnType, "Debugger Test - Current Stack Frame Info")
End If
End Sub
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.