Debugging Tools for Windows

AddBreakpoint

The AddBreakpoint and AddBreakpoint2 methods create a new breakpoint for the current target.

HRESULT
  IDebugControl::AddBreakpoint(
    IN ULONG  Type,
    IN ULONG  DesiredId,
    OUT IDebugBreakpoint * *  Bp
    );

HRESULT
  IDebugControl4::AddBreakpoint2(
    IN ULONG  Type,
    IN ULONG  DesiredId,
    OUT IDebugBreakpoint2 * *  Bp
    );

Parameters

Type
Specifies the breakpoint type of the new breakpoint. This can be either of the following values:
Value Description
DEBUG_BREAKPOINT_CODE software breakpoint
DEBUG_BREAKPOINT_DATA processor breakpoint

DesiredId
Specifies the desired ID of the new breakpoint. If it is DEBUG_ANY_ID, the engine will pick an unused ID.
Bp
Receives an interface pointer to the new breakpoint.

Return Value

S_OK
The method was successful.
E_INVALIDARG
The breakpoint couldn't be created with the desired ID or the value of Type was not recognized.

This method may also return other error values. See Return Values for more details.

Interface Version

AddBreakpoint is available in all versions of IDebugControl. AddBreakpoint2 is available in IDebugControl4 and later versions.

Comments

If DesiredId is not DEBUG_ANY_ID and another breakpoint already uses the ID DesiredId, these methods will fail.

Breakpoints are created empty and disabled. See Using Breakpoints for details on configuring and enabling the breakpoint.

The client is saved as the adder of the new breakpoint. See GetAdder.

Note  Even though IDebugBreakpoint extends the COM interface IUnknown, the lifetime of the breakpoint is not controlled using the IUnknown interface. Instead, the breakpoint is deleted after RemoveBreakpoint is called.

Requirements

Headers: Defined in Dbgeng.h. Include Dbgeng.h.

See Also

Breakpoints, Using Breakpoints, IDebugBreakpoint, RemoveBreakpoint

Build machine: CAPEBUILD