Debugging Tools for Windows

GetOffsetExpression

The GetOffsetExpression and GetOffsetExpressionWide methods return the expression string that evaluates to the location that triggers a breakpoint.

HRESULT
  IDebugBreakpoint::GetOffsetExpression(
    OUT OPTIONAL PSTR  Buffer,
    IN ULONG  BufferSize,
    OUT OPTIONAL PULONG  ExpressionSize
    );

HRESULT
  IDebugBreakpoint2::GetOffsetExpressionWide(
    OUT OPTIONAL PWSTR  Buffer,
    IN ULONG  BufferSize,
    OUT OPTIONAL PULONG  ExpressionSize
    );

#ifdef UNICODE
#define GetOffsetExpressionT GetOffsetExpressionWide
#else
#define GetOffsetExpressionT GetOffsetExpression
#endif

Parameters

Buffer
The expression string that evaluates to the location on the target that triggers the breakpoint. If Buffer is NULL, this information is not returned.
BufferSize
The size, in characters, of the buffer that Buffer points to.
ExpressionSize
The size, in characters, of the expression string. If ExpressionSize is NULL, this information is not returned.

Return Value

GetOffsetExpression and GetOffsetExpressionWide 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 expression string and so the string was truncated to fit.

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

Comments

The expression is evaluated every time that a module is loaded or unloaded. If the debugger cannot evaluate the expression (for example, if the expression contains a symbol that cannot be interpreted), the breakpoint is flagged as deferred. (For more information about deferred breakpoints, see Controlling Breakpoint Flags and Parameters.)

The GetParameters method also returns the size of the expression string that specifies the location that triggers the breakpoint, ExpressionSize.

For more information about how to use breakpoints, see Using Breakpoints.

Requirements

Versions: GetOffsetExpression is available in all versions of IDebugBreakpoint. GetOffsetExpressionWide is available in IDebugBreakpoint2 and later versions.

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

Build machine: CAPEBUILD