LLDB  mainline
ABISysV_arc.h
Go to the documentation of this file.
1 //===-- ArchitectureArc.h ---------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef liblldb_ABISysV_arc_h_
10 #define liblldb_ABISysV_arc_h_
11 
12 // Other libraries and framework includes
13 #include <llvm/ADT/Optional.h>
14 
15 // Project includes
16 #include "lldb/Target/ABI.h"
17 #include "lldb/lldb-private.h"
18 
20 public:
21  ~ABISysV_arc() override = default;
22 
23  size_t GetRedZoneSize() const override;
24 
26  lldb::addr_t functionAddress,
27  lldb::addr_t returnAddress,
28  llvm::ArrayRef<lldb::addr_t> args) const override;
29 
30  // Special thread plan for GDB style non-jit function calls.
31  bool
33  lldb::addr_t functionAddress, lldb::addr_t returnAddress,
34  llvm::Type &prototype,
35  llvm::ArrayRef<ABI::CallArgument> args) const override;
36 
38  lldb_private::ValueList &values) const override;
39 
41  SetReturnValueObject(lldb::StackFrameSP &frame_sp,
42  lldb::ValueObjectSP &new_value) override;
43 
44  lldb::ValueObjectSP
46  lldb_private::CompilerType &type) const override;
47 
48  // Specialized to work with llvm IR types.
49  lldb::ValueObjectSP GetReturnValueObjectImpl(lldb_private::Thread &thread,
50  llvm::Type &type) const override;
51 
52  bool
54 
55  bool CreateDefaultUnwindPlan(lldb_private::UnwindPlan &unwind_plan) override;
56 
57  bool RegisterIsVolatile(const lldb_private::RegisterInfo *reg_info) override;
58 
60  // Stack call frame address must be 4 byte aligned.
61  return (cfa & 0x3ull) == 0;
62  }
63 
65  // Code addresse must be 2 byte aligned.
66  return (pc & 1ull) == 0;
67  }
68 
69  const lldb_private::RegisterInfo *
70  GetRegisterInfoArray(uint32_t &count) override;
71 
72  //------------------------------------------------------------------
73  // Static Functions
74  //------------------------------------------------------------------
75 
76  static void Initialize();
77 
78  static void Terminate();
79 
80  static lldb::ABISP CreateInstance(lldb::ProcessSP process_sp,
81  const lldb_private::ArchSpec &arch);
82 
84 
85  //------------------------------------------------------------------
86  // PluginInterface protocol
87  //------------------------------------------------------------------
88 
90 
91  uint32_t GetPluginVersion() override;
92 
93 private:
94  lldb::ValueObjectSP
96  lldb_private::CompilerType &ast_type) const;
97 
99 
100  using lldb_private::RegInfoBasedABI::RegInfoBasedABI; // Call CreateInstance instead.
101 
102  using RegisterFileFlag = llvm::Optional<bool>;
104 };
105 
106 #endif // liblldb_ABISysV_arc_h_
ABISysV_arc::IsRegisterFileReduced
bool IsRegisterFileReduced(lldb_private::RegisterContext &reg_ctx) const
Definition: ABISysV_arc.cpp:146
lldb_private::ArchSpec
Definition: ArchSpec.h:33
ABISysV_arc::CodeAddressIsValid
bool CodeAddressIsValid(lldb::addr_t pc) override
Definition: ABISysV_arc.h:64
ABISysV_arc::PrepareTrivialCall
bool PrepareTrivialCall(lldb_private::Thread &thread, lldb::addr_t sp, lldb::addr_t functionAddress, lldb::addr_t returnAddress, llvm::ArrayRef< lldb::addr_t > args) const override
ABISysV_arc::CallFrameAddressIsValid
bool CallFrameAddressIsValid(lldb::addr_t cfa) override
Definition: ABISysV_arc.h:59
ABISysV_arc::GetPluginVersion
uint32_t GetPluginVersion() override
Definition: ABISysV_arc.cpp:617
ABISysV_arc::CreateFunctionEntryUnwindPlan
bool CreateFunctionEntryUnwindPlan(lldb_private::UnwindPlan &unwind_plan) override
Definition: ABISysV_arc.cpp:558
ABISysV_arc::GetPluginNameStatic
static lldb_private::ConstString GetPluginNameStatic()
Definition: ABISysV_arc.cpp:604
ABISysV_arc::RegisterIsVolatile
bool RegisterIsVolatile(const lldb_private::RegisterInfo *reg_info) override
Definition: ABISysV_arc.cpp:582
lldb_private::ValueList
Definition: Value.h:157
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
pc
@ pc
Definition: CompactUnwindInfo.cpp:1250
ABISysV_arc::m_is_reg_file_reduced
RegisterFileFlag m_is_reg_file_reduced
Definition: ABISysV_arc.h:103
ABI.h
ABISysV_arc::SetReturnValueObject
lldb_private::Status SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueObjectSP &new_value) override
Definition: ABISysV_arc.cpp:312
ABISysV_arc::Initialize
static void Initialize()
Definition: ABISysV_arc.cpp:595
ABISysV_arc::GetArgumentValues
bool GetArgumentValues(lldb_private::Thread &thread, lldb_private::ValueList &values) const override
Definition: ABISysV_arc.cpp:308
lldb_private::Thread
Definition: Thread.h:62
lldb_private::ConstString
Definition: ConstString.h:40
ABISysV_arc
Definition: ABISysV_arc.h:19
ABISysV_arc::CreateDefaultUnwindPlan
bool CreateDefaultUnwindPlan(lldb_private::UnwindPlan &unwind_plan) override
Definition: ABISysV_arc.cpp:578
ABISysV_arc::GetReturnValueObjectImpl
lldb::ValueObjectSP GetReturnValueObjectImpl(lldb_private::Thread &thread, lldb_private::CompilerType &type) const override
Definition: ABISysV_arc.cpp:501
sp
@ sp
Definition: CompactUnwindInfo.cpp:1249
lldb_private::RegInfoBasedABI
Definition: ABI.h:160
lldb_private::RegisterContext
Definition: RegisterContext.h:17
lldb-private.h
ABISysV_arc::GetRegisterInfoArray
const lldb_private::RegisterInfo * GetRegisterInfoArray(uint32_t &count) override
Definition: ABISysV_arc.cpp:139
ABISysV_arc::CreateInstance
static lldb::ABISP CreateInstance(lldb::ProcessSP process_sp, const lldb_private::ArchSpec &arch)
Definition: ABISysV_arc.cpp:164
lldb_private::Status
Definition: Status.h:44
uint32_t
ABISysV_arc::GetReturnValueObjectSimple
lldb::ValueObjectSP GetReturnValueObjectSimple(lldb_private::Thread &thread, lldb_private::CompilerType &ast_type) const
Definition: ABISysV_arc.cpp:447
ABISysV_arc::~ABISysV_arc
~ABISysV_arc() override=default
ABISysV_arc::Terminate
static void Terminate()
Definition: ABISysV_arc.cpp:600
ABISysV_arc::RegisterFileFlag
llvm::Optional< bool > RegisterFileFlag
Definition: ABISysV_arc.h:102
lldb_private::CompilerType
Generic representation of a type in a programming language.
Definition: CompilerType.h:33
ABISysV_arc::GetRedZoneSize
size_t GetRedZoneSize() const override
Definition: ABISysV_arc.cpp:144
lldb_private::UnwindPlan
Definition: UnwindPlan.h:53
ABISysV_arc::GetPluginName
lldb_private::ConstString GetPluginName() override
Definition: ABISysV_arc.cpp:613