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
15public:
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
30 lldb::ValueObjectSP &new_value) override;
31
34 lldb_private::CompilerType &type) const override;
35
37
39
40 bool RegisterIsVolatile(const lldb_private::RegisterInfo *reg_info) override;
41
42 // In Windows_x86_64 ABI requires that the stack will be maintained 16-byte
43 // aligned.
44 // When ntdll invokes callbacks such as KiUserExceptionDispatcher or
45 // KiUserCallbackDispatcher, those functions won't have a properly 16-byte
46 // aligned stack - but tolerate unwinding through them by relaxing the
47 // requirement to 8 bytes.
49 if (cfa & (8ull - 1ull))
50 return false; // Not 8 byte aligned
51 if (cfa == 0)
52 return false; // Zero is not a valid stack address
53 return true;
54 }
55
57 // We have a 64 bit address space, so anything is valid as opcodes
58 // aren't fixed width...
59 return true;
60 }
61
62 bool GetPointerReturnRegister(const char *&name) override;
63
64 //------------------------------------------------------------------
65 // Static Functions
66 //------------------------------------------------------------------
67
68 static void Initialize();
69
70 static void Terminate();
71
73
74 static llvm::StringRef GetPluginNameStatic() { return "windows-x86_64"; }
75
76 //------------------------------------------------------------------
77 // PluginInterface protocol
78 //------------------------------------------------------------------
79
80 llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
81
82protected:
84
87 lldb_private::CompilerType &ast_type) const;
88
90 uint32_t GetGenericNum(llvm::StringRef reg) override;
91
92private:
93 using ABIX86_64::ABIX86_64; // Call CreateInstance instead.
94};
95
96#endif // LLDB_SOURCE_PLUGINS_ABI_X86_ABIWINDOWS_X86_64_H
llvm::StringRef GetPluginName() override
lldb_private::Status SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueObjectSP &new_value) override
static llvm::StringRef GetPluginNameStatic()
static lldb::ABISP CreateInstance(lldb::ProcessSP process_sp, const lldb_private::ArchSpec &arch)
lldb::ValueObjectSP GetReturnValueObjectImpl(lldb_private::Thread &thread, lldb_private::CompilerType &type) const override
lldb::ValueObjectSP GetReturnValueObjectSimple(lldb_private::Thread &thread, lldb_private::CompilerType &ast_type) const
void CreateRegisterMapIfNeeded()
bool GetPointerReturnRegister(const char *&name) override
bool CallFrameAddressIsValid(lldb::addr_t cfa) override
~ABIWindows_x86_64() override=default
bool CodeAddressIsValid(lldb::addr_t pc) override
bool GetArgumentValues(lldb_private::Thread &thread, lldb_private::ValueList &values) const override
size_t GetRedZoneSize() const override
bool RegisterIsVolatile(const lldb_private::RegisterInfo *reg_info) override
lldb::UnwindPlanSP CreateFunctionEntryUnwindPlan() override
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
bool RegisterIsCalleeSaved(const lldb_private::RegisterInfo *reg_info)
lldb::UnwindPlanSP CreateDefaultUnwindPlan() override
uint32_t GetGenericNum(llvm::StringRef reg) override
Return the generic number of the given register.
An architecture specification class.
Definition ArchSpec.h:31
Generic representation of a type in a programming language.
An error handling class.
Definition Status.h:118
std::shared_ptr< lldb_private::ABI > ABISP
std::shared_ptr< lldb_private::StackFrame > StackFrameSP
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
std::shared_ptr< lldb_private::Process > ProcessSP
std::shared_ptr< lldb_private::UnwindPlan > UnwindPlanSP
uint64_t addr_t
Definition lldb-types.h:80
Every register is described in detail including its name, alternate name (optional),...