1//===-- ThreadPlanCallFunctionUsingABI.h --------------------------------*- C++
2//-*-===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef liblldb_ThreadPlanCallFunctionUsingABI_h_
11#define liblldb_ThreadPlanCallFunctionUsingABI_h_
12
13#include "lldb/Target/ABI.h"
14#include "lldb/Target/Thread.h"
15#include "lldb/Target/ThreadPlanCallFunction.h"
16#include "lldb/lldb-private.h"
17
18#include "llvm/ADT/ArrayRef.h"
19#include "llvm/IR/DerivedTypes.h"
20
21namespace lldb_private {
22
23class ThreadPlanCallFunctionUsingABI : public ThreadPlanCallFunction {
24  // Create a thread plan to call a function at the address passed in the
25  // "function" argument, this function is executed using register manipulation
26  // instead of JIT. Class derives from ThreadPlanCallFunction and differs by
27  // calling a alternative
28  // ABI interface ABI::PrepareTrivialCall() which provides more detailed
29  // information.
30public:
31  ThreadPlanCallFunctionUsingABI(Thread &thread,
32                                 const Address &function_address,
33                                 llvm::Type &function_prototype,
34                                 llvm::Type &return_type,
35                                 llvm::ArrayRef<ABI::CallArgument> args,
36                                 const EvaluateExpressionOptions &options);
37
38  ~ThreadPlanCallFunctionUsingABI() override;
39
40  void GetDescription(Stream *s, lldb::DescriptionLevel level) override;
41
42protected:
43  void SetReturnValue() override;
44
45private:
46  llvm::Type &m_return_type;
47  DISALLOW_COPY_AND_ASSIGN(ThreadPlanCallFunctionUsingABI);
48};
49
50} // namespace lldb_private
51
52#endif // liblldb_ThreadPlanCallFunctionUsingABI_h_
53