Expression evaluation, a new ThreadPlanCallFunctionUsingABI for executing a function...
authorEwan Crawford <ewan@codeplay.com>
Tue, 14 Jul 2015 10:56:58 +0000 (10:56 +0000)
committerEwan Crawford <ewan@codeplay.com>
Tue, 14 Jul 2015 10:56:58 +0000 (10:56 +0000)
commit90ff791141aad9165042d3b47115aab4cba0c462
tree018b313653746e8b5cb835517805355169a08dc8
parent469609a7145ff88486dfb6245f89fe70bcb2f1ac
Expression evaluation, a new ThreadPlanCallFunctionUsingABI for executing a function call on target via register manipulation

For Hexagon we want to be able to call functions during debugging, however currently lldb only supports this when there is JIT support.
Although emulation using IR interpretation is an alternative, it is currently limited in that it can't make function calls.

In this patch we have extended the IR interpreter so that it can execute a function call on the target using register manipulation.
To do this we need to handle the Call IR instruction, passing arguments to a new thread plan and collecting any return values to pass back into the IR interpreter.

The new thread plan is needed to call an alternative ABI interface of "ABI::PerpareTrivialCall()", allowing more detailed information about arguments and return values.

Reviewers: jingham, spyffe

Subscribers: emaste, lldb-commits, ted, ADodds, deepak2427

Differential Revision: http://reviews.llvm.org/D9404

llvm-svn: 242137
20 files changed:
lldb/include/lldb/Expression/IRInterpreter.h
lldb/include/lldb/Expression/IRMemoryMap.h
lldb/include/lldb/Target/ABI.h
lldb/include/lldb/Target/Process.h
lldb/include/lldb/Target/ThreadPlanCallFunction.h
lldb/include/lldb/Target/ThreadPlanCallFunctionUsingABI.h [new file with mode: 0644]
lldb/lldb.xcodeproj/project.pbxproj
lldb/source/Expression/ClangExpressionParser.cpp
lldb/source/Expression/ClangUserExpression.cpp
lldb/source/Expression/IRInterpreter.cpp
lldb/source/Expression/IRMemoryMap.cpp
lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp
lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp
lldb/source/Target/CMakeLists.txt
lldb/source/Target/Process.cpp
lldb/source/Target/ThreadPlanCallFunction.cpp
lldb/source/Target/ThreadPlanCallFunctionUsingABI.cpp [new file with mode: 0644]
lldb/test/expression_command/call-function/TestCallUserDefinedFunction.py [new file with mode: 0644]
lldb/test/expression_command/call-function/main.cpp