]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.h
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / source / Plugins / ABI / SysV-hexagon / ABISysV_hexagon.h
1 //===-- ABISysV_hexagon.h ----------------------------------------*- C++
2 //-*-===//
3 //
4 //                     The LLVM Compiler Infrastructure
5 //
6 // This file is distributed under the University of Illinois Open Source
7 // License. See LICENSE.TXT for details.
8 //
9 //===----------------------------------------------------------------------===//
10
11 #ifndef liblldb_ABISysV_hexagon_h_
12 #define liblldb_ABISysV_hexagon_h_
13
14 #include "lldb/Target/ABI.h"
15 #include "lldb/lldb-private.h"
16
17 class ABISysV_hexagon : public lldb_private::ABI {
18 public:
19   ~ABISysV_hexagon() override = default;
20
21   size_t GetRedZoneSize() const override;
22
23   bool PrepareTrivialCall(lldb_private::Thread &thread, lldb::addr_t sp,
24                           lldb::addr_t functionAddress,
25                           lldb::addr_t returnAddress,
26                           llvm::ArrayRef<lldb::addr_t> args) const override;
27
28   // special thread plan for GDB style non-jit function calls
29   bool
30   PrepareTrivialCall(lldb_private::Thread &thread, lldb::addr_t sp,
31                      lldb::addr_t functionAddress, lldb::addr_t returnAddress,
32                      llvm::Type &prototype,
33                      llvm::ArrayRef<ABI::CallArgument> args) const override;
34
35   bool GetArgumentValues(lldb_private::Thread &thread,
36                          lldb_private::ValueList &values) const override;
37
38   lldb_private::Status
39   SetReturnValueObject(lldb::StackFrameSP &frame_sp,
40                        lldb::ValueObjectSP &new_value) override;
41
42   lldb::ValueObjectSP
43   GetReturnValueObjectImpl(lldb_private::Thread &thread,
44                            lldb_private::CompilerType &type) const override;
45
46   // specialized to work with llvm IR types
47   lldb::ValueObjectSP GetReturnValueObjectImpl(lldb_private::Thread &thread,
48                                                llvm::Type &type) const override;
49
50   bool
51   CreateFunctionEntryUnwindPlan(lldb_private::UnwindPlan &unwind_plan) override;
52
53   bool CreateDefaultUnwindPlan(lldb_private::UnwindPlan &unwind_plan) override;
54
55   bool RegisterIsVolatile(const lldb_private::RegisterInfo *reg_info) override;
56
57   bool CallFrameAddressIsValid(lldb::addr_t cfa) override {
58     // Make sure the stack call frame addresses are 8 byte aligned
59     if (cfa & 0x07)
60       return false; // Not 8 byte aligned
61     if (cfa == 0)
62       return false; // Zero is not a valid stack address
63     return true;
64   }
65
66   bool CodeAddressIsValid(lldb::addr_t pc) override {
67     // We have a 64 bit address space, so anything is valid as opcodes
68     // aren't fixed width...
69     return true;
70   }
71
72   const lldb_private::RegisterInfo *
73   GetRegisterInfoArray(uint32_t &count) override;
74
75   //------------------------------------------------------------------
76   // Static Functions
77   //------------------------------------------------------------------
78
79   static void Initialize();
80
81   static void Terminate();
82
83   static lldb::ABISP CreateInstance(lldb::ProcessSP process_sp, const lldb_private::ArchSpec &arch);
84
85   static lldb_private::ConstString GetPluginNameStatic();
86
87   //------------------------------------------------------------------
88   // PluginInterface protocol
89   //------------------------------------------------------------------
90
91   lldb_private::ConstString GetPluginName() override;
92
93   uint32_t GetPluginVersion() override;
94
95 protected:
96   void CreateRegisterMapIfNeeded();
97
98   lldb::ValueObjectSP
99   GetReturnValueObjectSimple(lldb_private::Thread &thread,
100                              lldb_private::CompilerType &ast_type) const;
101
102   bool RegisterIsCalleeSaved(const lldb_private::RegisterInfo *reg_info);
103
104 private:
105   ABISysV_hexagon(lldb::ProcessSP process_sp) : lldb_private::ABI(process_sp) {
106     // Call CreateInstance instead.
107   }
108 };
109
110 #endif // liblldb_ABISysV_hexagon_h_