Debugger3.BreakpointLastHit Property
Gets the last breakpoint hit.
Assembly: EnvDTE90 (in EnvDTE90.dll)
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:
-
Set several breakpoints in the target application.
-
Run the target application in the debug mode.
-
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); }
- 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.