summaryrefslogtreecommitdiff
path: root/include/lldb/Target/ThreadPlanCallFunctionUsingABI.h
blob: c21e4d3cf3f7633377d9a6a56dd8c3aa57897669 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//===-- ThreadPlanCallFunctionUsingABI.h --------------------------------*- C++
//-*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef liblldb_ThreadPlanCallFunctionUsingABI_h_
#define liblldb_ThreadPlanCallFunctionUsingABI_h_

#include "lldb/Target/ABI.h"
#include "lldb/Target/Thread.h"
#include "lldb/Target/ThreadPlanCallFunction.h"
#include "lldb/lldb-private.h"

#include "llvm/ADT/ArrayRef.h"
#include "llvm/IR/DerivedTypes.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() override;

  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_