[lldb-dev] Make a StackFrame return immediately

Filipe Cabecinhas filcab+lldb-dev at gmail.com
Mon Jul 18 17:23:07 PDT 2011


Hi,

Is there a way to mimic gdb's "return <expr>" command?

(gdb) help return
Make selected stack frame return to its caller.
Control remains in the debugger, but when you continue
execution will resume in the frame above the one now selected.
If an argument is given, it is an expression for the value to return.


I've been looking at the StackFrame class, but it doesn't look like it can
do that.
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.

Regards,

  Filipe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20110718/e62b2290/attachment.html>


More information about the lldb-dev mailing list