LLDB  mainline
ABIWindows_x86_64.h
Go to the documentation of this file.
1 //===-- ABIWindows_x86_64.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_X86_ABIWINDOWS_X86_64_H
10 #define LLDB_SOURCE_PLUGINS_ABI_X86_ABIWINDOWS_X86_64_H
11 
13 
14 class ABIWindows_x86_64 : public ABIX86_64 {
15 public:
16  ~ABIWindows_x86_64() override = default;
17 
18  size_t GetRedZoneSize() const override;
19 
21  lldb::addr_t functionAddress,
22  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  lldb::ValueObjectSP
34  lldb_private::CompilerType &type) const override;
35 
36  bool
38 
39  bool CreateDefaultUnwindPlan(lldb_private::UnwindPlan &unwind_plan) override;
40 
41  bool RegisterIsVolatile(const lldb_private::RegisterInfo *reg_info) override;
42 
43  // In Windows_x86_64 ABI, stack will always be maintained 16-byte aligned
45  if (cfa & (16ull - 1ull))
46  return false; // Not 16 byte aligned
47  if (cfa == 0)
48  return false; // Zero is not a valid stack address
49  return true;
50  }
51 
53  // We have a 64 bit address space, so anything is valid as opcodes
54  // aren't fixed width...
55  return true;
56  }
57 
58  bool GetPointerReturnRegister(const char *&name) override;
59 
60  //------------------------------------------------------------------
61  // Static Functions
62  //------------------------------------------------------------------
63 
64  static void Initialize();
65 
66  static void Terminate();
67 
68  static lldb::ABISP CreateInstance(lldb::ProcessSP process_sp, const lldb_private::ArchSpec &arch);
69 
70  static llvm::StringRef GetPluginNameStatic() { return "windows-x86_64"; }
71 
72  //------------------------------------------------------------------
73  // PluginInterface protocol
74  //------------------------------------------------------------------
75 
76  llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
77 
78 protected:
80 
81  lldb::ValueObjectSP
83  lldb_private::CompilerType &ast_type) const;
84 
85  bool RegisterIsCalleeSaved(const lldb_private::RegisterInfo *reg_info);
86  uint32_t GetGenericNum(llvm::StringRef reg) override;
87 
88 private:
89  using ABIX86_64::ABIX86_64; // Call CreateInstance instead.
90 };
91 
92 #endif // LLDB_SOURCE_PLUGINS_ABI_X86_ABIWINDOWS_X86_64_H
ABIWindows_x86_64::GetArgumentValues
bool GetArgumentValues(lldb_private::Thread &thread, lldb_private::ValueList &values) const override
Definition: ABIWindows_x86_64.cpp:230
ABIWindows_x86_64::GetRedZoneSize
size_t GetRedZoneSize() const override
Definition: ABIWindows_x86_64.cpp:107
lldb_private::ArchSpec
Definition: ArchSpec.h:33
ABIWindows_x86_64::RegisterIsVolatile
bool RegisterIsVolatile(const lldb_private::RegisterInfo *reg_info) override
Definition: ABIWindows_x86_64.cpp:784
ABIWindows_x86_64::GetPluginNameStatic
static llvm::StringRef GetPluginNameStatic()
Definition: ABIWindows_x86_64.h:70
ABIWindows_x86_64::GetReturnValueObjectSimple
lldb::ValueObjectSP GetReturnValueObjectSimple(lldb_private::Thread &thread, lldb_private::CompilerType &ast_type) const
Definition: ABIWindows_x86_64.cpp:395
ABIWindows_x86_64::GetPointerReturnRegister
bool GetPointerReturnRegister(const char *&name) override
Definition: ABIWindows_x86_64.cpp:102
ABIWindows_x86_64::GetGenericNum
uint32_t GetGenericNum(llvm::StringRef reg) override
Return the generic number of the given register.
Definition: ABIWindows_x86_64.cpp:803
ABIWindows_x86_64
Definition: ABIWindows_x86_64.h:14
ABIX86_64.h
lldb_private::ValueList
Definition: Value.h:157
ABIWindows_x86_64::GetPluginName
llvm::StringRef GetPluginName() override
Definition: ABIWindows_x86_64.h:76
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
pc
@ pc
Definition: CompactUnwindInfo.cpp:1250
ABIWindows_x86_64::~ABIWindows_x86_64
~ABIWindows_x86_64() override=default
ABIWindows_x86_64::CreateDefaultUnwindPlan
bool CreateDefaultUnwindPlan(lldb_private::UnwindPlan &unwind_plan) override
Definition: ABIWindows_x86_64.cpp:757
lldb_private::Thread
Definition: Thread.h:60
ABIWindows_x86_64::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
Definition: ABIWindows_x86_64.cpp:123
ABIWindows_x86_64::CallFrameAddressIsValid
bool CallFrameAddressIsValid(lldb::addr_t cfa) override
Definition: ABIWindows_x86_64.h:44
ABIWindows_x86_64::Terminate
static void Terminate()
Definition: ABIWindows_x86_64.cpp:823
sp
@ sp
Definition: CompactUnwindInfo.cpp:1249
ABIWindows_x86_64::CreateInstance
static lldb::ABISP CreateInstance(lldb::ProcessSP process_sp, const lldb_private::ArchSpec &arch)
Definition: ABIWindows_x86_64.cpp:114
ABIX86_64
Definition: ABIX86_64.h:14
ABIWindows_x86_64::SetReturnValueObject
lldb_private::Status SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueObjectSP &new_value) override
Definition: ABIWindows_x86_64.cpp:295
lldb_private::Status
Definition: Status.h:44
uint32_t
ABIWindows_x86_64::CodeAddressIsValid
bool CodeAddressIsValid(lldb::addr_t pc) override
Definition: ABIWindows_x86_64.h:52
ABIWindows_x86_64::CreateFunctionEntryUnwindPlan
bool CreateFunctionEntryUnwindPlan(lldb_private::UnwindPlan &unwind_plan) override
Definition: ABIWindows_x86_64.cpp:737
lldb_private::CompilerType
Generic representation of a type in a programming language.
Definition: CompilerType.h:33
ABIWindows_x86_64::GetReturnValueObjectImpl
lldb::ValueObjectSP GetReturnValueObjectImpl(lldb_private::Thread &thread, lldb_private::CompilerType &type) const override
Definition: ABIWindows_x86_64.cpp:594
ABIWindows_x86_64::Initialize
static void Initialize()
Definition: ABIWindows_x86_64.cpp:818
lldb_private::UnwindPlan
Definition: UnwindPlan.h:53
ABIWindows_x86_64::CreateRegisterMapIfNeeded
void CreateRegisterMapIfNeeded()
ABIWindows_x86_64::RegisterIsCalleeSaved
bool RegisterIsCalleeSaved(const lldb_private::RegisterInfo *reg_info)
Definition: ABIWindows_x86_64.cpp:788