1 //===-- ABISysV_hexagon.h ----------------------------------------*- C++
4 // The LLVM Compiler Infrastructure
6 // This file is distributed under the University of Illinois Open Source
7 // License. See LICENSE.TXT for details.
9 //===----------------------------------------------------------------------===//
11 #ifndef liblldb_ABISysV_hexagon_h_
12 #define liblldb_ABISysV_hexagon_h_
14 #include "lldb/Target/ABI.h"
15 #include "lldb/lldb-private.h"
17 class ABISysV_hexagon : public lldb_private::ABI {
19 ~ABISysV_hexagon() override = default;
21 size_t GetRedZoneSize() const override;
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;
28 // special thread plan for GDB style non-jit function calls
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;
35 bool GetArgumentValues(lldb_private::Thread &thread,
36 lldb_private::ValueList &values) const override;
39 SetReturnValueObject(lldb::StackFrameSP &frame_sp,
40 lldb::ValueObjectSP &new_value) override;
43 GetReturnValueObjectImpl(lldb_private::Thread &thread,
44 lldb_private::CompilerType &type) const override;
46 // specialized to work with llvm IR types
47 lldb::ValueObjectSP GetReturnValueObjectImpl(lldb_private::Thread &thread,
48 llvm::Type &type) const override;
51 CreateFunctionEntryUnwindPlan(lldb_private::UnwindPlan &unwind_plan) override;
53 bool CreateDefaultUnwindPlan(lldb_private::UnwindPlan &unwind_plan) override;
55 bool RegisterIsVolatile(const lldb_private::RegisterInfo *reg_info) override;
57 bool CallFrameAddressIsValid(lldb::addr_t cfa) override {
58 // Make sure the stack call frame addresses are 8 byte aligned
60 return false; // Not 8 byte aligned
62 return false; // Zero is not a valid stack address
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...
72 const lldb_private::RegisterInfo *
73 GetRegisterInfoArray(uint32_t &count) override;
75 //------------------------------------------------------------------
77 //------------------------------------------------------------------
79 static void Initialize();
81 static void Terminate();
83 static lldb::ABISP CreateInstance(lldb::ProcessSP process_sp, const lldb_private::ArchSpec &arch);
85 static lldb_private::ConstString GetPluginNameStatic();
87 //------------------------------------------------------------------
88 // PluginInterface protocol
89 //------------------------------------------------------------------
91 lldb_private::ConstString GetPluginName() override;
93 uint32_t GetPluginVersion() override;
96 void CreateRegisterMapIfNeeded();
99 GetReturnValueObjectSimple(lldb_private::Thread &thread,
100 lldb_private::CompilerType &ast_type) const;
102 bool RegisterIsCalleeSaved(const lldb_private::RegisterInfo *reg_info);
105 ABISysV_hexagon(lldb::ProcessSP process_sp) : lldb_private::ABI(process_sp) {
106 // Call CreateInstance instead.
110 #endif // liblldb_ABISysV_hexagon_h_