There is the windbg command .frame
.frame (Set Local
Context)
The
.frame command specifies which local context (scope) is used to
interpret local variables or displays the current local context.
.frame [/c] [/r] [FrameNumber]
There is the function in the dbgeng.dll can help us to implement it.
IDebugSymbols3::SetScopeFrameByIndex method