Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expression evaluation, a new ThreadPlanCallFunctionUsingABI for execu…
…ting 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
- Loading branch information
Showing
20 changed files
with
636 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
//===-- ThreadPlanCallFunctionUsingABI.h --------------------------------*- C++ -*-===// | ||
// | ||
// The LLVM Compiler Infrastructure | ||
// | ||
// This file is distributed under the University of Illinois Open Source | ||
// License. See LICENSE.TXT for details. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef liblldb_ThreadPlanCallFunctionUsingABI_h_ | ||
#define liblldb_ThreadPlanCallFunctionUsingABI_h_ | ||
|
||
// C Includes | ||
// C++ Includes | ||
// Other libraries and framework includes | ||
// Project includes | ||
#include "lldb/lldb-private.h" | ||
#include "lldb/Target/ABI.h" | ||
#include "lldb/Target/Thread.h" | ||
#include "lldb/Target/ThreadPlanCallFunction.h" | ||
|
||
#include "llvm/ADT/ArrayRef.h" | ||
#include "llvm/IR/Type.h" | ||
|
||
namespace lldb_private { | ||
|
||
class ThreadPlanCallFunctionUsingABI : public ThreadPlanCallFunction | ||
{ | ||
// Create a thread plan to call a function at the address passed in the "function" | ||
// argument, this function is executed using register manipulation instead of JIT. | ||
// Class derives from ThreadPlanCallFunction and differs by calling a alternative | ||
// ABI interface ABI::PrepareTrivialCall() which provides more detailed information. | ||
public: | ||
ThreadPlanCallFunctionUsingABI (Thread &thread, | ||
const Address &function_address, | ||
llvm::Type &function_prototype, | ||
llvm::Type &return_type, | ||
llvm::ArrayRef<ABI::CallArgument> args, | ||
const EvaluateExpressionOptions &options); | ||
|
||
~ThreadPlanCallFunctionUsingABI (); | ||
|
||
void | ||
GetDescription (Stream *s, lldb::DescriptionLevel level) override; | ||
|
||
protected: | ||
void | ||
SetReturnValue () override; | ||
|
||
|
||
private: | ||
llvm::Type &m_return_type; | ||
DISALLOW_COPY_AND_ASSIGN (ThreadPlanCallFunctionUsingABI); | ||
}; | ||
|
||
} // namespace lldb_private | ||
|
||
#endif // liblldb_ThreadPlanCallFunctionUsingABI_h_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.