LLDB  mainline
ABIMacOSX_arm.h
Go to the documentation of this file.
1 //===-- ABIMacOSX_arm.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 LLDB_SOURCE_PLUGINS_ABI_ARM_ABIMACOSX_ARM_H
10 #define LLDB_SOURCE_PLUGINS_ABI_ARM_ABIMACOSX_ARM_H
11 
12 #include "lldb/Target/ABI.h"
13 #include "lldb/lldb-private.h"
14 
16 public:
17  ~ABIMacOSX_arm() override = default;
18 
19  size_t GetRedZoneSize() const override;
20 
22  lldb::addr_t func_addr, lldb::addr_t returnAddress,
23  llvm::ArrayRef<lldb::addr_t> args) const override;
24 
26  lldb_private::ValueList &values) const override;
27 
29  SetReturnValueObject(lldb::StackFrameSP &frame_sp,
30  lldb::ValueObjectSP &new_value) override;
31 
32  bool
34 
35  bool CreateDefaultUnwindPlan(lldb_private::UnwindPlan &unwind_plan) override;
36 
37  bool RegisterIsVolatile(const lldb_private::RegisterInfo *reg_info) override;
38 
40  // Make sure the stack call frame addresses are are 4 byte aligned
41  if (cfa & (4ull - 1ull))
42  return false; // Not 4 byte aligned
43  if (cfa == 0)
44  return false; // Zero is not a valid stack address
45  return true;
46  }
47 
49  // Just make sure the address is a valid 32 bit address. Bit zero
50  // might be set due to Thumb function calls, so don't enforce 2 byte
51  // alignment
52  return pc <= UINT32_MAX;
53  }
54 
56  // ARM uses bit zero to signify a code address is thumb, so we must
57  // strip bit zero in any code addresses.
58  return pc & ~(lldb::addr_t)1;
59  }
60 
61  const lldb_private::RegisterInfo *
62  GetRegisterInfoArray(uint32_t &count) override;
63 
64  bool IsArmv7kProcess() const;
65 
66  // Static Functions
67 
68  static void Initialize();
69 
70  static void Terminate();
71 
72  static lldb::ABISP CreateInstance(lldb::ProcessSP process_sp, const lldb_private::ArchSpec &arch);
73 
75 
76  // PluginInterface protocol
77 
79 
80  uint32_t GetPluginVersion() override;
81 
82 protected:
83  lldb::ValueObjectSP
85  lldb_private::CompilerType &ast_type) const override;
86 
87 private:
88  using lldb_private::RegInfoBasedABI::RegInfoBasedABI; // Call CreateInstance instead.
89 };
90 
91 #endif // LLDB_SOURCE_PLUGINS_ABI_ARM_ABIMACOSX_ARM_H
ABIMacOSX_arm::RegisterIsVolatile
bool RegisterIsVolatile(const lldb_private::RegisterInfo *reg_info) override
Definition: ABIMacOSX_arm.cpp:1865
lldb_private::ArchSpec
Definition: ArchSpec.h:33
ABIMacOSX_arm::CreateFunctionEntryUnwindPlan
bool CreateFunctionEntryUnwindPlan(lldb_private::UnwindPlan &unwind_plan) override
Definition: ABIMacOSX_arm.cpp:1789
ABIMacOSX_arm::SetReturnValueObject
lldb_private::Status SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueObjectSP &new_value) override
Definition: ABIMacOSX_arm.cpp:1685
ABIMacOSX_arm::GetPluginNameStatic
static lldb_private::ConstString GetPluginNameStatic()
Definition: ABIMacOSX_arm.cpp:2029
ABIMacOSX_arm::CreateInstance
static lldb::ABISP CreateInstance(lldb::ProcessSP process_sp, const lldb_private::ArchSpec &arch)
Definition: ABIMacOSX_arm.cpp:1307
ABIMacOSX_arm
Definition: ABIMacOSX_arm.h:15
lldb_private::ValueList
Definition: Value.h:157
ABIMacOSX_arm::CreateDefaultUnwindPlan
bool CreateDefaultUnwindPlan(lldb_private::UnwindPlan &unwind_plan) override
Definition: ABIMacOSX_arm.cpp:1814
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
pc
@ pc
Definition: CompactUnwindInfo.cpp:1250
ABI.h
ABIMacOSX_arm::Terminate
static void Terminate()
Definition: ABIMacOSX_arm.cpp:2025
ABIMacOSX_arm::GetArgumentValues
bool GetArgumentValues(lldb_private::Thread &thread, lldb_private::ValueList &values) const override
Definition: ABIMacOSX_arm.cpp:1428
ABIMacOSX_arm::GetRedZoneSize
size_t GetRedZoneSize() const override
Definition: ABIMacOSX_arm.cpp:1302
lldb_private::Thread
Definition: Thread.h:62
ABIMacOSX_arm::FixCodeAddress
lldb::addr_t FixCodeAddress(lldb::addr_t pc) override
Some targets might use bits in a code address to indicate a mode switch.
Definition: ABIMacOSX_arm.h:55
lldb_private::ConstString
Definition: ConstString.h:40
ABIMacOSX_arm::Initialize
static void Initialize()
Definition: ABIMacOSX_arm.cpp:2020
sp
@ sp
Definition: CompactUnwindInfo.cpp:1249
ABIMacOSX_arm::IsArmv7kProcess
bool IsArmv7kProcess() const
Definition: ABIMacOSX_arm.cpp:1528
ABIMacOSX_arm::GetRegisterInfoArray
const lldb_private::RegisterInfo * GetRegisterInfoArray(uint32_t &count) override
Definition: ABIMacOSX_arm.cpp:1297
lldb_private::RegInfoBasedABI
Definition: ABI.h:160
lldb-private.h
ABIMacOSX_arm::~ABIMacOSX_arm
~ABIMacOSX_arm() override=default
lldb_private::Status
Definition: Status.h:44
ABIMacOSX_arm::CallFrameAddressIsValid
bool CallFrameAddressIsValid(lldb::addr_t cfa) override
Definition: ABIMacOSX_arm.h:39
uint32_t
ABIMacOSX_arm::CodeAddressIsValid
bool CodeAddressIsValid(lldb::addr_t pc) override
Definition: ABIMacOSX_arm.h:48
UINT32_MAX
#define UINT32_MAX
Definition: lldb-defines.h:31
ABIMacOSX_arm::GetPluginVersion
uint32_t GetPluginVersion() override
Definition: ABIMacOSX_arm.cpp:2040
lldb_private::CompilerType
Generic representation of a type in a programming language.
Definition: CompilerType.h:33
ABIMacOSX_arm::GetPluginName
lldb_private::ConstString GetPluginName() override
Definition: ABIMacOSX_arm.cpp:2036
ABIMacOSX_arm::PrepareTrivialCall
bool PrepareTrivialCall(lldb_private::Thread &thread, lldb::addr_t sp, lldb::addr_t func_addr, lldb::addr_t returnAddress, llvm::ArrayRef< lldb::addr_t > args) const override
Definition: ABIMacOSX_arm.cpp:1322
lldb_private::UnwindPlan
Definition: UnwindPlan.h:53
ABIMacOSX_arm::GetReturnValueObjectImpl
lldb::ValueObjectSP GetReturnValueObjectImpl(lldb_private::Thread &thread, lldb_private::CompilerType &ast_type) const override
Definition: ABIMacOSX_arm.cpp:1541