LLDB mainline
RegisterContextWindows_i386.cpp
Go to the documentation of this file.
1//===-- RegisterContextWindows_i386.cpp -----------------------------------===//
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
10#include "RegisterContext_x86.h"
12
13using namespace lldb_private;
14using namespace lldb;
15
16namespace {
17// Declare our g_register_infos structure.
18typedef struct _GPR {
28 uint32_t eflags;
35} GPR;
36
37#define GPR_OFFSET(regname) (LLVM_EXTENSION offsetof(GPR, regname))
38
39#define DEFINE_GPR(reg, alt, kind1, kind2, kind3, kind4) \
40 { \
41#reg, alt, sizeof(((GPR *)nullptr)->reg), GPR_OFFSET(reg), eEncodingUint, \
42 eFormatHex, \
43 {kind1, kind2, kind3, kind4, lldb_##reg##_i386 }, nullptr, nullptr, \
44 }
45
46// clang-format off
47static RegisterInfo g_register_infos_i386[] = {
48// General purpose registers EH_Frame DWARF Generic Process Plugin
49// =========================== ================== ================ ========================= ====================
66};
67// clang-format on
68} // namespace
69
71 const ArchSpec &target_arch)
72 : lldb_private::RegisterInfoInterface(target_arch) {
73 assert(target_arch.GetMachine() == llvm::Triple::x86);
74}
75
77 return g_register_infos_i386;
78}
79
81 return std::size(g_register_infos_i386);
82}
83
85 return std::size(g_register_infos_i386);
86}
87
88size_t RegisterContextWindows_i386::GetGPRSize() const { return sizeof(GPR); }
#define DEFINE_GPR(reg, alt, kind1, kind2, kind3, kind4)
uint32_t GetRegisterCount() const override
uint32_t GetUserRegisterCount() const override
RegisterContextWindows_i386(const lldb_private::ArchSpec &target_arch)
const lldb_private::RegisterInfo * GetRegisterInfo() const override
An architecture specification class.
Definition: ArchSpec.h:32
llvm::Triple::ArchType GetMachine() const
Returns a machine family for the current architecture.
Definition: ArchSpec.cpp:678
RegisterInfo interface to patch RegisterInfo structure for archs.
#define LLDB_REGNUM_GENERIC_SP
Definition: lldb-defines.h:52
#define LLDB_REGNUM_GENERIC_FLAGS
Definition: lldb-defines.h:55
#define LLDB_INVALID_REGNUM
Definition: lldb-defines.h:79
#define LLDB_REGNUM_GENERIC_PC
Definition: lldb-defines.h:51
#define LLDB_REGNUM_GENERIC_FP
Definition: lldb-defines.h:53
A class that represents a running process on the host machine.
Definition: SBAddress.h:15