IDebugControl4::AddBreakpoint2 method (dbgeng.h)

The AddBreakpoint2 method creates a new breakpoint for the current target.

Syntax

HRESULT AddBreakpoint2(
  [in]  ULONG              Type,
  [in]  ULONG              DesiredId,
  [out] PDEBUG_BREAKPOINT2 *Bp
);

Parameters

[in] 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

[in] DesiredId

Specifies the desired ID of the new breakpoint. If it is DEBUG_ANY_ID, the engine will pick an unused ID.

[out] Bp

Receives an interface pointer to the new breakpoint.

Return value

Return code Description
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.

Remarks

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

Requirement Value
Target Platform Desktop
Header dbgeng.h (include Dbgeng.h)

See also

Breakpoints

IDebugBreakpoint

IDebugControl4

RemoveBreakpoint

Using Breakpoints