Partager via


Binding the Breakpoint

A pending breakpoint is a formal description of where and when to break into the execution of a program being debugged. A bound breakpoint is the actual mechanism that implements the where and when.

Once the session debug manager (SDM) has the pending breakpoint objects and execution is about to begin, the SDM calls IDebugPendingBreakpoint2::Bind to bind the breakpoints to the program being debugged. This binding step basically maps the breakpoints into the program being debugged so that when execution reaches that bound breakpoint, the program is stopped. The mapped breakpoints (bound breakpoints) are represented by the IDebugBoundBreakpoint2 interface.

Once the breakpoint has been bound, the SDM is notified of this fact with the IDebugBreakpointBoundEvent2 event. If the binding step fails, an IDebugBreakpointErrorEvent2 event is sent instead. This allows the SDM to notify Visual Studio so the IDE can notify the user about the success or failure of the requested breakpoints.

Discussion

In TextInterpreter, all breakpoints will be bound. but only the last breakpoint bound is retained. That is the breakpoint that will be encountered when the text program is “executed.”

In TextInterpreter, there is never an error in binding the breakpoint. so IDebugBreakpointErrorEvent2 is not implemented.

Note

The IDebugBreakpointBoundEvent2 interface uses an enumeration to access all breakpoints bound to the associated pending breakpoint. Creating the enumeration will be implemented at a later time.

Binding a breakpoint consists of the following steps:

  1. Implementing CBreakpointBoundEvent.

  2. Creating a Bound Breakpoint.

  3. Implementing IDebugPendingBreakpoint2::Bind.

See Also

Tasks

Tutorial: Building a Debug Engine Using ATL COM