Debugging Tools for Windows

SetScope

The SetScope method sets the current scope.

HRESULT
  IDebugSymbols::SetScope(
    IN ULONG64  InstructionOffset,
    IN OPTIONAL PDEBUG_STACK_FRAME  ScopeFrame,
    IN OPTIONAL PVOID  ScopeContext,
    IN ULONG  ScopeContextSize
    );

Parameters

InstructionOffset
Specifies the location in the process's virtual address space for the scope's current instruction. This is only used if both ScopeFrame and ScopeContext are NULL; otherwise, it is ignored.
ScopeFrame
Specifies the scope's stack frame. For information about this structure, see DEBUG_STACK_FRAME.
ScopeContext
Specifies the scope's thread context. The type of the thread context is the CONTEXT structure for the target's effective processor. The buffer ScopeContext must be large enough to hold this structure. If ScopeContext is NULL, the current register context is used instead.
ScopeContextSize
Specifies the size of the buffer ScopeContext.

Return Value

S_OK
The scope identified by InstructionOffset, ScopeFrame, and ScopeContext is the same as the old scope.
S_FALSE
The scope has changed.

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

Interface Version

SetScope is available in all versions of IDebugSymbols.

Comments

If only InstructionOffset is provided, the scope can be used to look up symbol names; however, the values of these symbols will not be available.

To set the scope to a previous state, ScopeContext must be provided. This is not always necessary (for example, if you only wish to access the symbols and not the registers). To set the scope to a frame on the current stack, SetScopeFrameByIndex can be used.

For more information about scopes, see Scopes and Symbol Groups.

Requirements

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

See Also

GetScope, ResetScope, SetScopeFrameByIndex

Build machine: CAPEBUILD