[memprof] Move YAML traits to MemProf.h (NFC) (#118668)
[llvm-project.git] / lldb / source / Plugins / ABI / ARM / ABISysV_arm.h
blob65bc3e0b62987f77518d933f8955d35eb02787a6
1 //===-- ABISysV_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 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_SOURCE_PLUGINS_ABI_ARM_ABISYSV_ARM_H
10 #define LLDB_SOURCE_PLUGINS_ABI_ARM_ABISYSV_ARM_H
12 #include "lldb/Target/ABI.h"
13 #include "lldb/lldb-private.h"
15 class ABISysV_arm : public lldb_private::RegInfoBasedABI {
16 public:
17 ~ABISysV_arm() override = default;
19 size_t GetRedZoneSize() const override;
21 bool PrepareTrivialCall(lldb_private::Thread &thread, lldb::addr_t sp,
22 lldb::addr_t func_addr, lldb::addr_t returnAddress,
23 llvm::ArrayRef<lldb::addr_t> args) const override;
25 bool GetArgumentValues(lldb_private::Thread &thread,
26 lldb_private::ValueList &values) const override;
28 lldb_private::Status
29 SetReturnValueObject(lldb::StackFrameSP &frame_sp,
30 lldb::ValueObjectSP &new_value) override;
32 bool
33 CreateFunctionEntryUnwindPlan(lldb_private::UnwindPlan &unwind_plan) override;
35 bool CreateDefaultUnwindPlan(lldb_private::UnwindPlan &unwind_plan) override;
37 bool RegisterIsVolatile(const lldb_private::RegisterInfo *reg_info) override;
39 bool CallFrameAddressIsValid(lldb::addr_t cfa) override {
40 // Make sure the stack call frame addresses 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;
48 bool CodeAddressIsValid(lldb::addr_t pc) override {
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;
55 lldb::addr_t FixCodeAddress(lldb::addr_t pc) override {
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;
61 const lldb_private::RegisterInfo *
62 GetRegisterInfoArray(uint32_t &count) override;
64 bool IsArmHardFloat(lldb_private::Thread &thread) const;
66 // Static Functions
68 static void Initialize();
70 static void Terminate();
72 static lldb::ABISP CreateInstance(lldb::ProcessSP process_sp, const lldb_private::ArchSpec &arch);
74 static llvm::StringRef GetPluginNameStatic() { return "SysV-arm"; }
76 // PluginInterface protocol
78 llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
80 protected:
81 lldb::ValueObjectSP
82 GetReturnValueObjectImpl(lldb_private::Thread &thread,
83 lldb_private::CompilerType &ast_type) const override;
85 private:
86 using lldb_private::RegInfoBasedABI::RegInfoBasedABI; // Call CreateInstance instead.
89 #endif // LLDB_SOURCE_PLUGINS_ABI_ARM_ABISYSV_ARM_H