xref: /freebsd/contrib/llvm-project/lldb/include/lldb/Target/ThreadPlanCallFunctionUsingABI.h (revision e25152834cdf3b353892835a4f3b157e066a8ed4)
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 LLDB_TARGET_THREADPLANCALLFUNCTIONUSINGABI_H
11 #define LLDB_TARGET_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 
21 namespace lldb_private {
22 
23 class 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.
30 public:
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 
42 protected:
43   void SetReturnValue() override;
44 
45 private:
46   llvm::Type &m_return_type;
47   ThreadPlanCallFunctionUsingABI(const ThreadPlanCallFunctionUsingABI &) =
48       delete;
49   const ThreadPlanCallFunctionUsingABI &
50   operator=(const ThreadPlanCallFunctionUsingABI &) = delete;
51 };
52 
53 } // namespace lldb_private
54 
55 #endif // LLDB_TARGET_THREADPLANCALLFUNCTIONUSINGABI_H
56