[lldb-dev] Getting the address of a function

Filipe Cabecinhas filcab at gmail.com
Fri Jul 8 14:56:52 PDT 2011


Hi,

I'm trying to create an LLDB command that sets an internal breakpoint for a
function, and then executes some code, but I'm having come difficulties...

I've seen the expression command, which does something close to what I want
to do after the breakpoint, but I have some doubts. I want the code to be
able to return from the function where it's called, but the "
target->EvaluateExpression" doesn't let the code return from it (while I
would like to execute code with something like "if (condition) return NULL;
more code…"). Is there a way to compile arbitrary code (with return
statements) and execute it?

Is there a way to get a clang FunctionDecl from an Address obtained from a
BreakpointLocation?

My final purpose is to be able to redefine functions on-the-fly (with
caveats for inlined functions, etc). The only way I saw that could work was
this one… Did I miss another easier way?

Regards,

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


More information about the lldb-dev mailing list