Breakpoint-Related Methods
A debug engine (DE) must support the setting of breakpoints. Visual Studio debugging supports the following types of breakpoints:
Bound
Requested through the UI and successfully bound to a specified code location
Pending
Requested through the UI but not yet bound to actual instructions
Discussion
For example, a pending breakpoint occurs when the instructions are not yet loaded. When the code is loaded, pending breakpoints try to bind to code at the prescribed location, that is, to insert break instructions in the code. Events are sent to the session debug manager (SDM) to indicate successful binding or to notify that there were binding errors.
A pending breakpoint also manages its own internal list of corresponding bound breakpoints. One pending breakpoint can cause the insertion of many breakpoints in the code. The Visual Studio debugging UI shows a tree view of pending breakpoints and their corresponding bound breakpoints.
Creation and use of pending breakpoints require implementation of the IDebugEngine2::CreatePendingBreakpoint method as well as the following methods of IDebugPendingBreakpoint2 interfaces.
Method |
Description |
---|---|
Determines whether a specified pending breakpoint can bind to a code location. |
|
Binds a specified pending breakpoint to one or more code locations. |
|
Gets the state of a pending breakpoint. |
|
Gets the breakpoint request used to create a pending breakpoint. |
|
Toggles the enabled state of a pending breakpoint. |
|
Enumerates all breakpoints bound from a pending breakpoint. |
|
Enumerates all error breakpoints that result from a pending breakpoint. |
|
Deletes a pending breakpoint and all breakpoints bound from it. |
To enumerate the bound breakpoints and error breakpoints, you must implement all the methods of IEnumDebugBoundBreakpoints2 and of IEnumDebugErrorBreakpoints2.
Pending breakpoints that bind to a code location require implementation of the following IDebugBoundBreakpoint2 methods.
Method |
Description |
---|---|
Gets the pending breakpoint that contains a breakpoint. |
|
Gets the state of a bound breakpoint. |
|
Gets the breakpoint resolution that describes a breakpoint. |
|
Enables or disables a breakpoint. |
|
Deletes a bound breakpoint. |
Resolution and request information require implementation of the following IDebugBreakpointResolution2 methods.
Method |
Description |
---|---|
Gets the type of the breakpoint represented by a resolution. |
|
Gets the breakpoint resolution information that describes a breakpoint. |
Resolution of errors that might occur during binding requires implementation of the following IDebugErrorBreakpoint2 methods.
Method |
Description |
---|---|
Gets the pending breakpoint that contains an error breakpoint. |
|
Gets the breakpoint error resolution that describes an error breakpoint. |
Resolution of errors that might occur during binding also requires the following methods of IDebugErrorBreakpointResolution2.
Method |
Description |
---|---|
Gets the type of a breakpoint. |
|
Gets the resolution information of a breakpoint. |
Viewing the source code at a breakpoint requires you to implement the methods of IDebugStackFrame2::GetDocumentContext and/or the methods of IDebugStackFrame2::GetCodeContext.