<meta charset="utf-8"><span class="Apple-style-span" style="border-collapse: collapse; color: rgb(51, 51, 51); font-family: arial, sans-serif; font-size: 13px; ">Hi,<div><br></div><div>Is there a way to mimic gdb's "return <expr>" command?</div>
<div><br></div><div><div>(gdb) help return</div><div><div>Make selected stack frame return to its caller.</div><div>Control remains in the debugger, but when you continue</div><div>execution will resume in the frame above the one now selected.</div>
<div>If an argument is given, it is an expression for the value to return.</div></div></div><div><br></div><div><br></div><div>I've been looking at the StackFrame class, but it doesn't look like it can do that.</div>
<div>If I wanted to implement it, where should I look first? I can get the return address (StackFrame.GetRegisterContext().get().GetReturnAddress(), I think) write it to the PC (StackFrame.ChangePC()), but I have no idea how to get the expression's result into the return registers/memory. ClangExpression isn't a big help there, since the result comes to debugger-land.</div>
<div><br></div><div>Regards,</div><div><br></div><div> Filipe</div></span>