IDebugThread2::SetNextStatement

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

Sets the current instruction pointer to the given code context.

Syntax

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.

See also