This topic has not yet been rated - Rate this topic

Debugger3.BreakpointLastHit Property

Gets the last breakpoint hit.

Namespace:  EnvDTE90
Assembly:  EnvDTE90 (in EnvDTE90.dll)
Breakpoint BreakpointLastHit { get; }

Property Value

Type: EnvDTE.Breakpoint
A Breakpoint object.

Implements

Debugger2.BreakpointLastHit

BreakpointLastHit gets a bound Breakpoint that was the last breakpoint hit by the debugger. If the debugger hit multiple breakpoints simultaneously, this property returns one of the breakpoints; it does not define which breakpoint is returned. To see a collection of multiple breakpoints hit simultaneously, see AllBreakpointsLastHit.

The following example shows how to use the BreakpointLastHit property.

To test this property:

  1. Set several breakpoints in the target application.

  2. Run the target application in the debug mode.

  3. When the application stops at the breakpoint, run the add-in.

public static void BreakpointLastHit(EnvDTE80.DTE2 dte)
{
    // Setup 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("Breakpoint Last 
    Hit Test");
    owp.Activate();

    EnvDTE90.Debugger3 debugger = (EnvDTE90.Debugger3)dte.Debugger;
    owp.OutputString("Breakpoint last hit: " +
                     debugger.BreakpointLastHit.Name);
}
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Advertisement