IDebugThread2::SetNextStatement
Sets the current instruction pointer to the given code context.
HRESULT SetNextStatement (
IDebugStackFrame2* pStackFrame,
IDebugCodeContext2* pCodeContext
);
int SetNextStatement (
IDebugStackFrame2 pStackFrame,
IDebugCodeContext2 pCodeContext
);
Parameters
pStackFrame
Reserved for future use; set to a null value.pCodeContext
[in] An IDebugCodeContext2 object that describes the code location about to be executed and its context.
Return Value
If successful, returns S_OK; otherwise, returns an error code. The following table shows other possible values.
Value |
Description |
---|---|
E_CANNOT_SET_NEXT_STATEMENT_ON_NONLEAF_FRAME |
The next statement cannot be in a stack frame deeper on the frame stack. |
E_CANNOT_SETIP_TO_DIFFERENT_FUNCTION |
The next statement is not associated with any frame in the stack. |
E_CANNOT_SET_NEXT_STATEMENT_ON_EXCEPTION |
Some debug engines cannot set the next statement after an exception. |
Remarks
The instruction pointer indicates the next instruction or statement to execute. This method is used to retry a line of source code or to force execution to continue in another function, for example.