Debugging Tools for Windows

GetCommand

The GetCommand and GetCommandWide methods return the command string that is executed when a breakpoint is triggered.

HRESULT
  IDebugBreakpoint::GetCommand(
    OUT OPTIONAL PSTR  Buffer,
    IN ULONG  BufferSize,
    OUT OPTIONAL PULONG  CommandSize
    );

HRESULT
  IDebugBreakpoint2::GetCommandWide(
    OUT OPTIONAL PWSTR  Buffer,
    IN ULONG  BufferSize,
    OUT OPTIONAL PULONG  CommandSize
    );

#ifdef UNICODE
#define GetCommandT GetCommandWide
#else
#define GetCommandT GetCommand
#endif

Parameters

Buffer
The command string that is executed when the breakpoint is triggered. If Buffer is NULL, this information is not returned.
BufferSize
The size, in characters, of the buffer that Buffer points to.
CommandSize
The size of the command string. If CommandSize is NULL, this information is not returned.

Return Value

GetCommand and GetCommandWide might return one of the following values:
S_OK
The method was successful.
S_FALSE
The method was successful, but the buffer was not large enough to hold the command string and so the command string was truncated to fit.

This method might also return error values. For more information about possible return values, see Return Values.

Comments

The command string is a list of debugger commands that are separated by semicolons. These commands are executed every time that the breakpoint is triggered. The commands are executed before the engine informs any event callbacks that the breakpoint has been triggered.

The GetParameters method also returns the size of the breakpoint's command, CommandSize.

For more information about breakpoint properties, see Controlling Breakpoint Flags and Parameters.

Requirements

Versions: GetCommand is available in all versions of IDebugBreakpoint. GetCommandWide is available in IDebugBreakpoint2 and later versions.

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

Build machine: CAPEBUILD