[Lldb-commits] [PATCH] For expression evaluation, a new ThreadPlanCallFunctionGDB for executing a function call on target via register manipulation.

Deepak Panickal deepak2427 at gmail.com
Fri Jul 25 10:04:04 PDT 2014


Hi,

We wanted to be able to call functions while debugging for Hexagon however this is only possible from lldb currently when there is JIT support.
Currently LLDB supports emulation via IR interpreting and executing on target via JIT however The IR interpretation is limited and cannot currently make function calls.

We have extended the IR interpreter so that it can execute a function call on target, via register manipulation. This is the same method
that is used by GDB for calling a function. This involved handling the Call IR instruction, passing arguments to a new thread plan and collecting any return values and
passing them back into the IR interpreter.

Several interfaces to the ABI were extended to allow more detailed information about arguments and return values when setting up a trivial call. See "ABI::PrepareTrivialCall".

Currently the expression evaluator checks if an expression can be interpreted and if it can it uses the IR interpreter, if it can't then it tries to JIT the expression and
run it on target. It seems however that for targets that can JIT, it would be better to use that when executing a function call since its presumably much more robust.
Perhaps this should be used exclusively for targets that cannot JIT?

http://reviews.llvm.org/D4672

Files:
  include/lldb/Expression/IRInterpreter.h
  include/lldb/Expression/IRMemoryMap.h
  include/lldb/Target/ThreadPlanCallFunctionGDB.h
  source/Expression/ClangUserExpression.cpp
  source/Expression/IRInterpreter.cpp
  source/Expression/IRMemoryMap.cpp
  source/Target/CMakeLists.txt
  source/Target/ThreadPlanCallFunction.cpp
  source/Target/ThreadPlanCallFunctionGDB.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4672.11884.patch
Type: text/x-patch
Size: 45898 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20140725/17b83615/attachment.bin>


More information about the lldb-commits mailing list