[Lldb-commits] [lldb] [llvm] [lldb] [NOT FOR MERGE] Refactor RegisterContext from Process/Utility (PR #222964)
Minsoo Choo via lldb-commits
lldb-commits at lists.llvm.org
Tue Oct 13 08:49:04 PDT 2026
https://github.com/mchoo7 updated https://github.com/llvm/llvm-project/pull/222964
>From 53906d63e1393c741c7716ea6ead157d2a8305cd Mon Sep 17 00:00:00 2001
From: Minsoo Choo <minsoo at minsoo.io>
Date: Sun, 6 Sep 2026 00:56:52 -0400
Subject: [PATCH 1/6] [lldb] Rename OS register metadata providers
---
.../ThreadFreeBSDKernelCore.cpp | 8 +--
.../NativeRegisterContextFreeBSD_powerpc.cpp | 8 +--
.../NativeRegisterContextFreeBSD_powerpc.h | 4 +-
.../NativeRegisterContextFreeBSD_x86.cpp | 10 ++--
.../NativeRegisterContextLinux_s390x.cpp | 4 +-
.../Linux/NativeRegisterContextLinux_x86.cpp | 14 ++---
.../Linux/NativeRegisterContextLinux_x86.h | 6 +--
.../NativeRegisterContextNetBSD_x86.cpp | 10 ++--
.../Plugins/Process/Utility/CMakeLists.txt | 24 ++++-----
.../Utility/RegisterContextFreeBSD_powerpc.h | 52 -------------------
..._i386.cpp => RegisterInfoFreeBSD_i386.cpp} | 14 ++---
...tBSD_i386.h => RegisterInfoFreeBSD_i386.h} | 10 ++--
...pc.cpp => RegisterInfoFreeBSD_powerpc.cpp} | 38 +++++++-------
.../Utility/RegisterInfoFreeBSD_powerpc.h | 51 ++++++++++++++++++
..._64.cpp => RegisterInfoFreeBSD_x86_64.cpp} | 20 +++----
..._x86_64.h => RegisterInfoFreeBSD_x86_64.h} | 10 ++--
...ux_i386.cpp => RegisterInfoLinux_i386.cpp} | 18 +++----
...tLinux_i386.h => RegisterInfoLinux_i386.h} | 14 ++---
..._s390x.cpp => RegisterInfoLinux_s390x.cpp} | 14 ++---
...inux_s390x.h => RegisterInfoLinux_s390x.h} | 10 ++--
...extLinux_x86.h => RegisterInfoLinux_x86.h} | 10 ++--
...86_64.cpp => RegisterInfoLinux_x86_64.cpp} | 24 ++++-----
...ux_x86_64.h => RegisterInfoLinux_x86_64.h} | 14 ++---
...D_i386.cpp => RegisterInfoNetBSD_i386.cpp} | 12 ++---
...eeBSD_i386.h => RegisterInfoNetBSD_i386.h} | 10 ++--
...6_64.cpp => RegisterInfoNetBSD_x86_64.cpp} | 20 +++----
...D_x86_64.h => RegisterInfoNetBSD_x86_64.h} | 10 ++--
..._i386.cpp => RegisterInfoOpenBSD_i386.cpp} | 14 ++---
...nBSD_i386.h => RegisterInfoOpenBSD_i386.h} | 10 ++--
..._64.cpp => RegisterInfoOpenBSD_x86_64.cpp} | 14 ++---
..._x86_64.h => RegisterInfoOpenBSD_x86_64.h} | 10 ++--
..._i386.cpp => RegisterInfoWindows_i386.cpp} | 14 ++---
...dows_i386.h => RegisterInfoWindows_i386.h} | 10 ++--
..._64.cpp => RegisterInfoWindows_x86_64.cpp} | 14 ++---
..._x86_64.h => RegisterInfoWindows_x86_64.h} | 10 ++--
.../NativeRegisterContextWindows_WoW64.cpp | 4 +-
.../NativeRegisterContextWindows_i386.cpp | 4 +-
.../NativeRegisterContextWindows_x86_64.cpp | 6 +--
.../Process/elf-core/ThreadElfCore.cpp | 42 +++++++--------
.../Process/minidump/ThreadMinidump.cpp | 8 +--
lldb/unittests/Process/Utility/CMakeLists.txt | 8 +--
...SDTest.cpp => RegisterInfoFreeBSDTest.cpp} | 24 ++++-----
...86.cpp => RegisterInfoNetBSDTest_i386.cpp} | 8 +--
....cpp => RegisterInfoNetBSDTest_x86_64.cpp} | 10 ++--
...ntextTest.cpp => RegisterInfo_x86Test.cpp} | 6 +--
.../minidump/RegisterContextMinidumpTest.cpp | 8 +--
.../source/Plugins/Process/Utility/BUILD.gn | 24 ++++-----
47 files changed, 343 insertions(+), 344 deletions(-)
delete mode 100644 lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_powerpc.h
rename lldb/source/Plugins/Process/Utility/{RegisterContextFreeBSD_i386.cpp => RegisterInfoFreeBSD_i386.cpp} (83%)
rename lldb/source/Plugins/Process/Utility/{RegisterContextNetBSD_i386.h => RegisterInfoFreeBSD_i386.h} (58%)
rename lldb/source/Plugins/Process/Utility/{RegisterContextFreeBSD_powerpc.cpp => RegisterInfoFreeBSD_powerpc.cpp} (75%)
create mode 100644 lldb/source/Plugins/Process/Utility/RegisterInfoFreeBSD_powerpc.h
rename lldb/source/Plugins/Process/Utility/{RegisterContextFreeBSD_x86_64.cpp => RegisterInfoFreeBSD_x86_64.cpp} (87%)
rename lldb/source/Plugins/Process/Utility/{RegisterContextFreeBSD_x86_64.h => RegisterInfoFreeBSD_x86_64.h} (67%)
rename lldb/source/Plugins/Process/Utility/{RegisterContextLinux_i386.cpp => RegisterInfoLinux_i386.cpp} (88%)
rename lldb/source/Plugins/Process/Utility/{RegisterContextLinux_i386.h => RegisterInfoLinux_i386.h} (58%)
rename lldb/source/Plugins/Process/Utility/{RegisterContextLinux_s390x.cpp => RegisterInfoLinux_s390x.cpp} (80%)
rename lldb/source/Plugins/Process/Utility/{RegisterContextLinux_s390x.h => RegisterInfoLinux_s390x.h} (65%)
rename lldb/source/Plugins/Process/Utility/{RegisterContextLinux_x86.h => RegisterInfoLinux_x86.h} (67%)
rename lldb/source/Plugins/Process/Utility/{RegisterContextLinux_x86_64.cpp => RegisterInfoLinux_x86_64.cpp} (89%)
rename lldb/source/Plugins/Process/Utility/{RegisterContextLinux_x86_64.h => RegisterInfoLinux_x86_64.h} (62%)
rename lldb/source/Plugins/Process/Utility/{RegisterContextNetBSD_i386.cpp => RegisterInfoNetBSD_i386.cpp} (87%)
rename lldb/source/Plugins/Process/Utility/{RegisterContextFreeBSD_i386.h => RegisterInfoNetBSD_i386.h} (58%)
rename lldb/source/Plugins/Process/Utility/{RegisterContextNetBSD_x86_64.cpp => RegisterInfoNetBSD_x86_64.cpp} (89%)
rename lldb/source/Plugins/Process/Utility/{RegisterContextNetBSD_x86_64.h => RegisterInfoNetBSD_x86_64.h} (70%)
rename lldb/source/Plugins/Process/Utility/{RegisterContextOpenBSD_i386.cpp => RegisterInfoOpenBSD_i386.cpp} (81%)
rename lldb/source/Plugins/Process/Utility/{RegisterContextOpenBSD_i386.h => RegisterInfoOpenBSD_i386.h} (58%)
rename lldb/source/Plugins/Process/Utility/{RegisterContextOpenBSD_x86_64.cpp => RegisterInfoOpenBSD_x86_64.cpp} (85%)
rename lldb/source/Plugins/Process/Utility/{RegisterContextOpenBSD_x86_64.h => RegisterInfoOpenBSD_x86_64.h} (67%)
rename lldb/source/Plugins/Process/Utility/{RegisterContextWindows_i386.cpp => RegisterInfoWindows_i386.cpp} (89%)
rename lldb/source/Plugins/Process/Utility/{RegisterContextWindows_i386.h => RegisterInfoWindows_i386.h} (60%)
rename lldb/source/Plugins/Process/Utility/{RegisterContextWindows_x86_64.cpp => RegisterInfoWindows_x86_64.cpp} (93%)
rename lldb/source/Plugins/Process/Utility/{RegisterContextWindows_x86_64.h => RegisterInfoWindows_x86_64.h} (65%)
rename lldb/unittests/Process/Utility/{RegisterContextFreeBSDTest.cpp => RegisterInfoFreeBSDTest.cpp} (96%)
rename lldb/unittests/Process/Utility/{RegisterContextNetBSDTest_i386.cpp => RegisterInfoNetBSDTest_i386.cpp} (94%)
rename lldb/unittests/Process/Utility/{RegisterContextNetBSDTest_x86_64.cpp => RegisterInfoNetBSDTest_x86_64.cpp} (94%)
rename lldb/unittests/Process/Utility/{RegisterContextTest.cpp => RegisterInfo_x86Test.cpp} (92%)
diff --git a/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/ThreadFreeBSDKernelCore.cpp b/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/ThreadFreeBSDKernelCore.cpp
index b98ed1208f5ef2..98b73e8de87ef8 100644
--- a/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/ThreadFreeBSDKernelCore.cpp
+++ b/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/ThreadFreeBSDKernelCore.cpp
@@ -12,8 +12,8 @@
#include "lldb/Target/Unwind.h"
#include "lldb/Utility/Log.h"
-#include "Plugins/Process/Utility/RegisterContextFreeBSD_i386.h"
-#include "Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.h"
+#include "Plugins/Process/Utility/RegisterInfoFreeBSD_i386.h"
+#include "Plugins/Process/Utility/RegisterInfoFreeBSD_x86_64.h"
#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm.h"
#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h"
#include "Plugins/Process/Utility/RegisterInfoPOSIX_ppc64le.h"
@@ -88,12 +88,12 @@ ThreadFreeBSDKernelCore::CreateRegisterContextForFrame(StackFrame *frame) {
case llvm::Triple::x86:
m_thread_reg_ctx_sp =
std::make_shared<RegisterContextFreeBSDKernelCore_i386>(
- *this, new RegisterContextFreeBSD_i386(arch), m_pcb_addr);
+ *this, new RegisterInfoFreeBSD_i386(arch), m_pcb_addr);
break;
case llvm::Triple::x86_64:
m_thread_reg_ctx_sp =
std::make_shared<RegisterContextFreeBSDKernelCore_x86_64>(
- *this, new RegisterContextFreeBSD_x86_64(arch), m_pcb_addr);
+ *this, new RegisterInfoFreeBSD_x86_64(arch), m_pcb_addr);
break;
default:
assert(false &&
diff --git a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_powerpc.cpp b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_powerpc.cpp
index d606889bc7aa15..560c3e567702c8 100644
--- a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_powerpc.cpp
+++ b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_powerpc.cpp
@@ -74,11 +74,11 @@ NativeRegisterContextFreeBSD::CreateHostNativeRegisterContextFreeBSD(
static RegisterInfoInterface *
CreateRegisterInfoInterface(const ArchSpec &target_arch) {
if (HostInfo::GetArchitecture().GetAddressByteSize() == 4) {
- return new RegisterContextFreeBSD_powerpc32(target_arch);
+ return new RegisterInfoFreeBSD_powerpc32(target_arch);
} else {
assert((HostInfo::GetArchitecture().GetAddressByteSize() == 8) &&
"Register setting path assumes this is a 64-bit host");
- return new RegisterContextFreeBSD_powerpc64(target_arch);
+ return new RegisterInfoFreeBSD_powerpc64(target_arch);
}
}
@@ -87,9 +87,9 @@ NativeRegisterContextFreeBSD_powerpc::NativeRegisterContextFreeBSD_powerpc(
: NativeRegisterContextRegisterInfo(
native_thread, CreateRegisterInfoInterface(target_arch)) {}
-RegisterContextFreeBSD_powerpc &
+RegisterInfoFreeBSD_powerpc &
NativeRegisterContextFreeBSD_powerpc::GetRegisterInfo() const {
- return static_cast<RegisterContextFreeBSD_powerpc &>(
+ return static_cast<RegisterInfoFreeBSD_powerpc &>(
*m_register_info_interface_up);
}
diff --git a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_powerpc.h b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_powerpc.h
index 420db822acc0ff..b0dcec4575de9d 100644
--- a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_powerpc.h
+++ b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_powerpc.h
@@ -17,7 +17,7 @@
// clang-format on
#include "Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD.h"
-#include "Plugins/Process/Utility/RegisterContextFreeBSD_powerpc.h"
+#include "Plugins/Process/Utility/RegisterInfoFreeBSD_powerpc.h"
#include <array>
#include <optional>
@@ -64,7 +64,7 @@ class NativeRegisterContextFreeBSD_powerpc
Status ReadRegisterSet(RegSetKind set);
Status WriteRegisterSet(RegSetKind set);
- RegisterContextFreeBSD_powerpc &GetRegisterInfo() const;
+ RegisterInfoFreeBSD_powerpc &GetRegisterInfo() const;
};
} // namespace process_freebsd
diff --git a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_x86.cpp b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_x86.cpp
index f4c44ba339d61d..50cea232972ceb 100644
--- a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_x86.cpp
+++ b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_x86.cpp
@@ -23,8 +23,8 @@
#include "lldb/Utility/Status.h"
#include "NativeProcessFreeBSD.h"
-#include "Plugins/Process/Utility/RegisterContextFreeBSD_i386.h"
-#include "Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.h"
+#include "Plugins/Process/Utility/RegisterInfoFreeBSD_i386.h"
+#include "Plugins/Process/Utility/RegisterInfoFreeBSD_x86_64.h"
#include <optional>
using namespace lldb_private;
@@ -246,14 +246,14 @@ NativeRegisterContextFreeBSD::CreateHostNativeRegisterContextFreeBSD(
static RegisterInfoInterface *
CreateRegisterInfoInterface(const ArchSpec &target_arch) {
if (HostInfo::GetArchitecture().GetAddressByteSize() == 4) {
- // 32-bit hosts run with a RegisterContextFreeBSD_i386 context.
- return new RegisterContextFreeBSD_i386(target_arch);
+ // 32-bit hosts run with a RegisterInfoFreeBSD_i386 context.
+ return new RegisterInfoFreeBSD_i386(target_arch);
} else {
assert((HostInfo::GetArchitecture().GetAddressByteSize() == 8) &&
"Register setting path assumes this is a 64-bit host");
// X86_64 hosts know how to work with 64-bit and 32-bit EXEs using the
// x86_64 register context.
- return new RegisterContextFreeBSD_x86_64(target_arch);
+ return new RegisterInfoFreeBSD_x86_64(target_arch);
}
}
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp
index 84ba53b54a8225..1851eb21c6351e 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp
@@ -10,7 +10,7 @@
#include "NativeRegisterContextLinux_s390x.h"
#include "Plugins/Process/Linux/NativeProcessLinux.h"
-#include "Plugins/Process/Utility/RegisterContextLinux_s390x.h"
+#include "Plugins/Process/Utility/RegisterInfoLinux_s390x.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Utility/DataBufferHeap.h"
#include "lldb/Utility/Log.h"
@@ -107,7 +107,7 @@ static RegisterInfoInterface *
CreateRegisterInfoInterface(const ArchSpec &target_arch) {
assert((HostInfo::GetArchitecture().GetAddressByteSize() == 8) &&
"Register setting path assumes this is a 64-bit host");
- return new RegisterContextLinux_s390x(target_arch);
+ return new RegisterInfoLinux_s390x(target_arch);
}
NativeRegisterContextLinux_s390x::NativeRegisterContextLinux_s390x(
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86.cpp
index 261c5b31241522..1ab29f277b70a5 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86.cpp
@@ -12,8 +12,8 @@
#include "Plugins/Process/Linux/NativeProcessLinux.h"
#include "Plugins/Process/Linux/NativeThreadLinux.h"
-#include "Plugins/Process/Utility/RegisterContextLinux_i386.h"
-#include "Plugins/Process/Utility/RegisterContextLinux_x86_64.h"
+#include "Plugins/Process/Utility/RegisterInfoLinux_i386.h"
+#include "Plugins/Process/Utility/RegisterInfoLinux_x86_64.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Utility/DataBufferHeap.h"
#include "lldb/Utility/Log.h"
@@ -276,22 +276,22 @@ NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux(
llvm::Expected<ArchSpec>
NativeRegisterContextLinux::DetermineArchitecture(lldb::tid_t tid) {
return DetermineArchitectureViaGPR(
- tid, RegisterContextLinux_x86_64::GetGPRSizeStatic());
+ tid, RegisterInfoLinux_x86_64::GetGPRSizeStatic());
}
// NativeRegisterContextLinux_x86 members.
-static std::unique_ptr<RegisterContextLinux_x86>
+static std::unique_ptr<RegisterInfoLinux_x86>
CreateRegisterInfoInterface(const ArchSpec &target_arch) {
if (HostInfo::GetArchitecture().GetAddressByteSize() == 4) {
- // 32-bit hosts run with a RegisterContextLinux_i386 context.
- return std::make_unique<RegisterContextLinux_i386>(target_arch);
+ // 32-bit hosts run with a RegisterInfoLinux_i386 context.
+ return std::make_unique<RegisterInfoLinux_i386>(target_arch);
} else {
assert((HostInfo::GetArchitecture().GetAddressByteSize() == 8) &&
"Register setting path assumes this is a 64-bit host");
// X86_64 hosts know how to work with 64-bit and 32-bit EXEs using the
// x86_64 register context.
- return std::make_unique<RegisterContextLinux_x86_64>(target_arch);
+ return std::make_unique<RegisterInfoLinux_x86_64>(target_arch);
}
}
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86.h b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86.h
index 8fb08f616926cd..92793118939105 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86.h
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86.h
@@ -13,7 +13,7 @@
#include "Plugins/Process/Linux/NativeRegisterContextLinux.h"
#include "Plugins/Process/Utility/NativeRegisterContextDBReg_x86.h"
-#include "Plugins/Process/Utility/RegisterContextLinux_x86.h"
+#include "Plugins/Process/Utility/RegisterInfoLinux_x86.h"
#include "Plugins/Process/Utility/RegisterContext_x86.h"
#include "Plugins/Process/Utility/lldb-x86-register-enums.h"
#include <optional>
@@ -145,8 +145,8 @@ class NativeRegisterContextLinux_x86
void UpdateXSTATEforWrite(uint32_t reg_index);
- RegisterContextLinux_x86 &GetRegisterInfo() const {
- return static_cast<RegisterContextLinux_x86 &>(
+ RegisterInfoLinux_x86 &GetRegisterInfo() const {
+ return static_cast<RegisterInfoLinux_x86 &>(
*m_register_info_interface_up);
}
};
diff --git a/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86.cpp b/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86.cpp
index 62c74dd3501c58..55f13bda25ce20 100644
--- a/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86.cpp
+++ b/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86.cpp
@@ -16,8 +16,8 @@
#include "lldb/Utility/RegisterValue.h"
#include "lldb/Utility/Status.h"
-#include "Plugins/Process/Utility/RegisterContextNetBSD_i386.h"
-#include "Plugins/Process/Utility/RegisterContextNetBSD_x86_64.h"
+#include "Plugins/Process/Utility/RegisterInfoNetBSD_i386.h"
+#include "Plugins/Process/Utility/RegisterInfoNetBSD_x86_64.h"
// clang-format off
#include <sys/types.h>
@@ -253,14 +253,14 @@ NativeRegisterContextNetBSD::CreateHostNativeRegisterContextNetBSD(
static RegisterInfoInterface *
CreateRegisterInfoInterface(const ArchSpec &target_arch) {
if (HostInfo::GetArchitecture().GetAddressByteSize() == 4) {
- // 32-bit hosts run with a RegisterContextNetBSD_i386 context.
- return new RegisterContextNetBSD_i386(target_arch);
+ // 32-bit hosts run with a RegisterInfoNetBSD_i386 context.
+ return new RegisterInfoNetBSD_i386(target_arch);
} else {
assert((HostInfo::GetArchitecture().GetAddressByteSize() == 8) &&
"Register setting path assumes this is a 64-bit host");
// X86_64 hosts know how to work with 64-bit and 32-bit EXEs using the
// x86_64 register context.
- return new RegisterContextNetBSD_x86_64(target_arch);
+ return new RegisterInfoNetBSD_x86_64(target_arch);
}
}
diff --git a/lldb/source/Plugins/Process/Utility/CMakeLists.txt b/lldb/source/Plugins/Process/Utility/CMakeLists.txt
index 1df362a81a881f..cd2e19d5d5e302 100644
--- a/lldb/source/Plugins/Process/Utility/CMakeLists.txt
+++ b/lldb/source/Plugins/Process/Utility/CMakeLists.txt
@@ -4,18 +4,18 @@ set_property(DIRECTORY PROPERTY LLDB_PLUGIN_KIND ProcessUtility)
add_lldb_library(lldbRegister NO_PLUGIN_DEPENDENCIES
PARTIAL_SOURCES_INTENDED
RegisterContext_x86.cpp
- RegisterContextFreeBSD_i386.cpp
- RegisterContextFreeBSD_powerpc.cpp
- RegisterContextFreeBSD_x86_64.cpp
- RegisterContextLinux_i386.cpp
- RegisterContextLinux_x86_64.cpp
- RegisterContextLinux_s390x.cpp
- RegisterContextNetBSD_i386.cpp
- RegisterContextNetBSD_x86_64.cpp
- RegisterContextOpenBSD_i386.cpp
- RegisterContextOpenBSD_x86_64.cpp
- RegisterContextWindows_i386.cpp
- RegisterContextWindows_x86_64.cpp
+ RegisterInfoFreeBSD_i386.cpp
+ RegisterInfoFreeBSD_powerpc.cpp
+ RegisterInfoFreeBSD_x86_64.cpp
+ RegisterInfoLinux_i386.cpp
+ RegisterInfoLinux_x86_64.cpp
+ RegisterInfoLinux_s390x.cpp
+ RegisterInfoNetBSD_i386.cpp
+ RegisterInfoNetBSD_x86_64.cpp
+ RegisterInfoOpenBSD_i386.cpp
+ RegisterInfoOpenBSD_x86_64.cpp
+ RegisterInfoWindows_i386.cpp
+ RegisterInfoWindows_x86_64.cpp
RegisterTypeDetector_arm64.cpp
RegisterInfos_x86_64_with_base_shared.cpp
RegisterInfoPOSIX_arm.cpp
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_powerpc.h b/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_powerpc.h
deleted file mode 100644
index 7e4c43ba908a74..00000000000000
--- a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_powerpc.h
+++ /dev/null
@@ -1,52 +0,0 @@
-//===-- RegisterContextFreeBSD_powerpc.h -------------------------*- C++
-//-*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTFREEBSD_POWERPC_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTFREEBSD_POWERPC_H
-
-#include "RegisterInfoInterface.h"
-
-class RegisterContextFreeBSD_powerpc
- : public lldb_private::RegisterInfoInterface {
-public:
- RegisterContextFreeBSD_powerpc(const lldb_private::ArchSpec &target_arch);
- ~RegisterContextFreeBSD_powerpc() override;
-
- size_t GetGPRSize() const override;
-
- const lldb_private::RegisterInfo *GetRegisterInfo() const override;
-
- uint32_t GetRegisterCount() const override;
-};
-
-class RegisterContextFreeBSD_powerpc32 : public RegisterContextFreeBSD_powerpc {
-public:
- RegisterContextFreeBSD_powerpc32(const lldb_private::ArchSpec &target_arch);
- ~RegisterContextFreeBSD_powerpc32() override;
-
- size_t GetGPRSize() const override;
-
- const lldb_private::RegisterInfo *GetRegisterInfo() const override;
-
- uint32_t GetRegisterCount() const override;
-};
-
-class RegisterContextFreeBSD_powerpc64 : public RegisterContextFreeBSD_powerpc {
-public:
- RegisterContextFreeBSD_powerpc64(const lldb_private::ArchSpec &target_arch);
- ~RegisterContextFreeBSD_powerpc64() override;
-
- size_t GetGPRSize() const override;
-
- const lldb_private::RegisterInfo *GetRegisterInfo() const override;
-
- uint32_t GetRegisterCount() const override;
-};
-
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTFREEBSD_POWERPC_H
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_i386.cpp b/lldb/source/Plugins/Process/Utility/RegisterInfoFreeBSD_i386.cpp
similarity index 83%
rename from lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_i386.cpp
rename to lldb/source/Plugins/Process/Utility/RegisterInfoFreeBSD_i386.cpp
index 86ce13461426f7..0d54855d703e9b 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_i386.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoFreeBSD_i386.cpp
@@ -1,12 +1,12 @@
-//===-- RegisterContextFreeBSD_i386.cpp -----------------------------------===//
+//===-- RegisterInfoFreeBSD_i386.cpp --------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
-//===---------------------------------------------------------------------===//
+//===----------------------------------------------------------------------===//
-#include "RegisterContextFreeBSD_i386.h"
+#include "RegisterInfoFreeBSD_i386.h"
#include "RegisterContext_x86.h"
#include "lldb-x86-register-enums.h"
#include "lldb/lldb-defines.h"
@@ -63,13 +63,13 @@ struct UserArea {
#include "RegisterInfos_i386.h"
#undef DECLARE_REGISTER_INFOS_I386_STRUCT
-RegisterContextFreeBSD_i386::RegisterContextFreeBSD_i386(
+RegisterInfoFreeBSD_i386::RegisterInfoFreeBSD_i386(
const ArchSpec &target_arch)
: RegisterInfoInterface(target_arch) {}
-size_t RegisterContextFreeBSD_i386::GetGPRSize() const { return sizeof(GPR); }
+size_t RegisterInfoFreeBSD_i386::GetGPRSize() const { return sizeof(GPR); }
-const RegisterInfo *RegisterContextFreeBSD_i386::GetRegisterInfo() const {
+const RegisterInfo *RegisterInfoFreeBSD_i386::GetRegisterInfo() const {
switch (GetTargetArchitecture().GetMachine()) {
case llvm::Triple::x86:
return g_register_infos_i386;
@@ -79,7 +79,7 @@ const RegisterInfo *RegisterContextFreeBSD_i386::GetRegisterInfo() const {
}
}
-uint32_t RegisterContextFreeBSD_i386::GetRegisterCount() const {
+uint32_t RegisterInfoFreeBSD_i386::GetRegisterCount() const {
return static_cast<uint32_t>(sizeof(g_register_infos_i386) /
sizeof(g_register_infos_i386[0]));
}
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_i386.h b/lldb/source/Plugins/Process/Utility/RegisterInfoFreeBSD_i386.h
similarity index 58%
rename from lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_i386.h
rename to lldb/source/Plugins/Process/Utility/RegisterInfoFreeBSD_i386.h
index 742bb18b8306ab..336a3fb60f781a 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_i386.h
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoFreeBSD_i386.h
@@ -1,4 +1,4 @@
-//===-- RegisterContextNetBSD_i386.h ----------------------------*- C++ -*-===//
+//===-- RegisterInfoFreeBSD_i386.h ------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,14 +6,14 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTNETBSD_I386_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTNETBSD_I386_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOFREEBSD_I386_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOFREEBSD_I386_H
#include "RegisterInfoInterface.h"
-class RegisterContextNetBSD_i386 : public lldb_private::RegisterInfoInterface {
+class RegisterInfoFreeBSD_i386 : public lldb_private::RegisterInfoInterface {
public:
- RegisterContextNetBSD_i386(const lldb_private::ArchSpec &target_arch);
+ RegisterInfoFreeBSD_i386(const lldb_private::ArchSpec &target_arch);
size_t GetGPRSize() const override;
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_powerpc.cpp b/lldb/source/Plugins/Process/Utility/RegisterInfoFreeBSD_powerpc.cpp
similarity index 75%
rename from lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_powerpc.cpp
rename to lldb/source/Plugins/Process/Utility/RegisterInfoFreeBSD_powerpc.cpp
index cd422556752fc3..20bf6e57454730 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_powerpc.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoFreeBSD_powerpc.cpp
@@ -1,4 +1,4 @@
-//===-- RegisterContextFreeBSD_powerpc.cpp --------------------------------===//
+//===-- RegisterInfoFreeBSD_powerpc.cpp ----------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,7 +6,7 @@
//
//===---------------------------------------------------------------------===//
-#include "RegisterContextFreeBSD_powerpc.h"
+#include "RegisterInfoFreeBSD_powerpc.h"
#include "RegisterContextPOSIX_powerpc.h"
#include <vector>
@@ -174,60 +174,60 @@ typedef struct _VMX {
#include "RegisterInfos_powerpc.h"
#undef DECLARE_REGISTER_INFOS_POWERPC_STRUCT
-RegisterContextFreeBSD_powerpc::RegisterContextFreeBSD_powerpc(
+RegisterInfoFreeBSD_powerpc::RegisterInfoFreeBSD_powerpc(
const ArchSpec &target_arch)
: RegisterInfoInterface(target_arch) {}
-RegisterContextFreeBSD_powerpc::~RegisterContextFreeBSD_powerpc() = default;
+RegisterInfoFreeBSD_powerpc::~RegisterInfoFreeBSD_powerpc() = default;
-size_t RegisterContextFreeBSD_powerpc::GetGPRSize() const {
+size_t RegisterInfoFreeBSD_powerpc::GetGPRSize() const {
// This is an 'abstract' base, so no GPR struct.
return 0;
}
-const RegisterInfo *RegisterContextFreeBSD_powerpc::GetRegisterInfo() const {
+const RegisterInfo *RegisterInfoFreeBSD_powerpc::GetRegisterInfo() const {
llvm_unreachable("Abstract class!");
return nullptr;
}
-uint32_t RegisterContextFreeBSD_powerpc::GetRegisterCount() const { return 0; }
+uint32_t RegisterInfoFreeBSD_powerpc::GetRegisterCount() const { return 0; }
-RegisterContextFreeBSD_powerpc32::RegisterContextFreeBSD_powerpc32(
+RegisterInfoFreeBSD_powerpc32::RegisterInfoFreeBSD_powerpc32(
const ArchSpec &target_arch)
- : RegisterContextFreeBSD_powerpc(target_arch) {}
+ : RegisterInfoFreeBSD_powerpc(target_arch) {}
-RegisterContextFreeBSD_powerpc32::~RegisterContextFreeBSD_powerpc32() = default;
+RegisterInfoFreeBSD_powerpc32::~RegisterInfoFreeBSD_powerpc32() = default;
-size_t RegisterContextFreeBSD_powerpc32::GetGPRSize() const {
+size_t RegisterInfoFreeBSD_powerpc32::GetGPRSize() const {
return sizeof(GPR32);
}
-const RegisterInfo *RegisterContextFreeBSD_powerpc32::GetRegisterInfo() const {
+const RegisterInfo *RegisterInfoFreeBSD_powerpc32::GetRegisterInfo() const {
return g_register_infos_powerpc32;
}
-uint32_t RegisterContextFreeBSD_powerpc32::GetRegisterCount() const {
+uint32_t RegisterInfoFreeBSD_powerpc32::GetRegisterCount() const {
return static_cast<uint32_t>(sizeof(g_register_infos_powerpc32) /
sizeof(g_register_infos_powerpc32[0]));
}
-RegisterContextFreeBSD_powerpc64::RegisterContextFreeBSD_powerpc64(
+RegisterInfoFreeBSD_powerpc64::RegisterInfoFreeBSD_powerpc64(
const ArchSpec &target_arch)
- : RegisterContextFreeBSD_powerpc(target_arch) {}
+ : RegisterInfoFreeBSD_powerpc(target_arch) {}
-RegisterContextFreeBSD_powerpc64::~RegisterContextFreeBSD_powerpc64() = default;
+RegisterInfoFreeBSD_powerpc64::~RegisterInfoFreeBSD_powerpc64() = default;
-size_t RegisterContextFreeBSD_powerpc64::GetGPRSize() const {
+size_t RegisterInfoFreeBSD_powerpc64::GetGPRSize() const {
return sizeof(GPR64);
}
-const RegisterInfo *RegisterContextFreeBSD_powerpc64::GetRegisterInfo() const {
+const RegisterInfo *RegisterInfoFreeBSD_powerpc64::GetRegisterInfo() const {
if (GetTargetArchitecture().GetMachine() == llvm::Triple::ppc)
return g_register_infos_powerpc64_32;
return g_register_infos_powerpc64;
}
-uint32_t RegisterContextFreeBSD_powerpc64::GetRegisterCount() const {
+uint32_t RegisterInfoFreeBSD_powerpc64::GetRegisterCount() const {
return static_cast<uint32_t>(sizeof(g_register_infos_powerpc64) /
sizeof(g_register_infos_powerpc64[0]));
}
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoFreeBSD_powerpc.h b/lldb/source/Plugins/Process/Utility/RegisterInfoFreeBSD_powerpc.h
new file mode 100644
index 00000000000000..25f2bf9dc77645
--- /dev/null
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoFreeBSD_powerpc.h
@@ -0,0 +1,51 @@
+//===-- RegisterInfoFreeBSD_powerpc.h ---------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOFREEBSD_POWERPC_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOFREEBSD_POWERPC_H
+
+#include "RegisterInfoInterface.h"
+
+class RegisterInfoFreeBSD_powerpc
+ : public lldb_private::RegisterInfoInterface {
+public:
+ RegisterInfoFreeBSD_powerpc(const lldb_private::ArchSpec &target_arch);
+ ~RegisterInfoFreeBSD_powerpc() override;
+
+ size_t GetGPRSize() const override;
+
+ const lldb_private::RegisterInfo *GetRegisterInfo() const override;
+
+ uint32_t GetRegisterCount() const override;
+};
+
+class RegisterInfoFreeBSD_powerpc32 : public RegisterInfoFreeBSD_powerpc {
+public:
+ RegisterInfoFreeBSD_powerpc32(const lldb_private::ArchSpec &target_arch);
+ ~RegisterInfoFreeBSD_powerpc32() override;
+
+ size_t GetGPRSize() const override;
+
+ const lldb_private::RegisterInfo *GetRegisterInfo() const override;
+
+ uint32_t GetRegisterCount() const override;
+};
+
+class RegisterInfoFreeBSD_powerpc64 : public RegisterInfoFreeBSD_powerpc {
+public:
+ RegisterInfoFreeBSD_powerpc64(const lldb_private::ArchSpec &target_arch);
+ ~RegisterInfoFreeBSD_powerpc64() override;
+
+ size_t GetGPRSize() const override;
+
+ const lldb_private::RegisterInfo *GetRegisterInfo() const override;
+
+ uint32_t GetRegisterCount() const override;
+};
+
+#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOFREEBSD_POWERPC_H
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp b/lldb/source/Plugins/Process/Utility/RegisterInfoFreeBSD_x86_64.cpp
similarity index 87%
rename from lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp
rename to lldb/source/Plugins/Process/Utility/RegisterInfoFreeBSD_x86_64.cpp
index 895f827b6c6268..1b00651673950e 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoFreeBSD_x86_64.cpp
@@ -1,13 +1,13 @@
-//===-- RegisterContextFreeBSD_x86_64.cpp ---------------------------------===//
+//===-- RegisterInfoFreeBSD_x86_64.cpp ------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
-//===---------------------------------------------------------------------===//
+//===----------------------------------------------------------------------===//
-#include "RegisterContextFreeBSD_x86_64.h"
-#include "RegisterContextFreeBSD_i386.h"
+#include "RegisterInfoFreeBSD_x86_64.h"
+#include "RegisterInfoFreeBSD_i386.h"
#include "RegisterContext_x86.h"
#include "lldb-x86-register-enums.h"
#include "lldb/lldb-defines.h"
@@ -79,8 +79,8 @@ GetSharedRegisterInfoVector_i386(const lldb_private::ArchSpec &arch) {
llvm::call_once(g_initialized, [&]() {
if (g_register_infos.empty()) {
// Copy the register information from base class
- std::unique_ptr<RegisterContextFreeBSD_i386> reg_interface(
- new RegisterContextFreeBSD_i386(arch));
+ std::unique_ptr<RegisterInfoFreeBSD_i386> reg_interface(
+ new RegisterInfoFreeBSD_i386(arch));
const RegisterInfo *base_info = reg_interface->GetRegisterInfo();
g_register_infos.insert(g_register_infos.end(), &base_info[0],
&base_info[k_num_registers_i386]);
@@ -126,18 +126,18 @@ PrivateGetRegisterCount(const lldb_private::ArchSpec &target_arch) {
}
}
-RegisterContextFreeBSD_x86_64::RegisterContextFreeBSD_x86_64(
+RegisterInfoFreeBSD_x86_64::RegisterInfoFreeBSD_x86_64(
const ArchSpec &target_arch)
: lldb_private::RegisterInfoInterface(target_arch),
m_register_info_p(PrivateGetRegisterInfoPtr(target_arch)),
m_register_count(PrivateGetRegisterCount(target_arch)) {}
-size_t RegisterContextFreeBSD_x86_64::GetGPRSize() const { return sizeof(GPR); }
+size_t RegisterInfoFreeBSD_x86_64::GetGPRSize() const { return sizeof(GPR); }
-const RegisterInfo *RegisterContextFreeBSD_x86_64::GetRegisterInfo() const {
+const RegisterInfo *RegisterInfoFreeBSD_x86_64::GetRegisterInfo() const {
return m_register_info_p;
}
-uint32_t RegisterContextFreeBSD_x86_64::GetRegisterCount() const {
+uint32_t RegisterInfoFreeBSD_x86_64::GetRegisterCount() const {
return m_register_count;
}
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.h b/lldb/source/Plugins/Process/Utility/RegisterInfoFreeBSD_x86_64.h
similarity index 67%
rename from lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.h
rename to lldb/source/Plugins/Process/Utility/RegisterInfoFreeBSD_x86_64.h
index d0f69fde181751..a6b0a7959a3fa0 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.h
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoFreeBSD_x86_64.h
@@ -1,4 +1,4 @@
-//===-- RegisterContextFreeBSD_x86_64.h -------------------------*- C++ -*-===//
+//===-- RegisterInfoFreeBSD_x86_64.h ----------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,15 +6,15 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTFREEBSD_X86_64_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTFREEBSD_X86_64_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOFREEBSD_X86_64_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOFREEBSD_X86_64_H
#include "RegisterInfoInterface.h"
-class RegisterContextFreeBSD_x86_64
+class RegisterInfoFreeBSD_x86_64
: public lldb_private::RegisterInfoInterface {
public:
- RegisterContextFreeBSD_x86_64(const lldb_private::ArchSpec &target_arch);
+ RegisterInfoFreeBSD_x86_64(const lldb_private::ArchSpec &target_arch);
size_t GetGPRSize() const override;
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp b/lldb/source/Plugins/Process/Utility/RegisterInfoLinux_i386.cpp
similarity index 88%
rename from lldb/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp
rename to lldb/source/Plugins/Process/Utility/RegisterInfoLinux_i386.cpp
index a491e4536b873e..eaa11ca4f3dce5 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoLinux_i386.cpp
@@ -1,12 +1,12 @@
-//===-- RegisterContextLinux_i386.cpp -------------------------------------===//
+//===-- RegisterInfoLinux_i386.cpp ----------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
-//===---------------------------------------------------------------------===//
+//===----------------------------------------------------------------------===//
-#include "RegisterContextLinux_i386.h"
+#include "RegisterInfoLinux_i386.h"
#include "RegisterContext_x86.h"
#include "lldb-x86-register-enums.h"
#include "lldb/lldb-defines.h"
@@ -88,9 +88,9 @@ struct UserArea {
#include "RegisterInfos_i386.h"
#undef DECLARE_REGISTER_INFOS_I386_STRUCT
-RegisterContextLinux_i386::RegisterContextLinux_i386(
+RegisterInfoLinux_i386::RegisterInfoLinux_i386(
const ArchSpec &target_arch)
- : RegisterContextLinux_x86(
+ : RegisterInfoLinux_x86(
target_arch,
{"orig_eax",
nullptr,
@@ -104,9 +104,9 @@ RegisterContextLinux_i386::RegisterContextLinux_i386(
nullptr,
nullptr}) {}
-size_t RegisterContextLinux_i386::GetGPRSizeStatic() { return sizeof(GPR); }
+size_t RegisterInfoLinux_i386::GetGPRSizeStatic() { return sizeof(GPR); }
-const RegisterInfo *RegisterContextLinux_i386::GetRegisterInfo() const {
+const RegisterInfo *RegisterInfoLinux_i386::GetRegisterInfo() const {
switch (GetTargetArchitecture().GetMachine()) {
case llvm::Triple::x86:
case llvm::Triple::x86_64:
@@ -117,11 +117,11 @@ const RegisterInfo *RegisterContextLinux_i386::GetRegisterInfo() const {
}
}
-uint32_t RegisterContextLinux_i386::GetRegisterCount() const {
+uint32_t RegisterInfoLinux_i386::GetRegisterCount() const {
return static_cast<uint32_t>(sizeof(g_register_infos_i386) /
sizeof(g_register_infos_i386[0]));
}
-uint32_t RegisterContextLinux_i386::GetUserRegisterCount() const {
+uint32_t RegisterInfoLinux_i386::GetUserRegisterCount() const {
return static_cast<uint32_t>(k_num_user_registers_i386);
}
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_i386.h b/lldb/source/Plugins/Process/Utility/RegisterInfoLinux_i386.h
similarity index 58%
rename from lldb/source/Plugins/Process/Utility/RegisterContextLinux_i386.h
rename to lldb/source/Plugins/Process/Utility/RegisterInfoLinux_i386.h
index c10613993689bb..f3e8ad1285c1cc 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_i386.h
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoLinux_i386.h
@@ -1,4 +1,4 @@
-//===-- RegisterContextLinux_i386.h -----------------------------*- C++ -*-===//
+//===-- RegisterInfoLinux_i386.h --------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,15 +6,15 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTLINUX_I386_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTLINUX_I386_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOLINUX_I386_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOLINUX_I386_H
-#include "Plugins/Process/Utility/RegisterContextLinux_x86.h"
+#include "Plugins/Process/Utility/RegisterInfoLinux_x86.h"
-class RegisterContextLinux_i386
- : public lldb_private::RegisterContextLinux_x86 {
+class RegisterInfoLinux_i386
+ : public lldb_private::RegisterInfoLinux_x86 {
public:
- RegisterContextLinux_i386(const lldb_private::ArchSpec &target_arch);
+ RegisterInfoLinux_i386(const lldb_private::ArchSpec &target_arch);
static size_t GetGPRSizeStatic();
size_t GetGPRSize() const override { return GetGPRSizeStatic(); }
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_s390x.cpp b/lldb/source/Plugins/Process/Utility/RegisterInfoLinux_s390x.cpp
similarity index 80%
rename from lldb/source/Plugins/Process/Utility/RegisterContextLinux_s390x.cpp
rename to lldb/source/Plugins/Process/Utility/RegisterInfoLinux_s390x.cpp
index 77627cfbdefe7f..1a3e941c2a35c6 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_s390x.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoLinux_s390x.cpp
@@ -1,4 +1,4 @@
-//===-- RegisterContextLinux_s390x.cpp ------------------------------------===//
+//===-- RegisterInfoLinux_s390x.cpp ---------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "RegisterContextLinux_s390x.h"
+#include "RegisterInfoLinux_s390x.h"
#include "RegisterContextPOSIX_s390x.h"
using namespace lldb_private;
@@ -47,23 +47,23 @@ static uint32_t GetUserRegisterInfoCount(const ArchSpec &target_arch) {
}
}
-RegisterContextLinux_s390x::RegisterContextLinux_s390x(
+RegisterInfoLinux_s390x::RegisterInfoLinux_s390x(
const ArchSpec &target_arch)
: lldb_private::RegisterInfoInterface(target_arch),
m_register_info_p(GetRegisterInfoPtr(target_arch)),
m_register_info_count(GetRegisterInfoCount(target_arch)),
m_user_register_count(GetUserRegisterInfoCount(target_arch)) {}
-const RegisterInfo *RegisterContextLinux_s390x::GetRegisterInfo() const {
+const RegisterInfo *RegisterInfoLinux_s390x::GetRegisterInfo() const {
return m_register_info_p;
}
-uint32_t RegisterContextLinux_s390x::GetRegisterCount() const {
+uint32_t RegisterInfoLinux_s390x::GetRegisterCount() const {
return m_register_info_count;
}
-uint32_t RegisterContextLinux_s390x::GetUserRegisterCount() const {
+uint32_t RegisterInfoLinux_s390x::GetUserRegisterCount() const {
return m_user_register_count;
}
-size_t RegisterContextLinux_s390x::GetGPRSize() const { return 0; }
+size_t RegisterInfoLinux_s390x::GetGPRSize() const { return 0; }
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_s390x.h b/lldb/source/Plugins/Process/Utility/RegisterInfoLinux_s390x.h
similarity index 65%
rename from lldb/source/Plugins/Process/Utility/RegisterContextLinux_s390x.h
rename to lldb/source/Plugins/Process/Utility/RegisterInfoLinux_s390x.h
index 6bfe34de7acf19..f9857b2c60b3cb 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_s390x.h
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoLinux_s390x.h
@@ -1,4 +1,4 @@
-//===-- RegisterContextLinux_s390x.h ----------------------------*- C++ -*-===//
+//===-- RegisterInfoLinux_s390x.h -------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,14 +6,14 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTLINUX_S390X_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTLINUX_S390X_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOLINUX_S390X_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOLINUX_S390X_H
#include "RegisterInfoInterface.h"
-class RegisterContextLinux_s390x : public lldb_private::RegisterInfoInterface {
+class RegisterInfoLinux_s390x : public lldb_private::RegisterInfoInterface {
public:
- RegisterContextLinux_s390x(const lldb_private::ArchSpec &target_arch);
+ RegisterInfoLinux_s390x(const lldb_private::ArchSpec &target_arch);
size_t GetGPRSize() const override;
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_x86.h b/lldb/source/Plugins/Process/Utility/RegisterInfoLinux_x86.h
similarity index 67%
rename from lldb/source/Plugins/Process/Utility/RegisterContextLinux_x86.h
rename to lldb/source/Plugins/Process/Utility/RegisterInfoLinux_x86.h
index 0e1863864aa6c5..485daf764225f2 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_x86.h
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoLinux_x86.h
@@ -1,4 +1,4 @@
-//===-- RegisterContextLinux_i386.h -----------------------------*- C++ -*-===//
+//===-- RegisterInfoLinux_i386.h --------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,16 +6,16 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTLINUX_X86_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTLINUX_X86_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOLINUX_X86_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOLINUX_X86_H
#include "RegisterInfoInterface.h"
namespace lldb_private {
-class RegisterContextLinux_x86 : public RegisterInfoInterface {
+class RegisterInfoLinux_x86 : public RegisterInfoInterface {
public:
- RegisterContextLinux_x86(const ArchSpec &target_arch,
+ RegisterInfoLinux_x86(const ArchSpec &target_arch,
RegisterInfo orig_ax_info)
: RegisterInfoInterface(target_arch), m_orig_ax_info(orig_ax_info) {}
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp b/lldb/source/Plugins/Process/Utility/RegisterInfoLinux_x86_64.cpp
similarity index 89%
rename from lldb/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp
rename to lldb/source/Plugins/Process/Utility/RegisterInfoLinux_x86_64.cpp
index ae105043971253..a64c610d034e19 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoLinux_x86_64.cpp
@@ -1,13 +1,13 @@
-//===-- RegisterContextLinux_x86_64.cpp -----------------------------------===//
+//===-- RegisterInfoLinux_x86_64.cpp -------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
-//===---------------------------------------------------------------------===//
+//===----------------------------------------------------------------------===//
-#include "RegisterContextLinux_x86_64.h"
-#include "RegisterContextLinux_i386.h"
+#include "RegisterInfoLinux_x86_64.h"
+#include "RegisterInfoLinux_i386.h"
#include "RegisterContext_x86.h"
#include "lldb-x86-register-enums.h"
#include "lldb/lldb-defines.h"
@@ -96,8 +96,8 @@ GetRegisterInfo_i386(const lldb_private::ArchSpec &arch) {
// Allocate RegisterInfo only once
if (g_register_infos.empty()) {
// Copy the register information from base class
- std::unique_ptr<RegisterContextLinux_i386> reg_interface(
- new RegisterContextLinux_i386(arch));
+ std::unique_ptr<RegisterInfoLinux_i386> reg_interface(
+ new RegisterInfoLinux_i386(arch));
const RegisterInfo *base_info = reg_interface->GetRegisterInfo();
g_register_infos.insert(g_register_infos.end(), &base_info[0],
&base_info[k_num_registers_i386]);
@@ -152,9 +152,9 @@ static uint32_t GetUserRegisterInfoCount(const ArchSpec &target_arch) {
}
}
-RegisterContextLinux_x86_64::RegisterContextLinux_x86_64(
+RegisterInfoLinux_x86_64::RegisterInfoLinux_x86_64(
const ArchSpec &target_arch)
- : lldb_private::RegisterContextLinux_x86(
+ : lldb_private::RegisterInfoLinux_x86(
target_arch,
{"orig_rax",
nullptr,
@@ -171,16 +171,16 @@ RegisterContextLinux_x86_64::RegisterContextLinux_x86_64(
m_register_info_count(GetRegisterInfoCount(target_arch)),
m_user_register_count(GetUserRegisterInfoCount(target_arch)) {}
-size_t RegisterContextLinux_x86_64::GetGPRSizeStatic() { return sizeof(GPR); }
+size_t RegisterInfoLinux_x86_64::GetGPRSizeStatic() { return sizeof(GPR); }
-const RegisterInfo *RegisterContextLinux_x86_64::GetRegisterInfo() const {
+const RegisterInfo *RegisterInfoLinux_x86_64::GetRegisterInfo() const {
return m_register_info_p;
}
-uint32_t RegisterContextLinux_x86_64::GetRegisterCount() const {
+uint32_t RegisterInfoLinux_x86_64::GetRegisterCount() const {
return m_register_info_count;
}
-uint32_t RegisterContextLinux_x86_64::GetUserRegisterCount() const {
+uint32_t RegisterInfoLinux_x86_64::GetUserRegisterCount() const {
return m_user_register_count;
}
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.h b/lldb/source/Plugins/Process/Utility/RegisterInfoLinux_x86_64.h
similarity index 62%
rename from lldb/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.h
rename to lldb/source/Plugins/Process/Utility/RegisterInfoLinux_x86_64.h
index d141ba66b4e203..bb3906baf2af03 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.h
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoLinux_x86_64.h
@@ -1,4 +1,4 @@
-//===-- RegisterContextLinux_x86_64.h ---------------------------*- C++ -*-===//
+//===-- RegisterInfoLinux_x86_64.h ------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,15 +6,15 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTLINUX_X86_64_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTLINUX_X86_64_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOLINUX_X86_64_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOLINUX_X86_64_H
-#include "Plugins/Process/Utility/RegisterContextLinux_x86.h"
+#include "Plugins/Process/Utility/RegisterInfoLinux_x86.h"
-class RegisterContextLinux_x86_64
- : public lldb_private::RegisterContextLinux_x86 {
+class RegisterInfoLinux_x86_64
+ : public lldb_private::RegisterInfoLinux_x86 {
public:
- RegisterContextLinux_x86_64(const lldb_private::ArchSpec &target_arch);
+ RegisterInfoLinux_x86_64(const lldb_private::ArchSpec &target_arch);
static size_t GetGPRSizeStatic();
size_t GetGPRSize() const override { return GetGPRSizeStatic(); }
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_i386.cpp b/lldb/source/Plugins/Process/Utility/RegisterInfoNetBSD_i386.cpp
similarity index 87%
rename from lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_i386.cpp
rename to lldb/source/Plugins/Process/Utility/RegisterInfoNetBSD_i386.cpp
index b1c4b773f36374..c8ec4c688be4e7 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_i386.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoNetBSD_i386.cpp
@@ -1,4 +1,4 @@
-//===-- RegisterContextNetBSD_i386.cpp --------------------------*- C++ -*-===//
+//===-- RegisterInfoNetBSD_i386.cpp -----------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "RegisterContextNetBSD_i386.h"
+#include "RegisterInfoNetBSD_i386.h"
#include "RegisterContext_x86.h"
#include "lldb-x86-register-enums.h"
#include "lldb/lldb-defines.h"
@@ -75,13 +75,13 @@ struct UserArea {
#include "RegisterInfos_i386.h"
#undef DECLARE_REGISTER_INFOS_I386_STRUCT
-RegisterContextNetBSD_i386::RegisterContextNetBSD_i386(
+RegisterInfoNetBSD_i386::RegisterInfoNetBSD_i386(
const ArchSpec &target_arch)
: RegisterInfoInterface(target_arch) {}
-size_t RegisterContextNetBSD_i386::GetGPRSize() const { return sizeof(GPR); }
+size_t RegisterInfoNetBSD_i386::GetGPRSize() const { return sizeof(GPR); }
-const RegisterInfo *RegisterContextNetBSD_i386::GetRegisterInfo() const {
+const RegisterInfo *RegisterInfoNetBSD_i386::GetRegisterInfo() const {
switch (GetTargetArchitecture().GetMachine()) {
case llvm::Triple::x86:
case llvm::Triple::x86_64:
@@ -92,7 +92,7 @@ const RegisterInfo *RegisterContextNetBSD_i386::GetRegisterInfo() const {
}
}
-uint32_t RegisterContextNetBSD_i386::GetRegisterCount() const {
+uint32_t RegisterInfoNetBSD_i386::GetRegisterCount() const {
return static_cast<uint32_t>(sizeof(g_register_infos_i386) /
sizeof(g_register_infos_i386[0]));
}
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_i386.h b/lldb/source/Plugins/Process/Utility/RegisterInfoNetBSD_i386.h
similarity index 58%
rename from lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_i386.h
rename to lldb/source/Plugins/Process/Utility/RegisterInfoNetBSD_i386.h
index 5a3e5b0551d64e..64583363ad6fc7 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_i386.h
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoNetBSD_i386.h
@@ -1,4 +1,4 @@
-//===-- RegisterContextFreeBSD_i386.h ---------------------------*- C++ -*-===//
+//===-- RegisterInfoNetBSD_i386.h -------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,14 +6,14 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTFREEBSD_I386_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTFREEBSD_I386_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFONETBSD_I386_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFONETBSD_I386_H
#include "RegisterInfoInterface.h"
-class RegisterContextFreeBSD_i386 : public lldb_private::RegisterInfoInterface {
+class RegisterInfoNetBSD_i386 : public lldb_private::RegisterInfoInterface {
public:
- RegisterContextFreeBSD_i386(const lldb_private::ArchSpec &target_arch);
+ RegisterInfoNetBSD_i386(const lldb_private::ArchSpec &target_arch);
size_t GetGPRSize() const override;
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp b/lldb/source/Plugins/Process/Utility/RegisterInfoNetBSD_x86_64.cpp
similarity index 89%
rename from lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp
rename to lldb/source/Plugins/Process/Utility/RegisterInfoNetBSD_x86_64.cpp
index d3e7466654e78f..8f2c619b290d57 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoNetBSD_x86_64.cpp
@@ -1,4 +1,4 @@
-//===-- RegisterContextNetBSD_x86_64.cpp ----------------------------------===//
+//===-- RegisterInfoNetBSD_x86_64.cpp -------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#include "RegisterContextNetBSD_x86_64.h"
-#include "RegisterContextNetBSD_i386.h"
+#include "RegisterInfoNetBSD_x86_64.h"
+#include "RegisterInfoNetBSD_i386.h"
#include "RegisterContext_x86.h"
#include "lldb-x86-register-enums.h"
#include "lldb/lldb-defines.h"
@@ -99,8 +99,8 @@ GetRegisterInfo_i386(const lldb_private::ArchSpec &arch) {
// Allocate RegisterInfo only once
if (g_register_infos.empty()) {
// Copy the register information from base class
- std::unique_ptr<RegisterContextNetBSD_i386> reg_interface(
- new RegisterContextNetBSD_i386(arch));
+ std::unique_ptr<RegisterInfoNetBSD_i386> reg_interface(
+ new RegisterInfoNetBSD_i386(arch));
const RegisterInfo *base_info = reg_interface->GetRegisterInfo();
g_register_infos.insert(g_register_infos.end(), &base_info[0],
&base_info[k_num_registers_i386]);
@@ -158,23 +158,23 @@ PrivateGetUserRegisterCount(const lldb_private::ArchSpec &target_arch) {
}
}
-RegisterContextNetBSD_x86_64::RegisterContextNetBSD_x86_64(
+RegisterInfoNetBSD_x86_64::RegisterInfoNetBSD_x86_64(
const ArchSpec &target_arch)
: lldb_private::RegisterInfoInterface(target_arch),
m_register_info_p(PrivateGetRegisterInfoPtr(target_arch)),
m_register_count(PrivateGetRegisterCount(target_arch)),
m_user_register_count(PrivateGetUserRegisterCount(target_arch)) {}
-size_t RegisterContextNetBSD_x86_64::GetGPRSize() const { return sizeof(GPR); }
+size_t RegisterInfoNetBSD_x86_64::GetGPRSize() const { return sizeof(GPR); }
-const RegisterInfo *RegisterContextNetBSD_x86_64::GetRegisterInfo() const {
+const RegisterInfo *RegisterInfoNetBSD_x86_64::GetRegisterInfo() const {
return m_register_info_p;
}
-uint32_t RegisterContextNetBSD_x86_64::GetRegisterCount() const {
+uint32_t RegisterInfoNetBSD_x86_64::GetRegisterCount() const {
return m_register_count;
}
-uint32_t RegisterContextNetBSD_x86_64::GetUserRegisterCount() const {
+uint32_t RegisterInfoNetBSD_x86_64::GetUserRegisterCount() const {
return m_user_register_count;
}
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.h b/lldb/source/Plugins/Process/Utility/RegisterInfoNetBSD_x86_64.h
similarity index 70%
rename from lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.h
rename to lldb/source/Plugins/Process/Utility/RegisterInfoNetBSD_x86_64.h
index 6f97875060131b..eea75df498f311 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.h
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoNetBSD_x86_64.h
@@ -1,4 +1,4 @@
-//===-- RegisterContextNetBSD_x86_64.h --------------------------*- C++ -*-===//
+//===-- RegisterInfoNetBSD_x86_64.h -----------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,15 +6,15 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTNETBSD_X86_64_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTNETBSD_X86_64_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFONETBSD_X86_64_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFONETBSD_X86_64_H
#include "RegisterInfoInterface.h"
-class RegisterContextNetBSD_x86_64
+class RegisterInfoNetBSD_x86_64
: public lldb_private::RegisterInfoInterface {
public:
- RegisterContextNetBSD_x86_64(const lldb_private::ArchSpec &target_arch);
+ RegisterInfoNetBSD_x86_64(const lldb_private::ArchSpec &target_arch);
size_t GetGPRSize() const override;
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_i386.cpp b/lldb/source/Plugins/Process/Utility/RegisterInfoOpenBSD_i386.cpp
similarity index 81%
rename from lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_i386.cpp
rename to lldb/source/Plugins/Process/Utility/RegisterInfoOpenBSD_i386.cpp
index b868f3aed848ac..c08b929e458d1e 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_i386.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoOpenBSD_i386.cpp
@@ -1,12 +1,12 @@
-//===-- RegisterContextOpenBSD_i386.cpp -----------------------------------===//
+//===-- RegisterInfoOpenBSD_i386.cpp --------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
-//===---------------------------------------------------------------------===//
+//===----------------------------------------------------------------------===//
-#include "RegisterContextOpenBSD_i386.h"
+#include "RegisterInfoOpenBSD_i386.h"
#include "RegisterContext_x86.h"
#include "lldb-x86-register-enums.h"
#include "lldb/lldb-defines.h"
@@ -57,13 +57,13 @@ struct UserArea {
#include "RegisterInfos_i386.h"
#undef DECLARE_REGISTER_INFOS_I386_STRUCT
-RegisterContextOpenBSD_i386::RegisterContextOpenBSD_i386(
+RegisterInfoOpenBSD_i386::RegisterInfoOpenBSD_i386(
const ArchSpec &target_arch)
: RegisterInfoInterface(target_arch) {}
-size_t RegisterContextOpenBSD_i386::GetGPRSize() const { return sizeof(GPR); }
+size_t RegisterInfoOpenBSD_i386::GetGPRSize() const { return sizeof(GPR); }
-const RegisterInfo *RegisterContextOpenBSD_i386::GetRegisterInfo() const {
+const RegisterInfo *RegisterInfoOpenBSD_i386::GetRegisterInfo() const {
switch (GetTargetArchitecture().GetMachine()) {
case llvm::Triple::x86:
return g_register_infos_i386;
@@ -73,7 +73,7 @@ const RegisterInfo *RegisterContextOpenBSD_i386::GetRegisterInfo() const {
}
}
-uint32_t RegisterContextOpenBSD_i386::GetRegisterCount() const {
+uint32_t RegisterInfoOpenBSD_i386::GetRegisterCount() const {
return static_cast<uint32_t>(sizeof(g_register_infos_i386) /
sizeof(g_register_infos_i386[0]));
}
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_i386.h b/lldb/source/Plugins/Process/Utility/RegisterInfoOpenBSD_i386.h
similarity index 58%
rename from lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_i386.h
rename to lldb/source/Plugins/Process/Utility/RegisterInfoOpenBSD_i386.h
index e6e24525b7fd98..5cb2ac27f3e66a 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_i386.h
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoOpenBSD_i386.h
@@ -1,4 +1,4 @@
-//===-- RegisterContextOpenBSD_i386.h ---------------------------*- C++ -*-===//
+//===-- RegisterInfoOpenBSD_i386.h ------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,14 +6,14 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTOPENBSD_I386_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTOPENBSD_I386_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOOPENBSD_I386_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOOPENBSD_I386_H
#include "RegisterInfoInterface.h"
-class RegisterContextOpenBSD_i386 : public lldb_private::RegisterInfoInterface {
+class RegisterInfoOpenBSD_i386 : public lldb_private::RegisterInfoInterface {
public:
- RegisterContextOpenBSD_i386(const lldb_private::ArchSpec &target_arch);
+ RegisterInfoOpenBSD_i386(const lldb_private::ArchSpec &target_arch);
size_t GetGPRSize() const override;
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_x86_64.cpp b/lldb/source/Plugins/Process/Utility/RegisterInfoOpenBSD_x86_64.cpp
similarity index 85%
rename from lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_x86_64.cpp
rename to lldb/source/Plugins/Process/Utility/RegisterInfoOpenBSD_x86_64.cpp
index 4d7b8970affcb5..ad0596c03c1c74 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_x86_64.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoOpenBSD_x86_64.cpp
@@ -1,12 +1,12 @@
-//===-- RegisterContextOpenBSD_x86_64.cpp ---------------------------------===//
+//===-- RegisterInfoOpenBSD_x86_64.cpp ------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
-//===---------------------------------------------------------------------===//
+//===----------------------------------------------------------------------===//
-#include "RegisterContextOpenBSD_x86_64.h"
+#include "RegisterInfoOpenBSD_x86_64.h"
#include "RegisterContext_x86.h"
#include "lldb-x86-register-enums.h"
#include "lldb/lldb-defines.h"
@@ -89,18 +89,18 @@ PrivateGetRegisterCount(const lldb_private::ArchSpec &target_arch) {
}
}
-RegisterContextOpenBSD_x86_64::RegisterContextOpenBSD_x86_64(
+RegisterInfoOpenBSD_x86_64::RegisterInfoOpenBSD_x86_64(
const ArchSpec &target_arch)
: lldb_private::RegisterInfoInterface(target_arch),
m_register_info_p(PrivateGetRegisterInfoPtr(target_arch)),
m_register_count(PrivateGetRegisterCount(target_arch)) {}
-size_t RegisterContextOpenBSD_x86_64::GetGPRSize() const { return sizeof(GPR); }
+size_t RegisterInfoOpenBSD_x86_64::GetGPRSize() const { return sizeof(GPR); }
-const RegisterInfo *RegisterContextOpenBSD_x86_64::GetRegisterInfo() const {
+const RegisterInfo *RegisterInfoOpenBSD_x86_64::GetRegisterInfo() const {
return m_register_info_p;
}
-uint32_t RegisterContextOpenBSD_x86_64::GetRegisterCount() const {
+uint32_t RegisterInfoOpenBSD_x86_64::GetRegisterCount() const {
return m_register_count;
}
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_x86_64.h b/lldb/source/Plugins/Process/Utility/RegisterInfoOpenBSD_x86_64.h
similarity index 67%
rename from lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_x86_64.h
rename to lldb/source/Plugins/Process/Utility/RegisterInfoOpenBSD_x86_64.h
index b399c721546a93..a0458b593d3811 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_x86_64.h
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoOpenBSD_x86_64.h
@@ -1,4 +1,4 @@
-//===-- RegisterContextOpenBSD_x86_64.h -------------------------*- C++ -*-===//
+//===-- RegisterInfoOpenBSD_x86_64.h ----------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,15 +6,15 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTOPENBSD_X86_64_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTOPENBSD_X86_64_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOOPENBSD_X86_64_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOOPENBSD_X86_64_H
#include "RegisterInfoInterface.h"
-class RegisterContextOpenBSD_x86_64
+class RegisterInfoOpenBSD_x86_64
: public lldb_private::RegisterInfoInterface {
public:
- RegisterContextOpenBSD_x86_64(const lldb_private::ArchSpec &target_arch);
+ RegisterInfoOpenBSD_x86_64(const lldb_private::ArchSpec &target_arch);
size_t GetGPRSize() const override;
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextWindows_i386.cpp b/lldb/source/Plugins/Process/Utility/RegisterInfoWindows_i386.cpp
similarity index 89%
rename from lldb/source/Plugins/Process/Utility/RegisterContextWindows_i386.cpp
rename to lldb/source/Plugins/Process/Utility/RegisterInfoWindows_i386.cpp
index 093a43a828cdce..2e4c40b8074596 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextWindows_i386.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoWindows_i386.cpp
@@ -1,4 +1,4 @@
-//===-- RegisterContextWindows_i386.cpp -----------------------------------===//
+//===-- RegisterInfoWindows_i386.cpp --------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "RegisterContextWindows_i386.h"
+#include "RegisterInfoWindows_i386.h"
#include "RegisterContext_x86.h"
#include "lldb-x86-register-enums.h"
#include "lldb/lldb-defines.h"
@@ -69,22 +69,22 @@ static RegisterInfo g_register_infos_i386[] = {
// clang-format on
} // namespace
-RegisterContextWindows_i386::RegisterContextWindows_i386(
+RegisterInfoWindows_i386::RegisterInfoWindows_i386(
const ArchSpec &target_arch)
: lldb_private::RegisterInfoInterface(target_arch) {
assert(target_arch.GetMachine() == llvm::Triple::x86);
}
-const RegisterInfo *RegisterContextWindows_i386::GetRegisterInfo() const {
+const RegisterInfo *RegisterInfoWindows_i386::GetRegisterInfo() const {
return g_register_infos_i386;
}
-uint32_t RegisterContextWindows_i386::GetRegisterCount() const {
+uint32_t RegisterInfoWindows_i386::GetRegisterCount() const {
return std::size(g_register_infos_i386);
}
-uint32_t RegisterContextWindows_i386::GetUserRegisterCount() const {
+uint32_t RegisterInfoWindows_i386::GetUserRegisterCount() const {
return std::size(g_register_infos_i386);
}
-size_t RegisterContextWindows_i386::GetGPRSize() const { return sizeof(GPR); }
+size_t RegisterInfoWindows_i386::GetGPRSize() const { return sizeof(GPR); }
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextWindows_i386.h b/lldb/source/Plugins/Process/Utility/RegisterInfoWindows_i386.h
similarity index 60%
rename from lldb/source/Plugins/Process/Utility/RegisterContextWindows_i386.h
rename to lldb/source/Plugins/Process/Utility/RegisterInfoWindows_i386.h
index 6a5d3524300dc9..4489edcecfe156 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextWindows_i386.h
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoWindows_i386.h
@@ -1,4 +1,4 @@
-//===-- RegisterContextWindows_i386.h ---------------------------*- C++ -*-===//
+//===-- RegisterInfoWindows_i386.h ------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,14 +6,14 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTWINDOWS_I386_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTWINDOWS_I386_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOWINDOWS_I386_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOWINDOWS_I386_H
#include "RegisterInfoInterface.h"
-class RegisterContextWindows_i386 : public lldb_private::RegisterInfoInterface {
+class RegisterInfoWindows_i386 : public lldb_private::RegisterInfoInterface {
public:
- RegisterContextWindows_i386(const lldb_private::ArchSpec &target_arch);
+ RegisterInfoWindows_i386(const lldb_private::ArchSpec &target_arch);
size_t GetGPRSize() const override;
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextWindows_x86_64.cpp b/lldb/source/Plugins/Process/Utility/RegisterInfoWindows_x86_64.cpp
similarity index 93%
rename from lldb/source/Plugins/Process/Utility/RegisterContextWindows_x86_64.cpp
rename to lldb/source/Plugins/Process/Utility/RegisterInfoWindows_x86_64.cpp
index b5e255ead06df2..9b8d810045d0ea 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextWindows_x86_64.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoWindows_x86_64.cpp
@@ -1,4 +1,4 @@
-//===-- RegisterContextWindows_x86_64.cpp ---------------------------------===//
+//===-- RegisterInfoWindows_x86_64.cpp ------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "RegisterContextWindows_x86_64.h"
+#include "RegisterInfoWindows_x86_64.h"
#include "RegisterContext_x86.h"
#include "lldb-x86-register-enums.h"
#include "lldb/lldb-defines.h"
@@ -132,22 +132,22 @@ static RegisterInfo g_register_infos_x86_64[] = {
// clang-format on
} // namespace
-RegisterContextWindows_x86_64::RegisterContextWindows_x86_64(
+RegisterInfoWindows_x86_64::RegisterInfoWindows_x86_64(
const ArchSpec &target_arch)
: lldb_private::RegisterInfoInterface(target_arch) {
assert(target_arch.GetMachine() == llvm::Triple::x86_64);
}
-const RegisterInfo *RegisterContextWindows_x86_64::GetRegisterInfo() const {
+const RegisterInfo *RegisterInfoWindows_x86_64::GetRegisterInfo() const {
return g_register_infos_x86_64;
}
-uint32_t RegisterContextWindows_x86_64::GetRegisterCount() const {
+uint32_t RegisterInfoWindows_x86_64::GetRegisterCount() const {
return std::size(g_register_infos_x86_64);
}
-uint32_t RegisterContextWindows_x86_64::GetUserRegisterCount() const {
+uint32_t RegisterInfoWindows_x86_64::GetUserRegisterCount() const {
return std::size(g_register_infos_x86_64);
}
-size_t RegisterContextWindows_x86_64::GetGPRSize() const { return sizeof(GPR); }
+size_t RegisterInfoWindows_x86_64::GetGPRSize() const { return sizeof(GPR); }
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextWindows_x86_64.h b/lldb/source/Plugins/Process/Utility/RegisterInfoWindows_x86_64.h
similarity index 65%
rename from lldb/source/Plugins/Process/Utility/RegisterContextWindows_x86_64.h
rename to lldb/source/Plugins/Process/Utility/RegisterInfoWindows_x86_64.h
index c29acf284841ff..1a93ef9017d633 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextWindows_x86_64.h
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoWindows_x86_64.h
@@ -1,4 +1,4 @@
-//===-- RegisterContextWindows_x86_64.h --- ---------------------*- C++ -*-===//
+//===-- RegisterInfoWindows_x86_64.h ----------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,15 +6,15 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTWINDOWS_X86_64_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTWINDOWS_X86_64_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOWINDOWS_X86_64_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOWINDOWS_X86_64_H
#include "RegisterInfoInterface.h"
-class RegisterContextWindows_x86_64
+class RegisterInfoWindows_x86_64
: public lldb_private::RegisterInfoInterface {
public:
- RegisterContextWindows_x86_64(const lldb_private::ArchSpec &target_arch);
+ RegisterInfoWindows_x86_64(const lldb_private::ArchSpec &target_arch);
size_t GetGPRSize() const override;
diff --git a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_WoW64.cpp b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_WoW64.cpp
index 069c327ee2f9a6..b188bf979a01b4 100644
--- a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_WoW64.cpp
+++ b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_WoW64.cpp
@@ -11,7 +11,7 @@
#include "NativeRegisterContextWindows_WoW64.h"
#include "NativeThreadWindows.h"
-#include "Plugins/Process/Utility/RegisterContextWindows_i386.h"
+#include "Plugins/Process/Utility/RegisterInfoWindows_i386.h"
#include "ProcessWindowsLog.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Host/HostThread.h"
@@ -53,7 +53,7 @@ CreateRegisterInfoInterface(const ArchSpec &target_arch) {
assert((target_arch.GetAddressByteSize() == 4 &&
HostInfo::GetArchitecture().GetAddressByteSize() == 8) &&
"Register setting path assumes this is a 64-bit host");
- return new RegisterContextWindows_i386(target_arch);
+ return new RegisterInfoWindows_i386(target_arch);
}
static Status
diff --git a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_i386.cpp b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_i386.cpp
index 7c13759df462da..940ae503a97c8c 100644
--- a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_i386.cpp
+++ b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_i386.cpp
@@ -11,7 +11,7 @@
#include "NativeRegisterContextWindows_i386.h"
#include "NativeThreadWindows.h"
-#include "Plugins/Process/Utility/RegisterContextWindows_i386.h"
+#include "Plugins/Process/Utility/RegisterInfoWindows_i386.h"
#include "ProcessWindowsLog.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Host/HostThread.h"
@@ -49,7 +49,7 @@ static RegisterInfoInterface *
CreateRegisterInfoInterface(const ArchSpec &target_arch) {
assert((HostInfo::GetArchitecture().GetAddressByteSize() == 4) &&
"Register setting path assumes this is a 32-bit host");
- return new RegisterContextWindows_i386(target_arch);
+ return new RegisterInfoWindows_i386(target_arch);
}
static Status GetThreadContextHelper(lldb::thread_t thread_handle,
diff --git a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_x86_64.cpp b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_x86_64.cpp
index c54c31e48e4e5f..0695a42fc1848a 100644
--- a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_x86_64.cpp
+++ b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_x86_64.cpp
@@ -11,8 +11,8 @@
#include "NativeRegisterContextWindows_x86_64.h"
#include "NativeRegisterContextWindows_WoW64.h"
#include "NativeThreadWindows.h"
-#include "Plugins/Process/Utility/RegisterContextWindows_i386.h"
-#include "Plugins/Process/Utility/RegisterContextWindows_x86_64.h"
+#include "Plugins/Process/Utility/RegisterInfoWindows_i386.h"
+#include "Plugins/Process/Utility/RegisterInfoWindows_x86_64.h"
#include "ProcessWindowsLog.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Host/HostThread.h"
@@ -61,7 +61,7 @@ static RegisterInfoInterface *
CreateRegisterInfoInterface(const ArchSpec &target_arch) {
assert((HostInfo::GetArchitecture().GetAddressByteSize() == 8) &&
"Register setting path assumes this is a 64-bit host");
- return new RegisterContextWindows_x86_64(target_arch);
+ return new RegisterInfoWindows_x86_64(target_arch);
}
static Status GetThreadContextHelper(lldb::thread_t thread_handle,
diff --git a/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp b/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp
index a22eabe3d1efca..25f9a6a164d26f 100644
--- a/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp
+++ b/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp
@@ -16,16 +16,16 @@
#include "lldb/Utility/Log.h"
#include "lldb/Utility/ProcessInfo.h"
-#include "Plugins/Process/Utility/RegisterContextFreeBSD_i386.h"
-#include "Plugins/Process/Utility/RegisterContextFreeBSD_powerpc.h"
-#include "Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.h"
-#include "Plugins/Process/Utility/RegisterContextLinux_i386.h"
-#include "Plugins/Process/Utility/RegisterContextLinux_s390x.h"
-#include "Plugins/Process/Utility/RegisterContextLinux_x86_64.h"
-#include "Plugins/Process/Utility/RegisterContextNetBSD_i386.h"
-#include "Plugins/Process/Utility/RegisterContextNetBSD_x86_64.h"
-#include "Plugins/Process/Utility/RegisterContextOpenBSD_i386.h"
-#include "Plugins/Process/Utility/RegisterContextOpenBSD_x86_64.h"
+#include "Plugins/Process/Utility/RegisterInfoFreeBSD_i386.h"
+#include "Plugins/Process/Utility/RegisterInfoFreeBSD_powerpc.h"
+#include "Plugins/Process/Utility/RegisterInfoFreeBSD_x86_64.h"
+#include "Plugins/Process/Utility/RegisterInfoLinux_i386.h"
+#include "Plugins/Process/Utility/RegisterInfoLinux_s390x.h"
+#include "Plugins/Process/Utility/RegisterInfoLinux_x86_64.h"
+#include "Plugins/Process/Utility/RegisterInfoNetBSD_i386.h"
+#include "Plugins/Process/Utility/RegisterInfoNetBSD_x86_64.h"
+#include "Plugins/Process/Utility/RegisterInfoOpenBSD_i386.h"
+#include "Plugins/Process/Utility/RegisterInfoOpenBSD_x86_64.h"
#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm.h"
#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h"
#include "Plugins/Process/Utility/RegisterInfoPOSIX_ppc64le.h"
@@ -91,17 +91,17 @@ ThreadElfCore::CreateRegisterContextForFrame(StackFrame *frame) {
case llvm::Triple::arm:
break;
case llvm::Triple::ppc:
- reg_interface = new RegisterContextFreeBSD_powerpc32(arch);
+ reg_interface = new RegisterInfoFreeBSD_powerpc32(arch);
break;
case llvm::Triple::ppc64:
case llvm::Triple::ppc64le:
- reg_interface = new RegisterContextFreeBSD_powerpc64(arch);
+ reg_interface = new RegisterInfoFreeBSD_powerpc64(arch);
break;
case llvm::Triple::x86:
- reg_interface = new RegisterContextFreeBSD_i386(arch);
+ reg_interface = new RegisterInfoFreeBSD_i386(arch);
break;
case llvm::Triple::x86_64:
- reg_interface = new RegisterContextFreeBSD_x86_64(arch);
+ reg_interface = new RegisterInfoFreeBSD_x86_64(arch);
break;
default:
break;
@@ -114,10 +114,10 @@ ThreadElfCore::CreateRegisterContextForFrame(StackFrame *frame) {
case llvm::Triple::aarch64:
break;
case llvm::Triple::x86:
- reg_interface = new RegisterContextNetBSD_i386(arch);
+ reg_interface = new RegisterInfoNetBSD_i386(arch);
break;
case llvm::Triple::x86_64:
- reg_interface = new RegisterContextNetBSD_x86_64(arch);
+ reg_interface = new RegisterInfoNetBSD_x86_64(arch);
break;
default:
break;
@@ -134,13 +134,13 @@ ThreadElfCore::CreateRegisterContextForFrame(StackFrame *frame) {
reg_interface = new RegisterInfoPOSIX_ppc64le(arch);
break;
case llvm::Triple::systemz:
- reg_interface = new RegisterContextLinux_s390x(arch);
+ reg_interface = new RegisterInfoLinux_s390x(arch);
break;
case llvm::Triple::x86:
- reg_interface = new RegisterContextLinux_i386(arch);
+ reg_interface = new RegisterInfoLinux_i386(arch);
break;
case llvm::Triple::x86_64:
- reg_interface = new RegisterContextLinux_x86_64(arch);
+ reg_interface = new RegisterInfoLinux_x86_64(arch);
break;
default:
break;
@@ -153,10 +153,10 @@ ThreadElfCore::CreateRegisterContextForFrame(StackFrame *frame) {
case llvm::Triple::aarch64:
break;
case llvm::Triple::x86:
- reg_interface = new RegisterContextOpenBSD_i386(arch);
+ reg_interface = new RegisterInfoOpenBSD_i386(arch);
break;
case llvm::Triple::x86_64:
- reg_interface = new RegisterContextOpenBSD_x86_64(arch);
+ reg_interface = new RegisterInfoOpenBSD_x86_64(arch);
break;
default:
break;
diff --git a/lldb/source/Plugins/Process/minidump/ThreadMinidump.cpp b/lldb/source/Plugins/Process/minidump/ThreadMinidump.cpp
index fe62f89a3ac0e2..270dded14cf3b4 100644
--- a/lldb/source/Plugins/Process/minidump/ThreadMinidump.cpp
+++ b/lldb/source/Plugins/Process/minidump/ThreadMinidump.cpp
@@ -15,8 +15,8 @@
#include "RegisterContextMinidump_x86_32.h"
#include "RegisterContextMinidump_x86_64.h"
-#include "Plugins/Process/Utility/RegisterContextLinux_i386.h"
-#include "Plugins/Process/Utility/RegisterContextLinux_x86_64.h"
+#include "Plugins/Process/Utility/RegisterInfoLinux_i386.h"
+#include "Plugins/Process/Utility/RegisterInfoLinux_x86_64.h"
#include "Plugins/Process/elf-core/RegisterContextPOSIXCore_x86.h"
#include "Plugins/Process/elf-core/RegisterUtilities.h"
@@ -69,7 +69,7 @@ ThreadMinidump::CreateRegisterContextForFrame(StackFrame *frame) {
// TODO write other register contexts and add them here
switch (arch.GetMachine()) {
case llvm::Triple::x86: {
- reg_interface = new RegisterContextLinux_i386(arch);
+ reg_interface = new RegisterInfoLinux_i386(arch);
lldb::DataBufferSP buf =
ConvertMinidumpContext_x86_32(m_gpregset_data, reg_interface);
DataExtractor gpregset(buf, lldb::eByteOrderLittle, 4);
@@ -79,7 +79,7 @@ ThreadMinidump::CreateRegisterContextForFrame(StackFrame *frame) {
break;
}
case llvm::Triple::x86_64: {
- reg_interface = new RegisterContextLinux_x86_64(arch);
+ reg_interface = new RegisterInfoLinux_x86_64(arch);
lldb::DataBufferSP buf =
ConvertMinidumpContext_x86_64(m_gpregset_data, reg_interface);
DataExtractor gpregset(buf, lldb::eByteOrderLittle, 8);
diff --git a/lldb/unittests/Process/Utility/CMakeLists.txt b/lldb/unittests/Process/Utility/CMakeLists.txt
index e214205a11b970..c7dc4e969bd6f4 100644
--- a/lldb/unittests/Process/Utility/CMakeLists.txt
+++ b/lldb/unittests/Process/Utility/CMakeLists.txt
@@ -1,8 +1,8 @@
set(FREEBSD_SOURCES
- RegisterContextFreeBSDTest.cpp)
+ RegisterInfoFreeBSDTest.cpp)
set(NETBSD_SOURCES
- RegisterContextNetBSDTest_i386.cpp
- RegisterContextNetBSDTest_x86_64.cpp)
+ RegisterInfoNetBSDTest_i386.cpp
+ RegisterInfoNetBSDTest_x86_64.cpp)
if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
list(APPEND PLATFORM_SOURCES ${FREEBSD_SOURCES})
@@ -26,7 +26,7 @@ add_lldb_unittest(ProcessUtilityTests
add_lldb_unittest(RegisterSupportTests
PARTIAL_SOURCES_INTENDED
- RegisterContextTest.cpp
+ RegisterInfo_x86Test.cpp
${PLATFORM_SOURCES}
LINK_LIBS
diff --git a/lldb/unittests/Process/Utility/RegisterContextFreeBSDTest.cpp b/lldb/unittests/Process/Utility/RegisterInfoFreeBSDTest.cpp
similarity index 96%
rename from lldb/unittests/Process/Utility/RegisterContextFreeBSDTest.cpp
rename to lldb/unittests/Process/Utility/RegisterInfoFreeBSDTest.cpp
index a74d27dd8d964c..e14307dad4a480 100644
--- a/lldb/unittests/Process/Utility/RegisterContextFreeBSDTest.cpp
+++ b/lldb/unittests/Process/Utility/RegisterInfoFreeBSDTest.cpp
@@ -1,4 +1,4 @@
-//===-- RegisterContextFreeBSDTests.cpp -----------------------------------===//
+//===-- RegisterInfoFreeBSDTests.cpp --------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -17,9 +17,9 @@
#include "gmock/gmock.h"
#include "gtest/gtest.h"
-#include "Plugins/Process/Utility/RegisterContextFreeBSD_i386.h"
-#include "Plugins/Process/Utility/RegisterContextFreeBSD_powerpc.h"
-#include "Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.h"
+#include "Plugins/Process/Utility/RegisterInfoFreeBSD_i386.h"
+#include "Plugins/Process/Utility/RegisterInfoFreeBSD_powerpc.h"
+#include "Plugins/Process/Utility/RegisterInfoFreeBSD_x86_64.h"
#include "Plugins/Process/Utility/RegisterContextPOSIX_powerpc.h"
#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm.h"
#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h"
@@ -49,9 +49,9 @@ std::pair<size_t, size_t> GetRegParams(RegisterInfoInterface &ctx,
#define EXPECT_DBR_X86_64(num) \
EXPECT_OFF(dr##num##_x86_64, offsetof(dbreg, dr[num]), sizeof(dbreg::dr[num]))
-TEST(RegisterContextFreeBSDTest, x86_64) {
+TEST(RegisterInfoFreeBSDTest, x86_64) {
ArchSpec arch{"x86_64-unknown-freebsd"};
- RegisterContextFreeBSD_x86_64 reg_ctx{arch};
+ RegisterInfoFreeBSD_x86_64 reg_ctx{arch};
EXPECT_GPR_X86_64(r15);
EXPECT_GPR_X86_64(r14);
@@ -156,9 +156,9 @@ TEST(RegisterContextFreeBSDTest, x86_64) {
EXPECT_OFF(dr##num##_i386, offsetof(native_i386_dbregs, dr[num]), \
sizeof(native_i386_dbregs::dr[num]))
-TEST(RegisterContextFreeBSDTest, i386) {
+TEST(RegisterInfoFreeBSDTest, i386) {
ArchSpec arch{"i686-unknown-freebsd"};
- RegisterContextFreeBSD_i386 reg_ctx{arch};
+ RegisterInfoFreeBSD_i386 reg_ctx{arch};
#if defined(__i386__)
using native_i386_regs = ::reg;
@@ -251,7 +251,7 @@ TEST(RegisterContextFreeBSDTest, i386) {
::testing::Pair(offsetof(vfp_state, fbsd_reg) + base_offset, \
sizeof(vfp_state::fbsd_reg)))
-TEST(RegisterContextFreeBSDTest, arm) {
+TEST(RegisterInfoFreeBSDTest, arm) {
ArchSpec arch{"arm-unknown-freebsd"};
RegisterInfoPOSIX_arm reg_ctx{arch};
@@ -322,7 +322,7 @@ TEST(RegisterContextFreeBSDTest, arm) {
::testing::Pair(offsetof(fpreg, fbsd_reg) + base_offset, \
sizeof(fpreg::fbsd_reg)))
-TEST(RegisterContextFreeBSDTest, arm64) {
+TEST(RegisterInfoFreeBSDTest, arm64) {
Flags opt_regsets = RegisterInfoPOSIX_arm64::eRegsetMaskDefault;
ArchSpec arch{"aarch64-unknown-freebsd"};
RegisterInfoPOSIX_arm64 reg_ctx{arch, opt_regsets};
@@ -412,9 +412,9 @@ TEST(RegisterContextFreeBSDTest, arm64) {
::testing::Pair(offsetof(fpreg, fbsd_reg) + base_offset, \
sizeof(fpreg::fbsd_reg)))
-TEST(RegisterContextFreeBSDTest, powerpc32) {
+TEST(RegisterInfoFreeBSDTest, powerpc32) {
ArchSpec arch{"powerpc-unknown-freebsd"};
- RegisterContextFreeBSD_powerpc32 reg_ctx{arch};
+ RegisterInfoFreeBSD_powerpc32 reg_ctx{arch};
EXPECT_GPR_PPC(r0, fixreg[0]);
EXPECT_GPR_PPC(r1, fixreg[1]);
diff --git a/lldb/unittests/Process/Utility/RegisterContextNetBSDTest_i386.cpp b/lldb/unittests/Process/Utility/RegisterInfoNetBSDTest_i386.cpp
similarity index 94%
rename from lldb/unittests/Process/Utility/RegisterContextNetBSDTest_i386.cpp
rename to lldb/unittests/Process/Utility/RegisterInfoNetBSDTest_i386.cpp
index 07e09d34d191c5..e0947c7d05b244 100644
--- a/lldb/unittests/Process/Utility/RegisterContextNetBSDTest_i386.cpp
+++ b/lldb/unittests/Process/Utility/RegisterInfoNetBSDTest_i386.cpp
@@ -1,4 +1,4 @@
-//===-- RegisterContextNetBSDTest_i386.cpp --------------------------------===//
+//===-- RegisterInfoNetBSDTest_i386.cpp -----------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -17,7 +17,7 @@
#include "gtest/gtest.h"
#include "Plugins/Process/Utility/lldb-x86-register-enums.h"
-#include "Plugins/Process/Utility/RegisterContextNetBSD_i386.h"
+#include "Plugins/Process/Utility/RegisterInfoNetBSD_i386.h"
using namespace lldb;
using namespace lldb_private;
@@ -40,9 +40,9 @@ static std::pair<size_t, size_t> GetRegParams(RegisterInfoInterface &ctx,
EXPECT_OFF(dr##num##_i386, offsetof(dbreg, dr[num]), \
sizeof(dbreg::dr[num]))
-TEST(RegisterContextNetBSDTest, i386) {
+TEST(RegisterInfoNetBSDTest, i386) {
ArchSpec arch{"i686-unknown-netbsd"};
- RegisterContextNetBSD_i386 reg_ctx{arch};
+ RegisterInfoNetBSD_i386 reg_ctx{arch};
EXPECT_GPR_I386(eax);
EXPECT_GPR_I386(ecx);
diff --git a/lldb/unittests/Process/Utility/RegisterContextNetBSDTest_x86_64.cpp b/lldb/unittests/Process/Utility/RegisterInfoNetBSDTest_x86_64.cpp
similarity index 94%
rename from lldb/unittests/Process/Utility/RegisterContextNetBSDTest_x86_64.cpp
rename to lldb/unittests/Process/Utility/RegisterInfoNetBSDTest_x86_64.cpp
index ac24c32b0d0e4e..c0bfc01c6bf219 100644
--- a/lldb/unittests/Process/Utility/RegisterContextNetBSDTest_x86_64.cpp
+++ b/lldb/unittests/Process/Utility/RegisterInfoNetBSDTest_x86_64.cpp
@@ -1,4 +1,4 @@
-//===-- RegisterContextNetBSDTest_x86_64.cpp ------------------------------===//
+//===-- RegisterInfoNetBSDTest_x86_64.cpp ---------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -17,8 +17,8 @@
#include "gtest/gtest.h"
#include "Plugins/Process/Utility/lldb-x86-register-enums.h"
-#include "Plugins/Process/Utility/RegisterContextNetBSD_i386.h"
-#include "Plugins/Process/Utility/RegisterContextNetBSD_x86_64.h"
+#include "Plugins/Process/Utility/RegisterInfoNetBSD_i386.h"
+#include "Plugins/Process/Utility/RegisterInfoNetBSD_x86_64.h"
using namespace lldb;
using namespace lldb_private;
@@ -41,9 +41,9 @@ static std::pair<size_t, size_t> GetRegParams(RegisterInfoInterface &ctx,
#define EXPECT_DBR_X86_64(num) \
EXPECT_OFF(dr##num##_x86_64, offsetof(dbreg, dr[num]), sizeof(dbreg::dr[num]))
-TEST(RegisterContextNetBSDTest, x86_64) {
+TEST(RegisterInfoNetBSDTest, x86_64) {
ArchSpec arch{"x86_64-unknown-netbsd"};
- RegisterContextNetBSD_x86_64 reg_ctx{arch};
+ RegisterInfoNetBSD_x86_64 reg_ctx{arch};
EXPECT_GPR_X86_64(rdi, _REG_RDI);
EXPECT_GPR_X86_64(rsi, _REG_RSI);
diff --git a/lldb/unittests/Process/Utility/RegisterContextTest.cpp b/lldb/unittests/Process/Utility/RegisterInfo_x86Test.cpp
similarity index 92%
rename from lldb/unittests/Process/Utility/RegisterContextTest.cpp
rename to lldb/unittests/Process/Utility/RegisterInfo_x86Test.cpp
index f0aa6076d8f2ca..302fbbcbba9dec 100644
--- a/lldb/unittests/Process/Utility/RegisterContextTest.cpp
+++ b/lldb/unittests/Process/Utility/RegisterInfo_x86Test.cpp
@@ -1,4 +1,4 @@
-//===-- RegisterContextTest.cpp -------------------------------------------===//
+//===-- RegisterInfo_x86Test.cpp -------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -53,7 +53,7 @@ const std::array<TagWordTestVector, 8> tag_word_test_vectors{
TagWordTestVector{0x0000, 0x25a8, 0xff, 8},
};
-TEST(RegisterContext_x86Test, AbridgedToFullTagWord) {
+TEST(RegisterInfo_x86Test, AbridgedToFullTagWord) {
for (const auto &x : llvm::enumerate(tag_word_test_vectors)) {
SCOPED_TRACE(llvm::formatv("tag_word_test_vectors[{0}]", x.index()));
std::array<MMSReg, 8> test_regs;
@@ -65,7 +65,7 @@ TEST(RegisterContext_x86Test, AbridgedToFullTagWord) {
}
}
-TEST(RegisterContext_x86Test, FullToAbridgedTagWord) {
+TEST(RegisterInfo_x86Test, FullToAbridgedTagWord) {
for (const auto &x : llvm::enumerate(tag_word_test_vectors)) {
SCOPED_TRACE(llvm::formatv("tag_word_test_vectors[{0}]", x.index()));
EXPECT_EQ(FullToAbridgedTagWord(x.value().tw), x.value().tw_abridged);
diff --git a/lldb/unittests/Process/minidump/RegisterContextMinidumpTest.cpp b/lldb/unittests/Process/minidump/RegisterContextMinidumpTest.cpp
index f179ded7fa6b6e..18fb6ed001ff19 100644
--- a/lldb/unittests/Process/minidump/RegisterContextMinidumpTest.cpp
+++ b/lldb/unittests/Process/minidump/RegisterContextMinidumpTest.cpp
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#include "Plugins/Process/Utility/RegisterContextLinux_i386.h"
-#include "Plugins/Process/Utility/RegisterContextLinux_x86_64.h"
+#include "Plugins/Process/Utility/RegisterInfoLinux_i386.h"
+#include "Plugins/Process/Utility/RegisterInfoLinux_x86_64.h"
#include "Plugins/Process/minidump/RegisterContextMinidump_x86_32.h"
#include "Plugins/Process/minidump/RegisterContextMinidump_x86_64.h"
#include "Plugins/Process/minidump/RegisterContextMinidump_ARM.h"
@@ -53,7 +53,7 @@ TEST(RegisterContextMinidump, ConvertMinidumpContext_x86_32) {
sizeof(Context));
ArchSpec arch("i386-pc-linux");
- auto RegInterface = std::make_unique<RegisterContextLinux_i386>(arch);
+ auto RegInterface = std::make_unique<RegisterInfoLinux_i386>(arch);
lldb::DataBufferSP Buf =
ConvertMinidumpContext_x86_32(ContextRef, RegInterface.get());
ASSERT_EQ(RegInterface->GetGPRSize(), Buf->GetByteSize());
@@ -114,7 +114,7 @@ TEST(RegisterContextMinidump, ConvertMinidumpContext_x86_64) {
sizeof(Context));
ArchSpec arch("x86_64-pc-linux");
- auto RegInterface = std::make_unique<RegisterContextLinux_x86_64>(arch);
+ auto RegInterface = std::make_unique<RegisterInfoLinux_x86_64>(arch);
lldb::DataBufferSP Buf =
ConvertMinidumpContext_x86_64(ContextRef, RegInterface.get());
ASSERT_EQ(RegInterface->GetGPRSize(), Buf->GetByteSize());
diff --git a/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Utility/BUILD.gn b/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Utility/BUILD.gn
index d32d9b286a3f18..ee138642d78f15 100644
--- a/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Utility/BUILD.gn
+++ b/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Utility/BUILD.gn
@@ -10,18 +10,18 @@ static_library("Register") {
# Uses source-relative includes for own headers.
include_dirs = [ "//lldb/source" ]
sources = [
- "RegisterContextFreeBSD_i386.cpp",
- "RegisterContextFreeBSD_powerpc.cpp",
- "RegisterContextFreeBSD_x86_64.cpp",
- "RegisterContextLinux_i386.cpp",
- "RegisterContextLinux_s390x.cpp",
- "RegisterContextLinux_x86_64.cpp",
- "RegisterContextNetBSD_i386.cpp",
- "RegisterContextNetBSD_x86_64.cpp",
- "RegisterContextOpenBSD_i386.cpp",
- "RegisterContextOpenBSD_x86_64.cpp",
- "RegisterContextWindows_i386.cpp",
- "RegisterContextWindows_x86_64.cpp",
+ "RegisterInfoFreeBSD_i386.cpp",
+ "RegisterInfoFreeBSD_powerpc.cpp",
+ "RegisterInfoFreeBSD_x86_64.cpp",
+ "RegisterInfoLinux_i386.cpp",
+ "RegisterInfoLinux_s390x.cpp",
+ "RegisterInfoLinux_x86_64.cpp",
+ "RegisterInfoNetBSD_i386.cpp",
+ "RegisterInfoNetBSD_x86_64.cpp",
+ "RegisterInfoOpenBSD_i386.cpp",
+ "RegisterInfoOpenBSD_x86_64.cpp",
+ "RegisterInfoWindows_i386.cpp",
+ "RegisterInfoWindows_x86_64.cpp",
"RegisterContext_x86.cpp",
"RegisterInfoPOSIXDynamic_riscv32.cpp",
"RegisterInfoPOSIX_arm.cpp",
>From 8f53460310cb45bd925e27baf8646d6dff6960fb Mon Sep 17 00:00:00 2001
From: Minsoo Choo <minsoo at minsoo.io>
Date: Sun, 6 Sep 2026 00:58:17 -0400
Subject: [PATCH 2/6] [lldb] Rename common register metadata providers
---
.../LoongArch/EmulateInstructionLoongArch.cpp | 6 +-
.../RISCV/EmulateInstructionRISCV.cpp | 12 +-
.../AIX/NativeRegisterContextAIX_ppc64.cpp | 4 +-
.../RegisterContextFreeBSDKernelCore_arm.cpp | 2 +-
.../RegisterContextFreeBSDKernelCore_arm.h | 2 +-
...RegisterContextFreeBSDKernelCore_arm64.cpp | 2 +-
.../RegisterContextFreeBSDKernelCore_arm64.h | 2 +-
...gisterContextFreeBSDKernelCore_riscv64.cpp | 2 +-
...RegisterContextFreeBSDKernelCore_riscv64.h | 2 +-
.../ThreadFreeBSDKernelCore.cpp | 16 +-
.../NativeRegisterContextFreeBSD_arm.cpp | 28 ++--
.../NativeRegisterContextFreeBSD_arm.h | 4 +-
.../NativeRegisterContextFreeBSD_arm64.cpp | 28 ++--
.../NativeRegisterContextFreeBSD_arm64.h | 4 +-
.../Linux/NativeRegisterContextLinux_arm.cpp | 14 +-
.../Linux/NativeRegisterContextLinux_arm.h | 8 +-
.../NativeRegisterContextLinux_arm64.cpp | 38 ++---
.../Linux/NativeRegisterContextLinux_arm64.h | 10 +-
...NativeRegisterContextLinux_loongarch64.cpp | 18 +--
.../NativeRegisterContextLinux_loongarch64.h | 14 +-
.../NativeRegisterContextLinux_ppc64le.cpp | 4 +-
.../NativeRegisterContextLinux_riscv64.cpp | 18 +--
.../NativeRegisterContextLinux_riscv64.h | 10 +-
.../Plugins/Process/Utility/CMakeLists.txt | 16 +-
.../Utility/RegisterContextPOSIX_arm.cpp | 6 +-
.../Utility/RegisterContextPOSIX_arm.h | 8 +-
.../Utility/RegisterContextPOSIX_arm64.cpp | 6 +-
.../Utility/RegisterContextPOSIX_arm64.h | 8 +-
.../RegisterContextPOSIX_loongarch64.cpp | 10 +-
.../RegisterContextPOSIX_loongarch64.h | 8 +-
.../Utility/RegisterContextPOSIX_riscv32.cpp | 6 +-
.../Utility/RegisterContextPOSIX_riscv32.h | 8 +-
.../Utility/RegisterContextPOSIX_riscv64.cpp | 4 +-
.../Utility/RegisterContextPOSIX_riscv64.h | 8 +-
... => RegisterInfoCommonDynamic_riscv32.cpp} | 26 ++--
....h => RegisterInfoCommonDynamic_riscv32.h} | 10 +-
...SIX_arm.cpp => RegisterInfoCommon_arm.cpp} | 48 +++---
...foPOSIX_arm.h => RegisterInfoCommon_arm.h} | 12 +-
...arm64.cpp => RegisterInfoCommon_arm64.cpp} | 138 +++++++++---------
...SIX_arm64.h => RegisterInfoCommon_arm64.h} | 10 +-
...cpp => RegisterInfoCommon_loongarch64.cpp} | 52 +++----
...h64.h => RegisterInfoCommon_loongarch64.h} | 10 +-
...ppc64.cpp => RegisterInfoCommon_ppc64.cpp} | 14 +-
...SIX_ppc64.h => RegisterInfoCommon_ppc64.h} | 12 +-
...4le.cpp => RegisterInfoCommon_ppc64le.cpp} | 14 +-
...ppc64le.h => RegisterInfoCommon_ppc64le.h} | 10 +-
...v32.cpp => RegisterInfoCommon_riscv32.cpp} | 34 ++---
...riscv32.h => RegisterInfoCommon_riscv32.h} | 10 +-
...v64.cpp => RegisterInfoCommon_riscv64.cpp} | 32 ++--
...riscv64.h => RegisterInfoCommon_riscv64.h} | 10 +-
.../NativeRegisterContextWindows_arm.cpp | 4 +-
.../NativeRegisterContextWindows_arm64.cpp | 4 +-
.../NativeRegisterContextWindows_arm64.h | 2 +-
.../elf-core/RegisterContextPOSIXCore_arm.cpp | 2 +-
.../elf-core/RegisterContextPOSIXCore_arm.h | 2 +-
.../RegisterContextPOSIXCore_arm64.cpp | 28 ++--
.../elf-core/RegisterContextPOSIXCore_arm64.h | 2 +-
.../RegisterContextPOSIXCore_loongarch64.cpp | 4 +-
.../RegisterContextPOSIXCore_loongarch64.h | 4 +-
.../RegisterContextPOSIXCore_riscv32.cpp | 4 +-
.../RegisterContextPOSIXCore_riscv32.h | 6 +-
.../RegisterContextPOSIXCore_riscv64.cpp | 8 +-
.../RegisterContextPOSIXCore_riscv64.h | 4 +-
.../Process/elf-core/ThreadElfCore.cpp | 10 +-
.../Instruction/ARM64/TestAArch64Emulator.cpp | 4 +-
.../LoongArch/TestLoongArchEmulator.cpp | 6 +-
.../Instruction/RISCV/TestRISCVEmulator.cpp | 8 +-
.../Utility/RegisterInfoFreeBSDTest.cpp | 10 +-
.../source/Plugins/Process/Utility/BUILD.gn | 16 +-
69 files changed, 453 insertions(+), 453 deletions(-)
rename lldb/source/Plugins/Process/Utility/{RegisterInfoPOSIXDynamic_riscv32.cpp => RegisterInfoCommonDynamic_riscv32.cpp} (87%)
rename lldb/source/Plugins/Process/Utility/{RegisterInfoPOSIXDynamic_riscv32.h => RegisterInfoCommonDynamic_riscv32.h} (86%)
rename lldb/source/Plugins/Process/Utility/{RegisterInfoPOSIX_arm.cpp => RegisterInfoCommon_arm.cpp} (79%)
rename lldb/source/Plugins/Process/Utility/{RegisterInfoPOSIX_arm.h => RegisterInfoCommon_arm.h} (80%)
rename lldb/source/Plugins/Process/Utility/{RegisterInfoPOSIX_arm64.cpp => RegisterInfoCommon_arm64.cpp} (83%)
rename lldb/source/Plugins/Process/Utility/{RegisterInfoPOSIX_arm64.h => RegisterInfoCommon_arm64.h} (95%)
rename lldb/source/Plugins/Process/Utility/{RegisterInfoPOSIX_loongarch64.cpp => RegisterInfoCommon_loongarch64.cpp} (82%)
rename lldb/source/Plugins/Process/Utility/{RegisterInfoPOSIX_loongarch64.h => RegisterInfoCommon_loongarch64.h} (83%)
rename lldb/source/Plugins/Process/Utility/{RegisterInfoPOSIX_ppc64.cpp => RegisterInfoCommon_ppc64.cpp} (82%)
rename lldb/source/Plugins/Process/Utility/{RegisterInfoPOSIX_ppc64.h => RegisterInfoCommon_ppc64.h} (60%)
rename lldb/source/Plugins/Process/Utility/{RegisterInfoPOSIX_ppc64le.cpp => RegisterInfoCommon_ppc64le.cpp} (78%)
rename lldb/source/Plugins/Process/Utility/{RegisterInfoPOSIX_ppc64le.h => RegisterInfoCommon_ppc64le.h} (63%)
rename lldb/source/Plugins/Process/Utility/{RegisterInfoPOSIX_riscv32.cpp => RegisterInfoCommon_riscv32.cpp} (80%)
rename lldb/source/Plugins/Process/Utility/{RegisterInfoPOSIX_riscv32.h => RegisterInfoCommon_riscv32.h} (83%)
rename lldb/source/Plugins/Process/Utility/{RegisterInfoPOSIX_riscv64.cpp => RegisterInfoCommon_riscv64.cpp} (82%)
rename lldb/source/Plugins/Process/Utility/{RegisterInfoPOSIX_riscv64.h => RegisterInfoCommon_riscv64.h} (85%)
diff --git a/lldb/source/Plugins/Instruction/LoongArch/EmulateInstructionLoongArch.cpp b/lldb/source/Plugins/Instruction/LoongArch/EmulateInstructionLoongArch.cpp
index db32bf8a4dd51a..5090ddf0b6d1e9 100644
--- a/lldb/source/Plugins/Instruction/LoongArch/EmulateInstructionLoongArch.cpp
+++ b/lldb/source/Plugins/Instruction/LoongArch/EmulateInstructionLoongArch.cpp
@@ -11,7 +11,7 @@
#include "EmulateInstructionLoongArch.h"
#include "Plugins/Process/Utility/InstructionUtils.h"
-#include "Plugins/Process/Utility/RegisterInfoPOSIX_loongarch64.h"
+#include "Plugins/Process/Utility/RegisterInfoCommon_loongarch64.h"
#include "Plugins/Process/Utility/lldb-loongarch-register-enums.h"
#include "lldb/Core/Address.h"
#include "lldb/Core/PluginManager.h"
@@ -162,9 +162,9 @@ EmulateInstructionLoongArch::GetRegisterInfo(lldb::RegisterKind reg_kind,
}
const RegisterInfo *array =
- RegisterInfoPOSIX_loongarch64::GetRegisterInfoPtr(m_arch);
+ RegisterInfoCommon_loongarch64::GetRegisterInfoPtr(m_arch);
const uint32_t length =
- RegisterInfoPOSIX_loongarch64::GetRegisterInfoCount(m_arch);
+ RegisterInfoCommon_loongarch64::GetRegisterInfoCount(m_arch);
if (reg_index >= length || reg_kind != eRegisterKindLLDB)
return {};
diff --git a/lldb/source/Plugins/Instruction/RISCV/EmulateInstructionRISCV.cpp b/lldb/source/Plugins/Instruction/RISCV/EmulateInstructionRISCV.cpp
index 1abedc050af639..ba6990ba235a7f 100644
--- a/lldb/source/Plugins/Instruction/RISCV/EmulateInstructionRISCV.cpp
+++ b/lldb/source/Plugins/Instruction/RISCV/EmulateInstructionRISCV.cpp
@@ -8,8 +8,8 @@
#include "EmulateInstructionRISCV.h"
#include "Plugins/Process/Utility/RegisterInfoInterface.h"
-#include "Plugins/Process/Utility/RegisterInfoPOSIX_riscv32.h"
-#include "Plugins/Process/Utility/RegisterInfoPOSIX_riscv64.h"
+#include "Plugins/Process/Utility/RegisterInfoCommon_riscv32.h"
+#include "Plugins/Process/Utility/RegisterInfoCommon_riscv64.h"
#include "Plugins/Process/Utility/lldb-riscv-register-enums.h"
#include "RISCVCInstructions.h"
#include "RISCVInstructions.h"
@@ -1843,12 +1843,12 @@ EmulateInstructionRISCV::GetRegisterInfo(RegisterKind reg_kind,
std::unique_ptr<RegisterInfoInterface> reg_info;
switch (m_arch.GetTriple().getArch()) {
case llvm::Triple::riscv32:
- reg_info = std::make_unique<RegisterInfoPOSIX_riscv32>(
- m_arch, RegisterInfoPOSIX_riscv32::eRegsetMaskAll);
+ reg_info = std::make_unique<RegisterInfoCommon_riscv32>(
+ m_arch, RegisterInfoCommon_riscv32::eRegsetMaskAll);
break;
case llvm::Triple::riscv64:
- reg_info = std::make_unique<RegisterInfoPOSIX_riscv64>(
- m_arch, RegisterInfoPOSIX_riscv64::eRegsetMaskAll);
+ reg_info = std::make_unique<RegisterInfoCommon_riscv64>(
+ m_arch, RegisterInfoCommon_riscv64::eRegsetMaskAll);
break;
default:
assert(false && "unsupported triple");
diff --git a/lldb/source/Plugins/Process/AIX/NativeRegisterContextAIX_ppc64.cpp b/lldb/source/Plugins/Process/AIX/NativeRegisterContextAIX_ppc64.cpp
index 847a1b486a9980..0726e3ac779789 100644
--- a/lldb/source/Plugins/Process/AIX/NativeRegisterContextAIX_ppc64.cpp
+++ b/lldb/source/Plugins/Process/AIX/NativeRegisterContextAIX_ppc64.cpp
@@ -10,7 +10,7 @@
#include "NativeRegisterContextAIX_ppc64.h"
#include "NativeThreadAIX.h"
-#include "Plugins/Process/Utility/RegisterInfoPOSIX_ppc64.h"
+#include "Plugins/Process/Utility/RegisterInfoCommon_ppc64.h"
#include "lldb/Utility/RegisterValue.h"
using namespace lldb;
@@ -106,7 +106,7 @@ NativeRegisterContextAIX::CreateHostNativeRegisterContextAIX(
NativeRegisterContextAIX_ppc64::NativeRegisterContextAIX_ppc64(
const ArchSpec &target_arch, NativeThreadProtocol &native_thread)
: NativeRegisterContextRegisterInfo(
- native_thread, new RegisterInfoPOSIX_ppc64(target_arch)),
+ native_thread, new RegisterInfoCommon_ppc64(target_arch)),
NativeRegisterContextAIX(native_thread) {
switch (target_arch.GetMachine()) {
case llvm::Triple::ppc:
diff --git a/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_arm.cpp b/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_arm.cpp
index 1477cf75e9f6ff..621a7a314ab46c 100644
--- a/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_arm.cpp
+++ b/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_arm.cpp
@@ -22,7 +22,7 @@ using namespace lldb;
using namespace lldb_private;
RegisterContextFreeBSDKernelCore_arm::RegisterContextFreeBSDKernelCore_arm(
- Thread &thread, std::unique_ptr<RegisterInfoPOSIX_arm> register_info_up,
+ Thread &thread, std::unique_ptr<RegisterInfoCommon_arm> register_info_up,
lldb::addr_t pcb_addr)
: RegisterContextPOSIX_arm(thread, std::move(register_info_up)),
m_pcb_addr(pcb_addr) {}
diff --git a/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_arm.h b/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_arm.h
index cdd9f1b3288c18..8af593e9cbe5de 100644
--- a/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_arm.h
+++ b/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_arm.h
@@ -16,7 +16,7 @@ class RegisterContextFreeBSDKernelCore_arm : public RegisterContextPOSIX_arm {
public:
RegisterContextFreeBSDKernelCore_arm(
lldb_private::Thread &thread,
- std::unique_ptr<RegisterInfoPOSIX_arm> register_info_up,
+ std::unique_ptr<RegisterInfoCommon_arm> register_info_up,
lldb::addr_t pcb_addr);
bool ReadRegister(const lldb_private::RegisterInfo *reg_info,
diff --git a/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_arm64.cpp b/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_arm64.cpp
index 80a5e0cf13a7c4..3af209e406ae9a 100644
--- a/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_arm64.cpp
+++ b/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_arm64.cpp
@@ -27,7 +27,7 @@ using namespace lldb;
using namespace lldb_private;
RegisterContextFreeBSDKernelCore_arm64::RegisterContextFreeBSDKernelCore_arm64(
- Thread &thread, std::unique_ptr<RegisterInfoPOSIX_arm64> register_info_up,
+ Thread &thread, std::unique_ptr<RegisterInfoCommon_arm64> register_info_up,
lldb::addr_t pcb_addr)
: RegisterContextPOSIX_arm64(thread, std::move(register_info_up)),
m_pcb_addr(pcb_addr) {}
diff --git a/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_arm64.h b/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_arm64.h
index 873b77782c2489..3ad5ae7b88bae6 100644
--- a/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_arm64.h
+++ b/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_arm64.h
@@ -19,7 +19,7 @@ class RegisterContextFreeBSDKernelCore_arm64
public:
RegisterContextFreeBSDKernelCore_arm64(
lldb_private::Thread &thread,
- std::unique_ptr<RegisterInfoPOSIX_arm64> register_info_up,
+ std::unique_ptr<RegisterInfoCommon_arm64> register_info_up,
lldb::addr_t pcb_addr);
bool ReadRegister(const lldb_private::RegisterInfo *reg_info,
diff --git a/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_riscv64.cpp b/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_riscv64.cpp
index 52a2f91742c760..0d87a0d9c8ca84 100644
--- a/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_riscv64.cpp
+++ b/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_riscv64.cpp
@@ -23,7 +23,7 @@ using namespace lldb_private;
RegisterContextFreeBSDKernelCore_riscv64::
RegisterContextFreeBSDKernelCore_riscv64(
Thread &thread,
- std::unique_ptr<RegisterInfoPOSIX_riscv64> register_info_up,
+ std::unique_ptr<RegisterInfoCommon_riscv64> register_info_up,
lldb::addr_t pcb_addr)
: RegisterContextPOSIX_riscv64(thread, std::move(register_info_up)),
m_pcb_addr(pcb_addr) {}
diff --git a/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_riscv64.h b/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_riscv64.h
index 033671da8ff7da..cb96c5c989f2c1 100644
--- a/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_riscv64.h
+++ b/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_riscv64.h
@@ -17,7 +17,7 @@ class RegisterContextFreeBSDKernelCore_riscv64
public:
RegisterContextFreeBSDKernelCore_riscv64(
lldb_private::Thread &thread,
- std::unique_ptr<RegisterInfoPOSIX_riscv64> register_info_up,
+ std::unique_ptr<RegisterInfoCommon_riscv64> register_info_up,
lldb::addr_t pcb_addr);
bool ReadRegister(const lldb_private::RegisterInfo *reg_info,
diff --git a/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/ThreadFreeBSDKernelCore.cpp b/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/ThreadFreeBSDKernelCore.cpp
index 98b73e8de87ef8..4f0e7021d692db 100644
--- a/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/ThreadFreeBSDKernelCore.cpp
+++ b/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/ThreadFreeBSDKernelCore.cpp
@@ -14,10 +14,10 @@
#include "Plugins/Process/Utility/RegisterInfoFreeBSD_i386.h"
#include "Plugins/Process/Utility/RegisterInfoFreeBSD_x86_64.h"
-#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm.h"
-#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h"
-#include "Plugins/Process/Utility/RegisterInfoPOSIX_ppc64le.h"
-#include "Plugins/Process/Utility/RegisterInfoPOSIX_riscv64.h"
+#include "Plugins/Process/Utility/RegisterInfoCommon_arm.h"
+#include "Plugins/Process/Utility/RegisterInfoCommon_arm64.h"
+#include "Plugins/Process/Utility/RegisterInfoCommon_ppc64le.h"
+#include "Plugins/Process/Utility/RegisterInfoCommon_riscv64.h"
#include "ProcessFreeBSDKernelCore.h"
#include "RegisterContextFreeBSDKernelCore_arm.h"
#include "RegisterContextFreeBSDKernelCore_arm64.h"
@@ -66,23 +66,23 @@ ThreadFreeBSDKernelCore::CreateRegisterContextForFrame(StackFrame *frame) {
case llvm::Triple::aarch64:
m_thread_reg_ctx_sp =
std::make_shared<RegisterContextFreeBSDKernelCore_arm64>(
- *this, std::make_unique<RegisterInfoPOSIX_arm64>(arch, 0),
+ *this, std::make_unique<RegisterInfoCommon_arm64>(arch, 0),
m_pcb_addr);
break;
case llvm::Triple::arm:
m_thread_reg_ctx_sp =
std::make_shared<RegisterContextFreeBSDKernelCore_arm>(
- *this, std::make_unique<RegisterInfoPOSIX_arm>(arch), m_pcb_addr);
+ *this, std::make_unique<RegisterInfoCommon_arm>(arch), m_pcb_addr);
break;
case llvm::Triple::ppc64le:
m_thread_reg_ctx_sp =
std::make_shared<RegisterContextFreeBSDKernelCore_ppc64le>(
- *this, new RegisterInfoPOSIX_ppc64le(arch), m_pcb_addr);
+ *this, new RegisterInfoCommon_ppc64le(arch), m_pcb_addr);
break;
case llvm::Triple::riscv64:
m_thread_reg_ctx_sp =
std::make_shared<RegisterContextFreeBSDKernelCore_riscv64>(
- *this, std::make_unique<RegisterInfoPOSIX_riscv64>(arch, 0),
+ *this, std::make_unique<RegisterInfoCommon_riscv64>(arch, 0),
m_pcb_addr);
break;
case llvm::Triple::x86:
diff --git a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm.cpp b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm.cpp
index cfee6e8e42c83e..fe4a6d3f104de0 100644
--- a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm.cpp
+++ b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm.cpp
@@ -15,7 +15,7 @@
#include "lldb/Utility/Status.h"
#include "Plugins/Process/FreeBSD/NativeProcessFreeBSD.h"
-#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm.h"
+#include "Plugins/Process/Utility/RegisterInfoCommon_arm.h"
// clang-format off
#include <sys/param.h>
@@ -36,11 +36,11 @@ NativeRegisterContextFreeBSD::CreateHostNativeRegisterContextFreeBSD(
NativeRegisterContextFreeBSD_arm::NativeRegisterContextFreeBSD_arm(
const ArchSpec &target_arch, NativeThreadFreeBSD &native_thread)
: NativeRegisterContextRegisterInfo(
- native_thread, new RegisterInfoPOSIX_arm(target_arch)) {}
+ native_thread, new RegisterInfoCommon_arm(target_arch)) {}
-RegisterInfoPOSIX_arm &
+RegisterInfoCommon_arm &
NativeRegisterContextFreeBSD_arm::GetRegisterInfo() const {
- return static_cast<RegisterInfoPOSIX_arm &>(*m_register_info_interface_up);
+ return static_cast<RegisterInfoCommon_arm &>(*m_register_info_interface_up);
}
uint32_t NativeRegisterContextFreeBSD_arm::GetRegisterSetCount() const {
@@ -61,26 +61,26 @@ uint32_t NativeRegisterContextFreeBSD_arm::GetUserRegisterCount() const {
Status NativeRegisterContextFreeBSD_arm::ReadRegisterSet(uint32_t set) {
switch (set) {
- case RegisterInfoPOSIX_arm::GPRegSet:
+ case RegisterInfoCommon_arm::GPRegSet:
return NativeProcessFreeBSD::PtraceWrapper(PT_GETREGS, m_thread.GetID(),
m_reg_data.data());
- case RegisterInfoPOSIX_arm::FPRegSet:
+ case RegisterInfoCommon_arm::FPRegSet:
return NativeProcessFreeBSD::PtraceWrapper(
PT_GETVFPREGS, m_thread.GetID(),
- m_reg_data.data() + sizeof(RegisterInfoPOSIX_arm::GPR));
+ m_reg_data.data() + sizeof(RegisterInfoCommon_arm::GPR));
}
llvm_unreachable("NativeRegisterContextFreeBSD_arm::ReadRegisterSet");
}
Status NativeRegisterContextFreeBSD_arm::WriteRegisterSet(uint32_t set) {
switch (set) {
- case RegisterInfoPOSIX_arm::GPRegSet:
+ case RegisterInfoCommon_arm::GPRegSet:
return NativeProcessFreeBSD::PtraceWrapper(PT_SETREGS, m_thread.GetID(),
m_reg_data.data());
- case RegisterInfoPOSIX_arm::FPRegSet:
+ case RegisterInfoCommon_arm::FPRegSet:
return NativeProcessFreeBSD::PtraceWrapper(
PT_SETVFPREGS, m_thread.GetID(),
- m_reg_data.data() + sizeof(RegisterInfoPOSIX_arm::GPR));
+ m_reg_data.data() + sizeof(RegisterInfoCommon_arm::GPR));
}
llvm_unreachable("NativeRegisterContextFreeBSD_arm::WriteRegisterSet");
}
@@ -143,11 +143,11 @@ Status NativeRegisterContextFreeBSD_arm::ReadAllRegisterValues(
lldb::WritableDataBufferSP &data_sp) {
Status error;
- error = ReadRegisterSet(RegisterInfoPOSIX_arm::GPRegSet);
+ error = ReadRegisterSet(RegisterInfoCommon_arm::GPRegSet);
if (error.Fail())
return error;
- error = ReadRegisterSet(RegisterInfoPOSIX_arm::FPRegSet);
+ error = ReadRegisterSet(RegisterInfoCommon_arm::FPRegSet);
if (error.Fail())
return error;
@@ -188,11 +188,11 @@ Status NativeRegisterContextFreeBSD_arm::WriteAllRegisterValues(
}
::memcpy(m_reg_data.data(), src, m_reg_data.size());
- error = WriteRegisterSet(RegisterInfoPOSIX_arm::GPRegSet);
+ error = WriteRegisterSet(RegisterInfoCommon_arm::GPRegSet);
if (error.Fail())
return error;
- return WriteRegisterSet(RegisterInfoPOSIX_arm::FPRegSet);
+ return WriteRegisterSet(RegisterInfoCommon_arm::FPRegSet);
}
llvm::Error NativeRegisterContextFreeBSD_arm::CopyHardwareWatchpointsFrom(
diff --git a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm.h b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm.h
index b9537e6952f6c4..eecc6b89502efc 100644
--- a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm.h
+++ b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm.h
@@ -18,7 +18,7 @@
// clang-format on
#include "Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD.h"
-#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm.h"
+#include "Plugins/Process/Utility/RegisterInfoCommon_arm.h"
#include <array>
@@ -57,7 +57,7 @@ class NativeRegisterContextFreeBSD_arm : public NativeRegisterContextFreeBSD {
Status ReadRegisterSet(uint32_t set);
Status WriteRegisterSet(uint32_t set);
- RegisterInfoPOSIX_arm &GetRegisterInfo() const;
+ RegisterInfoCommon_arm &GetRegisterInfo() const;
};
} // namespace process_freebsd
diff --git a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm64.cpp b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm64.cpp
index 1f2e0d5904148a..f30dd262ebf1ff 100644
--- a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm64.cpp
+++ b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm64.cpp
@@ -16,7 +16,7 @@
#include "Plugins/Process/FreeBSD/NativeProcessFreeBSD.h"
#include "Plugins/Process/POSIX/ProcessPOSIXLog.h"
-#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h"
+#include "Plugins/Process/Utility/RegisterInfoCommon_arm64.h"
#include "Plugins/Process/Utility/RegisterTypeDetector_arm64.h"
// clang-format off
@@ -54,16 +54,16 @@ NativeRegisterContextFreeBSD::CreateHostNativeRegisterContextFreeBSD(
NativeRegisterContextFreeBSD_arm64::NativeRegisterContextFreeBSD_arm64(
const ArchSpec &target_arch, NativeThreadFreeBSD &native_thread)
: NativeRegisterContextRegisterInfo(
- native_thread, new RegisterInfoPOSIX_arm64(target_arch, 0)),
+ native_thread, new RegisterInfoCommon_arm64(target_arch, 0)),
m_read_dbreg(false) {
g_register_type_detector.UpdateRegisterInfo(
GetRegisterInfoInterface().GetRegisterInfo(),
GetRegisterInfoInterface().GetRegisterCount());
}
-RegisterInfoPOSIX_arm64 &
+RegisterInfoCommon_arm64 &
NativeRegisterContextFreeBSD_arm64::GetRegisterInfo() const {
- return static_cast<RegisterInfoPOSIX_arm64 &>(*m_register_info_interface_up);
+ return static_cast<RegisterInfoCommon_arm64 &>(*m_register_info_interface_up);
}
uint32_t NativeRegisterContextFreeBSD_arm64::GetRegisterSetCount() const {
@@ -84,26 +84,26 @@ uint32_t NativeRegisterContextFreeBSD_arm64::GetUserRegisterCount() const {
Status NativeRegisterContextFreeBSD_arm64::ReadRegisterSet(uint32_t set) {
switch (set) {
- case RegisterInfoPOSIX_arm64::GPRegSet:
+ case RegisterInfoCommon_arm64::GPRegSet:
return NativeProcessFreeBSD::PtraceWrapper(PT_GETREGS, m_thread.GetID(),
m_reg_data.data());
- case RegisterInfoPOSIX_arm64::FPRegSet:
+ case RegisterInfoCommon_arm64::FPRegSet:
return NativeProcessFreeBSD::PtraceWrapper(
PT_GETFPREGS, m_thread.GetID(),
- m_reg_data.data() + sizeof(RegisterInfoPOSIX_arm64::GPR));
+ m_reg_data.data() + sizeof(RegisterInfoCommon_arm64::GPR));
}
llvm_unreachable("NativeRegisterContextFreeBSD_arm64::ReadRegisterSet");
}
Status NativeRegisterContextFreeBSD_arm64::WriteRegisterSet(uint32_t set) {
switch (set) {
- case RegisterInfoPOSIX_arm64::GPRegSet:
+ case RegisterInfoCommon_arm64::GPRegSet:
return NativeProcessFreeBSD::PtraceWrapper(PT_SETREGS, m_thread.GetID(),
m_reg_data.data());
- case RegisterInfoPOSIX_arm64::FPRegSet:
+ case RegisterInfoCommon_arm64::FPRegSet:
return NativeProcessFreeBSD::PtraceWrapper(
PT_SETFPREGS, m_thread.GetID(),
- m_reg_data.data() + sizeof(RegisterInfoPOSIX_arm64::GPR));
+ m_reg_data.data() + sizeof(RegisterInfoCommon_arm64::GPR));
}
llvm_unreachable("NativeRegisterContextFreeBSD_arm64::WriteRegisterSet");
}
@@ -164,11 +164,11 @@ Status NativeRegisterContextFreeBSD_arm64::ReadAllRegisterValues(
lldb::WritableDataBufferSP &data_sp) {
Status error;
- error = ReadRegisterSet(RegisterInfoPOSIX_arm64::GPRegSet);
+ error = ReadRegisterSet(RegisterInfoCommon_arm64::GPRegSet);
if (error.Fail())
return error;
- error = ReadRegisterSet(RegisterInfoPOSIX_arm64::FPRegSet);
+ error = ReadRegisterSet(RegisterInfoCommon_arm64::FPRegSet);
if (error.Fail())
return error;
@@ -209,11 +209,11 @@ Status NativeRegisterContextFreeBSD_arm64::WriteAllRegisterValues(
}
::memcpy(m_reg_data.data(), src, m_reg_data.size());
- error = WriteRegisterSet(RegisterInfoPOSIX_arm64::GPRegSet);
+ error = WriteRegisterSet(RegisterInfoCommon_arm64::GPRegSet);
if (error.Fail())
return error;
- return WriteRegisterSet(RegisterInfoPOSIX_arm64::FPRegSet);
+ return WriteRegisterSet(RegisterInfoCommon_arm64::FPRegSet);
}
llvm::Error NativeRegisterContextFreeBSD_arm64::CopyHardwareWatchpointsFrom(
diff --git a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm64.h b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm64.h
index 20cbd643e95cfc..613cfb761e52f7 100644
--- a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm64.h
+++ b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm64.h
@@ -19,7 +19,7 @@
#include "Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD.h"
#include "Plugins/Process/Utility/NativeRegisterContextDBReg_arm64.h"
-#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h"
+#include "Plugins/Process/Utility/RegisterInfoCommon_arm64.h"
#include <array>
@@ -69,7 +69,7 @@ class NativeRegisterContextFreeBSD_arm64
llvm::Error ReadHardwareDebugInfo() override;
llvm::Error WriteHardwareDebugRegs(DREGType hwbType) override;
- RegisterInfoPOSIX_arm64 &GetRegisterInfo() const;
+ RegisterInfoCommon_arm64 &GetRegisterInfo() const;
};
} // namespace process_freebsd
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
index a44eb032b8dc19..515b9ed9f1dcdc 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
@@ -13,7 +13,7 @@
#include "Plugins/Process/Linux/NativeProcessLinux.h"
#include "Plugins/Process/Linux/Procfs.h"
#include "Plugins/Process/POSIX/ProcessPOSIXLog.h"
-#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm.h"
+#include "Plugins/Process/Utility/RegisterInfoCommon_arm.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Utility/DataBufferHeap.h"
#include "lldb/Utility/Log.h"
@@ -75,7 +75,7 @@ NativeRegisterContextLinux_arm::NativeRegisterContextLinux_arm(
const ArchSpec &target_arch, NativeThreadProtocol &native_thread)
: NativeRegisterContextRegisterInfo(
native_thread,
- new RegisterInfoPOSIX_arm(target_arch, /*has_tls_reg=*/true)),
+ new RegisterInfoCommon_arm(target_arch, /*has_tls_reg=*/true)),
NativeRegisterContextLinux(native_thread) {
assert(target_arch.GetMachine() == llvm::Triple::arm);
@@ -89,8 +89,8 @@ NativeRegisterContextLinux_arm::NativeRegisterContextLinux_arm(
m_refresh_hwdebug_info = true;
}
-RegisterInfoPOSIX_arm &NativeRegisterContextLinux_arm::GetRegisterInfo() const {
- return static_cast<RegisterInfoPOSIX_arm &>(*m_register_info_interface_up);
+RegisterInfoCommon_arm &NativeRegisterContextLinux_arm::GetRegisterInfo() const {
+ return static_cast<RegisterInfoCommon_arm &>(*m_register_info_interface_up);
}
uint32_t NativeRegisterContextLinux_arm::GetRegisterSetCount() const {
@@ -293,21 +293,21 @@ Status NativeRegisterContextLinux_arm::WriteAllRegisterValues(
bool NativeRegisterContextLinux_arm::IsGPR(unsigned reg) const {
if (GetRegisterInfo().GetRegisterSetFromRegisterIndex(reg) ==
- RegisterInfoPOSIX_arm::GPRegSet)
+ RegisterInfoCommon_arm::GPRegSet)
return true;
return false;
}
bool NativeRegisterContextLinux_arm::IsFPR(unsigned reg) const {
if (GetRegisterInfo().GetRegisterSetFromRegisterIndex(reg) ==
- RegisterInfoPOSIX_arm::FPRegSet)
+ RegisterInfoCommon_arm::FPRegSet)
return true;
return false;
}
bool NativeRegisterContextLinux_arm::IsTLS(unsigned reg) const {
return GetRegisterInfo().GetRegisterSetFromRegisterIndex(reg) ==
- RegisterInfoPOSIX_arm::TLSRegSet;
+ RegisterInfoCommon_arm::TLSRegSet;
}
llvm::Error NativeRegisterContextLinux_arm::ReadHardwareDebugInfo() {
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h
index 3722f667b62c57..1fea0aa4baf38f 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h
@@ -13,7 +13,7 @@
#include "Plugins/Process/Linux/NativeRegisterContextLinux.h"
#include "Plugins/Process/Utility/NativeRegisterContextDBReg_arm.h"
-#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm.h"
+#include "Plugins/Process/Utility/RegisterInfoCommon_arm.h"
#include "Plugins/Process/Utility/lldb-arm-register-enums.h"
namespace lldb_private {
@@ -72,8 +72,8 @@ class NativeRegisterContextLinux_arm : public NativeRegisterContextLinux,
private:
uint32_t m_gpr_arm[k_num_gpr_registers_arm];
- RegisterInfoPOSIX_arm::FPU m_fpr;
- RegisterInfoPOSIX_arm::TLS m_tls;
+ RegisterInfoCommon_arm::FPU m_fpr;
+ RegisterInfoCommon_arm::TLS m_tls;
bool m_refresh_hwdebug_info;
@@ -92,7 +92,7 @@ class NativeRegisterContextLinux_arm : public NativeRegisterContextLinux,
uint32_t CalculateFprOffset(const RegisterInfo *reg_info) const;
- RegisterInfoPOSIX_arm &GetRegisterInfo() const;
+ RegisterInfoCommon_arm &GetRegisterInfo() const;
};
} // namespace process_linux
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
index 1889cab95ab667..6a7a5d615a3a86 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
@@ -16,7 +16,7 @@
#include "Plugins/Process/Linux/Procfs.h"
#include "Plugins/Process/POSIX/ProcessPOSIXLog.h"
#include "Plugins/Process/Utility/MemoryTagManagerAArch64MTE.h"
-#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h"
+#include "Plugins/Process/Utility/RegisterInfoCommon_arm64.h"
#include "Plugins/Process/Utility/RegisterTypeDetector_arm64.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Host/common/NativeProcessProtocol.h"
@@ -141,7 +141,7 @@ size_t NativeRegisterContextLinux_arm64::GetSetSize(
switch (set) {
case RegisterSetType::GPR:
// Returns sizeof arm64 GPR ptrace buffer, which is different
- // from GetGPRSize which returns sizeof RegisterInfoPOSIX_arm64::GPR.
+ // from GetGPRSize which returns sizeof RegisterInfoCommon_arm64::GPR.
return sizeof(m_gpr_arm64);
case RegisterSetType::FPR:
return sizeof(m_fpr);
@@ -234,7 +234,7 @@ NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux(
native_thread.GetID(), ®set,
&ioVec, sizeof(sve_header))
.Success())
- opt_regsets.Set(RegisterInfoPOSIX_arm64::eRegsetMaskSVE);
+ opt_regsets.Set(RegisterInfoCommon_arm64::eRegsetMaskSVE);
// We may have the Scalable Matrix Extension (SME) which adds a
// streaming SVE mode. Systems can have SVE and/or SME.
@@ -244,7 +244,7 @@ NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux(
native_thread.GetID(), ®set,
&ioVec, sizeof(sve_header))
.Success())
- opt_regsets.Set(RegisterInfoPOSIX_arm64::eRegsetMaskSSVE);
+ opt_regsets.Set(RegisterInfoCommon_arm64::eRegsetMaskSSVE);
sve::user_za_header za_header;
ioVec.iov_base = &za_header;
@@ -254,7 +254,7 @@ NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux(
native_thread.GetID(), ®set,
&ioVec, sizeof(za_header))
.Success())
- opt_regsets.Set(RegisterInfoPOSIX_arm64::eRegsetMaskZA);
+ opt_regsets.Set(RegisterInfoCommon_arm64::eRegsetMaskZA);
// SME's ZT0 is a 512 bit register.
std::array<uint8_t, 64> zt_reg;
@@ -265,29 +265,29 @@ NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux(
native_thread.GetID(), ®set,
&ioVec, zt_reg.size())
.Success())
- opt_regsets.Set(RegisterInfoPOSIX_arm64::eRegsetMaskZT);
+ opt_regsets.Set(RegisterInfoCommon_arm64::eRegsetMaskZT);
NativeProcessLinux &process = native_thread.GetProcess();
std::optional<uint64_t> auxv_at_hwcap =
process.GetAuxValue(AuxVector::AUXV_AT_HWCAP);
if (auxv_at_hwcap && (*auxv_at_hwcap & HWCAP_PACA))
- opt_regsets.Set(RegisterInfoPOSIX_arm64::eRegsetMaskPAuth);
+ opt_regsets.Set(RegisterInfoCommon_arm64::eRegsetMaskPAuth);
std::optional<uint64_t> auxv_at_hwcap2 =
process.GetAuxValue(AuxVector::AUXV_AT_HWCAP2);
if (auxv_at_hwcap2) {
if (*auxv_at_hwcap2 & HWCAP2_MTE)
- opt_regsets.Set(RegisterInfoPOSIX_arm64::eRegsetMaskMTE);
+ opt_regsets.Set(RegisterInfoCommon_arm64::eRegsetMaskMTE);
if (*auxv_at_hwcap2 & HWCAP2_FPMR)
- opt_regsets.Set(RegisterInfoPOSIX_arm64::eRegsetMaskFPMR);
+ opt_regsets.Set(RegisterInfoCommon_arm64::eRegsetMaskFPMR);
if (*auxv_at_hwcap & HWCAP_GCS)
- opt_regsets.Set(RegisterInfoPOSIX_arm64::eRegsetMaskGCS);
+ opt_regsets.Set(RegisterInfoCommon_arm64::eRegsetMaskGCS);
if (*auxv_at_hwcap2 & HWCAP2_POE)
- opt_regsets.Set(RegisterInfoPOSIX_arm64::eRegsetMaskPOE);
+ opt_regsets.Set(RegisterInfoCommon_arm64::eRegsetMaskPOE);
}
- opt_regsets.Set(RegisterInfoPOSIX_arm64::eRegsetMaskTLS);
+ opt_regsets.Set(RegisterInfoCommon_arm64::eRegsetMaskTLS);
std::optional<uint64_t> auxv_at_hwcap3 =
process.GetAuxValue(AuxVector::AUXV_AT_HWCAP3);
@@ -298,7 +298,7 @@ NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux(
auxv_at_hwcap3.value_or(0));
auto register_info_up =
- std::make_unique<RegisterInfoPOSIX_arm64>(target_arch, opt_regsets);
+ std::make_unique<RegisterInfoCommon_arm64>(target_arch, opt_regsets);
return std::make_unique<NativeRegisterContextLinux_arm64>(
target_arch, native_thread, std::move(register_info_up));
}
@@ -310,12 +310,12 @@ NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux(
llvm::Expected<ArchSpec>
NativeRegisterContextLinux::DetermineArchitecture(lldb::tid_t tid) {
return DetermineArchitectureViaGPR(
- tid, RegisterInfoPOSIX_arm64::GetGPRSizeStatic());
+ tid, RegisterInfoCommon_arm64::GetGPRSizeStatic());
}
NativeRegisterContextLinux_arm64::NativeRegisterContextLinux_arm64(
const ArchSpec &target_arch, NativeThreadProtocol &native_thread,
- std::unique_ptr<RegisterInfoPOSIX_arm64> register_info_up)
+ std::unique_ptr<RegisterInfoCommon_arm64> register_info_up)
: NativeRegisterContextRegisterInfo(native_thread,
register_info_up.release()),
NativeRegisterContextLinux(native_thread) {
@@ -337,9 +337,9 @@ NativeRegisterContextLinux_arm64::NativeRegisterContextLinux_arm64(
m_sve_state = SVEState::Disabled;
}
-RegisterInfoPOSIX_arm64 &
+RegisterInfoCommon_arm64 &
NativeRegisterContextLinux_arm64::GetRegisterInfo() const {
- return static_cast<RegisterInfoPOSIX_arm64 &>(*m_register_info_interface_up);
+ return static_cast<RegisterInfoCommon_arm64 &>(*m_register_info_interface_up);
}
uint32_t NativeRegisterContextLinux_arm64::GetRegisterSetCount() const {
@@ -1946,7 +1946,7 @@ void NativeRegisterContextLinux_arm64::ConfigureRegisterContext() {
// On every stop we configure SVE vector length by calling
// ConfigureVectorLengthSVE regardless of current SVEState of this thread.
- uint32_t vq = RegisterInfoPOSIX_arm64::eVectorQuadwordAArch64SVE;
+ uint32_t vq = RegisterInfoCommon_arm64::eVectorQuadwordAArch64SVE;
if (sve::vl_valid(m_sve_header.vl))
vq = sve::vq_from_vl(m_sve_header.vl);
@@ -1958,7 +1958,7 @@ void NativeRegisterContextLinux_arm64::ConfigureRegisterContext() {
if (!IsValid(RegisterSetType::ZA_HEADER)) {
Status error = ReadZAHeader();
if (error.Success()) {
- uint32_t vq = RegisterInfoPOSIX_arm64::eVectorQuadwordAArch64SVE;
+ uint32_t vq = RegisterInfoCommon_arm64::eVectorQuadwordAArch64SVE;
if (sve::vl_valid(m_za_header.vl))
vq = sve::vq_from_vl(m_za_header.vl);
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h
index 86a317c11505a1..8dfc1f54c5dbdf 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h
@@ -14,7 +14,7 @@
#include "Plugins/Process/Linux/NativeRegisterContextLinux.h"
#include "Plugins/Process/Utility/LinuxPTraceDefines_arm64sve.h"
#include "Plugins/Process/Utility/NativeRegisterContextDBReg_arm64.h"
-#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h"
+#include "Plugins/Process/Utility/RegisterInfoCommon_arm64.h"
#include "llvm/ADT/BitmaskEnum.h"
@@ -31,7 +31,7 @@ class NativeRegisterContextLinux_arm64
public:
NativeRegisterContextLinux_arm64(
const ArchSpec &target_arch, NativeThreadProtocol &native_thread,
- std::unique_ptr<RegisterInfoPOSIX_arm64> register_info_up);
+ std::unique_ptr<RegisterInfoCommon_arm64> register_info_up);
uint32_t GetRegisterSetCount() const override;
@@ -71,7 +71,7 @@ class NativeRegisterContextLinux_arm64
void *GetGPRBuffer() override { return &m_gpr_arm64; }
// GetGPRBufferSize returns sizeof arm64 GPR ptrace buffer, it is different
- // from GetGPRSize which returns sizeof RegisterInfoPOSIX_arm64::GPR.
+ // from GetGPRSize which returns sizeof RegisterInfoCommon_arm64::GPR.
size_t GetGPRBufferSize() { return sizeof(m_gpr_arm64); }
void *GetFPRBuffer() override { return &m_fpr; }
@@ -155,7 +155,7 @@ class NativeRegisterContextLinux_arm64
struct user_pt_regs m_gpr_arm64{};
/// Floating-point registers including extended register sets.
- RegisterInfoPOSIX_arm64::FPU m_fpr{};
+ RegisterInfoCommon_arm64::FPU m_fpr{};
SVEState m_sve_state = SVEState::Unknown;
struct sve::user_sve_header m_sve_header{};
@@ -263,7 +263,7 @@ class NativeRegisterContextLinux_arm64
uint32_t CalculateFprOffset(const RegisterInfo *reg_info,
bool streaming_fpsimd) const;
- RegisterInfoPOSIX_arm64 &GetRegisterInfo() const;
+ RegisterInfoCommon_arm64 &GetRegisterInfo() const;
void ConfigureRegisterContext();
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_loongarch64.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_loongarch64.cpp
index 850a380b5cf3f8..ed5da5c4b61965 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_loongarch64.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_loongarch64.cpp
@@ -12,7 +12,7 @@
#include "Plugins/Process/Linux/NativeProcessLinux.h"
#include "Plugins/Process/Linux/Procfs.h"
-#include "Plugins/Process/Utility/RegisterInfoPOSIX_loongarch64.h"
+#include "Plugins/Process/Utility/RegisterInfoCommon_loongarch64.h"
#include "Plugins/Process/Utility/lldb-loongarch-register-enums.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Utility/DataBufferHeap.h"
@@ -84,7 +84,7 @@ NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux(
switch (target_arch.GetMachine()) {
case llvm::Triple::loongarch64: {
Flags opt_regsets;
- auto register_info_up = std::make_unique<RegisterInfoPOSIX_loongarch64>(
+ auto register_info_up = std::make_unique<RegisterInfoCommon_loongarch64>(
target_arch, opt_regsets);
return std::make_unique<NativeRegisterContextLinux_loongarch64>(
target_arch, native_thread, std::move(register_info_up));
@@ -101,7 +101,7 @@ NativeRegisterContextLinux::DetermineArchitecture(lldb::tid_t tid) {
NativeRegisterContextLinux_loongarch64::NativeRegisterContextLinux_loongarch64(
const ArchSpec &target_arch, NativeThreadProtocol &native_thread,
- std::unique_ptr<RegisterInfoPOSIX_loongarch64> register_info_up)
+ std::unique_ptr<RegisterInfoCommon_loongarch64> register_info_up)
: NativeRegisterContextRegisterInfo(native_thread,
register_info_up.release()),
NativeRegisterContextLinux(native_thread) {
@@ -123,9 +123,9 @@ NativeRegisterContextLinux_loongarch64::NativeRegisterContextLinux_loongarch64(
m_lasx_is_valid = false;
}
-const RegisterInfoPOSIX_loongarch64 &
+const RegisterInfoCommon_loongarch64 &
NativeRegisterContextLinux_loongarch64::GetRegisterInfo() const {
- return static_cast<const RegisterInfoPOSIX_loongarch64 &>(
+ return static_cast<const RegisterInfoCommon_loongarch64 &>(
NativeRegisterContextRegisterInfo::GetRegisterInfoInterface());
}
@@ -369,22 +369,22 @@ Status NativeRegisterContextLinux_loongarch64::WriteAllRegisterValues(
bool NativeRegisterContextLinux_loongarch64::IsGPR(unsigned reg) const {
return GetRegisterInfo().GetRegisterSetFromRegisterIndex(reg) ==
- RegisterInfoPOSIX_loongarch64::GPRegSet;
+ RegisterInfoCommon_loongarch64::GPRegSet;
}
bool NativeRegisterContextLinux_loongarch64::IsFPR(unsigned reg) const {
return GetRegisterInfo().GetRegisterSetFromRegisterIndex(reg) ==
- RegisterInfoPOSIX_loongarch64::FPRegSet;
+ RegisterInfoCommon_loongarch64::FPRegSet;
}
bool NativeRegisterContextLinux_loongarch64::IsLSX(unsigned reg) const {
return GetRegisterInfo().GetRegisterSetFromRegisterIndex(reg) ==
- RegisterInfoPOSIX_loongarch64::LSXRegSet;
+ RegisterInfoCommon_loongarch64::LSXRegSet;
}
bool NativeRegisterContextLinux_loongarch64::IsLASX(unsigned reg) const {
return GetRegisterInfo().GetRegisterSetFromRegisterIndex(reg) ==
- RegisterInfoPOSIX_loongarch64::LASXRegSet;
+ RegisterInfoCommon_loongarch64::LASXRegSet;
}
Status NativeRegisterContextLinux_loongarch64::ReadGPR() {
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_loongarch64.h b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_loongarch64.h
index 2b2bb7d29d82f1..fc6bb05211c7da 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_loongarch64.h
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_loongarch64.h
@@ -13,7 +13,7 @@
#include "Plugins/Process/Linux/NativeRegisterContextLinux.h"
#include "Plugins/Process/Utility/NativeRegisterContextDBReg_loongarch.h"
-#include "Plugins/Process/Utility/RegisterInfoPOSIX_loongarch64.h"
+#include "Plugins/Process/Utility/RegisterInfoCommon_loongarch64.h"
#include <asm/ptrace.h>
@@ -28,7 +28,7 @@ class NativeRegisterContextLinux_loongarch64
public:
NativeRegisterContextLinux_loongarch64(
const ArchSpec &target_arch, NativeThreadProtocol &native_thread,
- std::unique_ptr<RegisterInfoPOSIX_loongarch64> register_info_up);
+ std::unique_ptr<RegisterInfoCommon_loongarch64> register_info_up);
uint32_t GetRegisterSetCount() const override;
@@ -85,10 +85,10 @@ class NativeRegisterContextLinux_loongarch64
bool m_lasx_is_valid;
bool m_refresh_hwdebug_info;
- RegisterInfoPOSIX_loongarch64::GPR m_gpr;
- RegisterInfoPOSIX_loongarch64::FPR m_fpr;
- RegisterInfoPOSIX_loongarch64::LSX m_lsx;
- RegisterInfoPOSIX_loongarch64::LASX m_lasx;
+ RegisterInfoCommon_loongarch64::GPR m_gpr;
+ RegisterInfoCommon_loongarch64::FPR m_fpr;
+ RegisterInfoCommon_loongarch64::LSX m_lsx;
+ RegisterInfoCommon_loongarch64::LASX m_lasx;
bool IsGPR(unsigned reg) const;
@@ -104,7 +104,7 @@ class NativeRegisterContextLinux_loongarch64
uint32_t CalculateLasxOffset(const RegisterInfo *reg_info) const;
- const RegisterInfoPOSIX_loongarch64 &GetRegisterInfo() const;
+ const RegisterInfoCommon_loongarch64 &GetRegisterInfo() const;
llvm::Error ReadHardwareDebugInfo() override;
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.cpp
index efa169b3917391..b58954510a40ba 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.cpp
@@ -16,7 +16,7 @@
#include "Plugins/Process/Linux/NativeProcessLinux.h"
#include "Plugins/Process/Linux/Procfs.h"
#include "Plugins/Process/POSIX/ProcessPOSIXLog.h"
-#include "Plugins/Process/Utility/RegisterInfoPOSIX_ppc64le.h"
+#include "Plugins/Process/Utility/RegisterInfoCommon_ppc64le.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Host/common/NativeProcessProtocol.h"
#include "lldb/Utility/DataBufferHeap.h"
@@ -131,7 +131,7 @@ NativeRegisterContextLinux::DetermineArchitecture(lldb::tid_t tid) {
NativeRegisterContextLinux_ppc64le::NativeRegisterContextLinux_ppc64le(
const ArchSpec &target_arch, NativeThreadProtocol &native_thread)
: NativeRegisterContextRegisterInfo(
- native_thread, new RegisterInfoPOSIX_ppc64le(target_arch)),
+ native_thread, new RegisterInfoCommon_ppc64le(target_arch)),
NativeRegisterContextLinux(native_thread) {
if (target_arch.GetMachine() != llvm::Triple::ppc64le) {
llvm_unreachable("Unhandled target architecture.");
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_riscv64.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_riscv64.cpp
index d58755b92d0632..43cc522eff0367 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_riscv64.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_riscv64.cpp
@@ -12,7 +12,7 @@
#include "Plugins/Process/Linux/NativeProcessLinux.h"
#include "Plugins/Process/Linux/Procfs.h"
-#include "Plugins/Process/Utility/RegisterInfoPOSIX_riscv64.h"
+#include "Plugins/Process/Utility/RegisterInfoCommon_riscv64.h"
#include "Plugins/Process/Utility/lldb-riscv-register-enums.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Utility/DataBufferHeap.h"
@@ -39,9 +39,9 @@ NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux(
const ArchSpec &target_arch, NativeThreadLinux &native_thread) {
switch (target_arch.GetMachine()) {
case llvm::Triple::riscv64: {
- Flags opt_regsets(RegisterInfoPOSIX_riscv64::eRegsetMaskDefault);
+ Flags opt_regsets(RegisterInfoCommon_riscv64::eRegsetMaskDefault);
- RegisterInfoPOSIX_riscv64::FPR fpr;
+ RegisterInfoCommon_riscv64::FPR fpr;
struct iovec ioVec;
ioVec.iov_base = &fpr;
ioVec.iov_len = sizeof(fpr);
@@ -51,11 +51,11 @@ NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux(
native_thread.GetID(), ®set,
&ioVec, sizeof(fpr))
.Success()) {
- opt_regsets.Set(RegisterInfoPOSIX_riscv64::eRegsetMaskFP);
+ opt_regsets.Set(RegisterInfoCommon_riscv64::eRegsetMaskFP);
}
auto register_info_up =
- std::make_unique<RegisterInfoPOSIX_riscv64>(target_arch, opt_regsets);
+ std::make_unique<RegisterInfoCommon_riscv64>(target_arch, opt_regsets);
return std::make_unique<NativeRegisterContextLinux_riscv64>(
target_arch, native_thread, std::move(register_info_up));
}
@@ -71,7 +71,7 @@ NativeRegisterContextLinux::DetermineArchitecture(lldb::tid_t tid) {
NativeRegisterContextLinux_riscv64::NativeRegisterContextLinux_riscv64(
const ArchSpec &target_arch, NativeThreadProtocol &native_thread,
- std::unique_ptr<RegisterInfoPOSIX_riscv64> register_info_up)
+ std::unique_ptr<RegisterInfoCommon_riscv64> register_info_up)
: NativeRegisterContextRegisterInfo(native_thread,
register_info_up.release()),
NativeRegisterContextLinux(native_thread) {
@@ -82,9 +82,9 @@ NativeRegisterContextLinux_riscv64::NativeRegisterContextLinux_riscv64(
m_fpu_is_valid = false;
}
-const RegisterInfoPOSIX_riscv64 &
+const RegisterInfoCommon_riscv64 &
NativeRegisterContextLinux_riscv64::GetRegisterInfo() const {
- return static_cast<const RegisterInfoPOSIX_riscv64 &>(
+ return static_cast<const RegisterInfoCommon_riscv64 &>(
NativeRegisterContextRegisterInfo::GetRegisterInfoInterface());
}
@@ -286,7 +286,7 @@ size_t NativeRegisterContextLinux_riscv64::GetRegContextSize() {
bool NativeRegisterContextLinux_riscv64::IsGPR(unsigned reg) const {
return GetRegisterInfo().GetRegisterSetFromRegisterIndex(reg) ==
- RegisterInfoPOSIX_riscv64::GPRegSet;
+ RegisterInfoCommon_riscv64::GPRegSet;
}
bool NativeRegisterContextLinux_riscv64::IsFPR(unsigned reg) const {
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_riscv64.h b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_riscv64.h
index d5cc50131cdc30..d5df762c9bee63 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_riscv64.h
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_riscv64.h
@@ -12,7 +12,7 @@
#define lldb_NativeRegisterContextLinux_riscv64_h
#include "Plugins/Process/Linux/NativeRegisterContextLinux.h"
-#include "Plugins/Process/Utility/RegisterInfoPOSIX_riscv64.h"
+#include "Plugins/Process/Utility/RegisterInfoCommon_riscv64.h"
#include <asm/ptrace.h>
@@ -25,7 +25,7 @@ class NativeRegisterContextLinux_riscv64 : public NativeRegisterContextLinux {
public:
NativeRegisterContextLinux_riscv64(
const ArchSpec &target_arch, NativeThreadProtocol &native_thread,
- std::unique_ptr<RegisterInfoPOSIX_riscv64> register_info_up);
+ std::unique_ptr<RegisterInfoCommon_riscv64> register_info_up);
uint32_t GetRegisterSetCount() const override;
@@ -71,9 +71,9 @@ class NativeRegisterContextLinux_riscv64 : public NativeRegisterContextLinux {
bool m_gpr_is_valid;
bool m_fpu_is_valid;
- RegisterInfoPOSIX_riscv64::GPR m_gpr;
+ RegisterInfoCommon_riscv64::GPR m_gpr;
- RegisterInfoPOSIX_riscv64::FPR m_fpr;
+ RegisterInfoCommon_riscv64::FPR m_fpr;
size_t GetRegContextSize();
@@ -83,7 +83,7 @@ class NativeRegisterContextLinux_riscv64 : public NativeRegisterContextLinux {
uint32_t CalculateFprOffset(const RegisterInfo *reg_info) const;
- const RegisterInfoPOSIX_riscv64 &GetRegisterInfo() const;
+ const RegisterInfoCommon_riscv64 &GetRegisterInfo() const;
};
} // namespace process_linux
diff --git a/lldb/source/Plugins/Process/Utility/CMakeLists.txt b/lldb/source/Plugins/Process/Utility/CMakeLists.txt
index cd2e19d5d5e302..43bd2848c34b59 100644
--- a/lldb/source/Plugins/Process/Utility/CMakeLists.txt
+++ b/lldb/source/Plugins/Process/Utility/CMakeLists.txt
@@ -18,14 +18,14 @@ add_lldb_library(lldbRegister NO_PLUGIN_DEPENDENCIES
RegisterInfoWindows_x86_64.cpp
RegisterTypeDetector_arm64.cpp
RegisterInfos_x86_64_with_base_shared.cpp
- RegisterInfoPOSIX_arm.cpp
- RegisterInfoPOSIX_arm64.cpp
- RegisterInfoPOSIX_loongarch64.cpp
- RegisterInfoPOSIX_ppc64le.cpp
- RegisterInfoPOSIX_ppc64.cpp
- RegisterInfoPOSIX_riscv32.cpp
- RegisterInfoPOSIX_riscv64.cpp
- RegisterInfoPOSIXDynamic_riscv32.cpp
+ RegisterInfoCommon_arm.cpp
+ RegisterInfoCommon_arm64.cpp
+ RegisterInfoCommon_loongarch64.cpp
+ RegisterInfoCommon_ppc64le.cpp
+ RegisterInfoCommon_ppc64.cpp
+ RegisterInfoCommon_riscv32.cpp
+ RegisterInfoCommon_riscv64.cpp
+ RegisterInfoCommonDynamic_riscv32.cpp
LINK_COMPONENTS
Support
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm.cpp
index 684176bccdf0c1..e2b3ae899ba400 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm.cpp
@@ -27,21 +27,21 @@ using namespace lldb_private;
bool RegisterContextPOSIX_arm::IsGPR(unsigned reg) {
if (m_register_info_up->GetRegisterSetFromRegisterIndex(reg) ==
- RegisterInfoPOSIX_arm::GPRegSet)
+ RegisterInfoCommon_arm::GPRegSet)
return true;
return false;
}
bool RegisterContextPOSIX_arm::IsFPR(unsigned reg) {
if (m_register_info_up->GetRegisterSetFromRegisterIndex(reg) ==
- RegisterInfoPOSIX_arm::FPRegSet)
+ RegisterInfoCommon_arm::FPRegSet)
return true;
return false;
}
RegisterContextPOSIX_arm::RegisterContextPOSIX_arm(
lldb_private::Thread &thread,
- std::unique_ptr<RegisterInfoPOSIX_arm> register_info)
+ std::unique_ptr<RegisterInfoCommon_arm> register_info)
: lldb_private::RegisterContext(thread, 0),
m_register_info_up(std::move(register_info)) {}
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm.h b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm.h
index 099c37d46f4965..4b21cfbb93d904 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm.h
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm.h
@@ -10,7 +10,7 @@
#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_ARM_H
#include "RegisterInfoInterface.h"
-#include "RegisterInfoPOSIX_arm.h"
+#include "RegisterInfoCommon_arm.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/Utility/Log.h"
@@ -18,7 +18,7 @@ class RegisterContextPOSIX_arm : public lldb_private::RegisterContext {
public:
RegisterContextPOSIX_arm(
lldb_private::Thread &thread,
- std::unique_ptr<RegisterInfoPOSIX_arm> register_info);
+ std::unique_ptr<RegisterInfoCommon_arm> register_info);
~RegisterContextPOSIX_arm() override;
@@ -43,7 +43,7 @@ class RegisterContextPOSIX_arm : public lldb_private::RegisterContext {
const char *GetRegisterName(unsigned reg);
protected:
- std::unique_ptr<RegisterInfoPOSIX_arm> m_register_info_up;
+ std::unique_ptr<RegisterInfoCommon_arm> m_register_info_up;
virtual const lldb_private::RegisterInfo *GetRegisterInfo();
@@ -51,7 +51,7 @@ class RegisterContextPOSIX_arm : public lldb_private::RegisterContext {
bool IsFPR(unsigned reg);
- size_t GetFPUSize() { return sizeof(RegisterInfoPOSIX_arm::FPU); }
+ size_t GetFPUSize() { return sizeof(RegisterInfoCommon_arm::FPU); }
virtual bool ReadGPR() = 0;
virtual bool ReadFPR() = 0;
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.cpp
index ecff3bfd6c8987..efc7b705c7ca0d 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.cpp
@@ -27,14 +27,14 @@ using namespace lldb_private;
bool RegisterContextPOSIX_arm64::IsGPR(unsigned reg) {
if (m_register_info_up->GetRegisterSetFromRegisterIndex(reg) ==
- RegisterInfoPOSIX_arm64::GPRegSet)
+ RegisterInfoCommon_arm64::GPRegSet)
return true;
return false;
}
bool RegisterContextPOSIX_arm64::IsFPR(unsigned reg) {
if (m_register_info_up->GetRegisterSetFromRegisterIndex(reg) ==
- RegisterInfoPOSIX_arm64::FPRegSet)
+ RegisterInfoCommon_arm64::FPRegSet)
return true;
return false;
}
@@ -73,7 +73,7 @@ bool RegisterContextPOSIX_arm64::IsPOE(unsigned reg) const {
RegisterContextPOSIX_arm64::RegisterContextPOSIX_arm64(
lldb_private::Thread &thread,
- std::unique_ptr<RegisterInfoPOSIX_arm64> register_info)
+ std::unique_ptr<RegisterInfoCommon_arm64> register_info)
: lldb_private::RegisterContext(thread, 0),
m_register_info_up(std::move(register_info)) {}
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.h b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.h
index eba02cdd136995..6137030a577116 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.h
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.h
@@ -10,7 +10,7 @@
#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_ARM64_H
#include "RegisterInfoInterface.h"
-#include "RegisterInfoPOSIX_arm64.h"
+#include "RegisterInfoCommon_arm64.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/Utility/Log.h"
@@ -18,7 +18,7 @@ class RegisterContextPOSIX_arm64 : public lldb_private::RegisterContext {
public:
RegisterContextPOSIX_arm64(
lldb_private::Thread &thread,
- std::unique_ptr<RegisterInfoPOSIX_arm64> register_info);
+ std::unique_ptr<RegisterInfoCommon_arm64> register_info);
~RegisterContextPOSIX_arm64() override;
@@ -43,7 +43,7 @@ class RegisterContextPOSIX_arm64 : public lldb_private::RegisterContext {
const char *GetRegisterName(unsigned reg);
protected:
- std::unique_ptr<RegisterInfoPOSIX_arm64> m_register_info_up;
+ std::unique_ptr<RegisterInfoCommon_arm64> m_register_info_up;
virtual const lldb_private::RegisterInfo *GetRegisterInfo();
@@ -51,7 +51,7 @@ class RegisterContextPOSIX_arm64 : public lldb_private::RegisterContext {
bool IsFPR(unsigned reg);
- size_t GetFPUSize() { return sizeof(RegisterInfoPOSIX_arm64::FPU); }
+ size_t GetFPUSize() { return sizeof(RegisterInfoCommon_arm64::FPU); }
bool IsSVE(unsigned reg) const;
bool IsPAuth(unsigned reg) const;
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_loongarch64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_loongarch64.cpp
index 3306fb20dae9b8..d60f79b6b8f6ed 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_loongarch64.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_loongarch64.cpp
@@ -23,7 +23,7 @@ using namespace lldb_private;
RegisterContextPOSIX_loongarch64::RegisterContextPOSIX_loongarch64(
lldb_private::Thread &thread,
- std::unique_ptr<RegisterInfoPOSIX_loongarch64> register_info)
+ std::unique_ptr<RegisterInfoCommon_loongarch64> register_info)
: lldb_private::RegisterContext(thread, 0),
m_register_info_up(std::move(register_info)) {}
@@ -73,20 +73,20 @@ RegisterContextPOSIX_loongarch64::GetRegisterInfo() {
bool RegisterContextPOSIX_loongarch64::IsGPR(unsigned int reg) {
return m_register_info_up->GetRegisterSetFromRegisterIndex(reg) ==
- RegisterInfoPOSIX_loongarch64::GPRegSet;
+ RegisterInfoCommon_loongarch64::GPRegSet;
}
bool RegisterContextPOSIX_loongarch64::IsFPR(unsigned int reg) {
return m_register_info_up->GetRegisterSetFromRegisterIndex(reg) ==
- RegisterInfoPOSIX_loongarch64::FPRegSet;
+ RegisterInfoCommon_loongarch64::FPRegSet;
}
bool RegisterContextPOSIX_loongarch64::IsLSX(unsigned int reg) {
return m_register_info_up->GetRegisterSetFromRegisterIndex(reg) ==
- RegisterInfoPOSIX_loongarch64::LSXRegSet;
+ RegisterInfoCommon_loongarch64::LSXRegSet;
}
bool RegisterContextPOSIX_loongarch64::IsLASX(unsigned int reg) {
return m_register_info_up->GetRegisterSetFromRegisterIndex(reg) ==
- RegisterInfoPOSIX_loongarch64::LASXRegSet;
+ RegisterInfoCommon_loongarch64::LASXRegSet;
}
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_loongarch64.h b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_loongarch64.h
index dca24e4b585bf4..7f63a6e95d9ab4 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_loongarch64.h
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_loongarch64.h
@@ -10,7 +10,7 @@
#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_LOONGARCH64_H
#include "RegisterInfoInterface.h"
-#include "RegisterInfoPOSIX_loongarch64.h"
+#include "RegisterInfoCommon_loongarch64.h"
#include "lldb-loongarch-register-enums.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/Utility/Log.h"
@@ -19,7 +19,7 @@ class RegisterContextPOSIX_loongarch64 : public lldb_private::RegisterContext {
public:
RegisterContextPOSIX_loongarch64(
lldb_private::Thread &thread,
- std::unique_ptr<RegisterInfoPOSIX_loongarch64> register_info);
+ std::unique_ptr<RegisterInfoCommon_loongarch64> register_info);
~RegisterContextPOSIX_loongarch64() override;
@@ -42,7 +42,7 @@ class RegisterContextPOSIX_loongarch64 : public lldb_private::RegisterContext {
const lldb_private::RegisterSet *GetRegisterSet(size_t set) override;
protected:
- std::unique_ptr<RegisterInfoPOSIX_loongarch64> m_register_info_up;
+ std::unique_ptr<RegisterInfoCommon_loongarch64> m_register_info_up;
virtual const lldb_private::RegisterInfo *GetRegisterInfo();
@@ -54,7 +54,7 @@ class RegisterContextPOSIX_loongarch64 : public lldb_private::RegisterContext {
bool IsLASX(unsigned reg);
- size_t GetFPRSize() { return sizeof(RegisterInfoPOSIX_loongarch64::FPR); }
+ size_t GetFPRSize() { return sizeof(RegisterInfoCommon_loongarch64::FPR); }
uint32_t GetRegNumFCSR() const { return fpr_fcsr_loongarch; }
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_riscv32.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_riscv32.cpp
index 64064f86cea046..1a0b0b9aaad39d 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_riscv32.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_riscv32.cpp
@@ -22,7 +22,7 @@ using namespace lldb_private;
RegisterContextPOSIX_riscv32::RegisterContextPOSIX_riscv32(
lldb_private::Thread &thread,
- std::unique_ptr<RegisterInfoPOSIX_riscv32> register_info)
+ std::unique_ptr<RegisterInfoCommon_riscv32> register_info)
: lldb_private::RegisterContext(thread, 0),
m_register_info_up(std::move(register_info)) {}
@@ -72,10 +72,10 @@ RegisterContextPOSIX_riscv32::GetRegisterInfo() {
bool RegisterContextPOSIX_riscv32::IsGPR(unsigned int reg) {
return m_register_info_up->GetRegisterSetFromRegisterIndex(reg) ==
- RegisterInfoPOSIX_riscv32::eRegsetMaskDefault;
+ RegisterInfoCommon_riscv32::eRegsetMaskDefault;
}
bool RegisterContextPOSIX_riscv32::IsFPR(unsigned int reg) {
return m_register_info_up->GetRegisterSetFromRegisterIndex(reg) ==
- RegisterInfoPOSIX_riscv32::eRegsetMaskFP;
+ RegisterInfoCommon_riscv32::eRegsetMaskFP;
}
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_riscv32.h b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_riscv32.h
index 0c25ce11f5754c..3fa948f0f82212 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_riscv32.h
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_riscv32.h
@@ -10,7 +10,7 @@
#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_RISCV32_H
#include "RegisterInfoInterface.h"
-#include "RegisterInfoPOSIX_riscv32.h"
+#include "RegisterInfoCommon_riscv32.h"
#include "lldb-riscv-register-enums.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/Utility/Log.h"
@@ -19,7 +19,7 @@ class RegisterContextPOSIX_riscv32 : public lldb_private::RegisterContext {
public:
RegisterContextPOSIX_riscv32(
lldb_private::Thread &thread,
- std::unique_ptr<RegisterInfoPOSIX_riscv32> register_info);
+ std::unique_ptr<RegisterInfoCommon_riscv32> register_info);
~RegisterContextPOSIX_riscv32() override;
@@ -42,7 +42,7 @@ class RegisterContextPOSIX_riscv32 : public lldb_private::RegisterContext {
const lldb_private::RegisterSet *GetRegisterSet(size_t set) override;
protected:
- std::unique_ptr<RegisterInfoPOSIX_riscv32> m_register_info_up;
+ std::unique_ptr<RegisterInfoCommon_riscv32> m_register_info_up;
virtual const lldb_private::RegisterInfo *GetRegisterInfo();
@@ -50,7 +50,7 @@ class RegisterContextPOSIX_riscv32 : public lldb_private::RegisterContext {
bool IsFPR(unsigned reg);
- size_t GetFPRSize() { return sizeof(RegisterInfoPOSIX_riscv32::FPR); }
+ size_t GetFPRSize() { return sizeof(RegisterInfoCommon_riscv32::FPR); }
uint32_t GetRegNumFCSR() const { return fpr_fcsr_riscv; }
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_riscv64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_riscv64.cpp
index bbcfb9eae10034..c69b7e02b45ba6 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_riscv64.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_riscv64.cpp
@@ -23,7 +23,7 @@ using namespace lldb_private;
RegisterContextPOSIX_riscv64::RegisterContextPOSIX_riscv64(
lldb_private::Thread &thread,
- std::unique_ptr<RegisterInfoPOSIX_riscv64> register_info)
+ std::unique_ptr<RegisterInfoCommon_riscv64> register_info)
: lldb_private::RegisterContext(thread, 0),
m_register_info_up(std::move(register_info)) {}
@@ -73,7 +73,7 @@ RegisterContextPOSIX_riscv64::GetRegisterInfo() {
bool RegisterContextPOSIX_riscv64::IsGPR(unsigned int reg) {
return m_register_info_up->GetRegisterSetFromRegisterIndex(reg) ==
- RegisterInfoPOSIX_riscv64::GPRegSet;
+ RegisterInfoCommon_riscv64::GPRegSet;
}
bool RegisterContextPOSIX_riscv64::IsFPR(unsigned int reg) {
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_riscv64.h b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_riscv64.h
index 2431ed6ab8c6db..417bb4f808f035 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_riscv64.h
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_riscv64.h
@@ -10,7 +10,7 @@
#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_RISCV64_H
#include "RegisterInfoInterface.h"
-#include "RegisterInfoPOSIX_riscv64.h"
+#include "RegisterInfoCommon_riscv64.h"
#include "lldb-riscv-register-enums.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/Utility/Log.h"
@@ -19,7 +19,7 @@ class RegisterContextPOSIX_riscv64 : public lldb_private::RegisterContext {
public:
RegisterContextPOSIX_riscv64(
lldb_private::Thread &thread,
- std::unique_ptr<RegisterInfoPOSIX_riscv64> register_info);
+ std::unique_ptr<RegisterInfoCommon_riscv64> register_info);
~RegisterContextPOSIX_riscv64() override;
@@ -42,7 +42,7 @@ class RegisterContextPOSIX_riscv64 : public lldb_private::RegisterContext {
const lldb_private::RegisterSet *GetRegisterSet(size_t set) override;
protected:
- std::unique_ptr<RegisterInfoPOSIX_riscv64> m_register_info_up;
+ std::unique_ptr<RegisterInfoCommon_riscv64> m_register_info_up;
virtual const lldb_private::RegisterInfo *GetRegisterInfo();
@@ -50,7 +50,7 @@ class RegisterContextPOSIX_riscv64 : public lldb_private::RegisterContext {
bool IsFPR(unsigned reg);
- size_t GetFPRSize() { return sizeof(RegisterInfoPOSIX_riscv64::FPR); }
+ size_t GetFPRSize() { return sizeof(RegisterInfoCommon_riscv64::FPR); }
uint32_t GetRegNumFCSR() const { return fpr_fcsr_riscv; }
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIXDynamic_riscv32.cpp b/lldb/source/Plugins/Process/Utility/RegisterInfoCommonDynamic_riscv32.cpp
similarity index 87%
rename from lldb/source/Plugins/Process/Utility/RegisterInfoPOSIXDynamic_riscv32.cpp
rename to lldb/source/Plugins/Process/Utility/RegisterInfoCommonDynamic_riscv32.cpp
index d7c266e064cca6..0fc22c04d26db8 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIXDynamic_riscv32.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoCommonDynamic_riscv32.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "RegisterInfoPOSIXDynamic_riscv32.h"
+#include "RegisterInfoCommonDynamic_riscv32.h"
#include "lldb-riscv-register-enums.h"
#include "lldb/lldb-defines.h"
@@ -22,16 +22,16 @@
#include "Plugins/Process/Utility/RegisterInfos_riscv32.h"
#undef DECLARE_REGISTER_INFOS_RISCV32_STRUCT
-RegisterInfoPOSIXDynamic_riscv32::RegisterInfoPOSIXDynamic_riscv32(
+RegisterInfoCommonDynamic_riscv32::RegisterInfoCommonDynamic_riscv32(
const lldb_private::ArchSpec &target_arch)
: lldb_private::RegisterInfoAndSetInterface(target_arch),
m_target_arch(target_arch) {}
-uint32_t RegisterInfoPOSIXDynamic_riscv32::GetRegisterCount() const {
+uint32_t RegisterInfoCommonDynamic_riscv32::GetRegisterCount() const {
return m_dyn_reg_infos.GetNumRegisters();
}
-size_t RegisterInfoPOSIXDynamic_riscv32::GetGPRSize() const {
+size_t RegisterInfoCommonDynamic_riscv32::GetGPRSize() const {
for (uint32_t set_idx = 0; set_idx < GetRegisterSetCount(); ++set_idx) {
const lldb_private::RegisterSet *set =
m_dyn_reg_infos.GetRegisterSet(set_idx);
@@ -41,7 +41,7 @@ size_t RegisterInfoPOSIXDynamic_riscv32::GetGPRSize() const {
return 0;
}
-size_t RegisterInfoPOSIXDynamic_riscv32::GetFPRSize() const {
+size_t RegisterInfoCommonDynamic_riscv32::GetFPRSize() const {
for (uint32_t set_idx = 0; set_idx < GetRegisterSetCount(); ++set_idx) {
const lldb_private::RegisterSet *set =
m_dyn_reg_infos.GetRegisterSet(set_idx);
@@ -52,18 +52,18 @@ size_t RegisterInfoPOSIXDynamic_riscv32::GetFPRSize() const {
}
const lldb_private::RegisterInfo *
-RegisterInfoPOSIXDynamic_riscv32::GetRegisterInfo() const {
+RegisterInfoCommonDynamic_riscv32::GetRegisterInfo() const {
return &*m_dyn_reg_infos
.registers<lldb_private::DynamicRegisterInfo::
reg_collection_const_range>()
.begin();
}
-size_t RegisterInfoPOSIXDynamic_riscv32::GetRegisterSetCount() const {
+size_t RegisterInfoCommonDynamic_riscv32::GetRegisterSetCount() const {
return m_dyn_reg_infos.GetNumRegisterSets();
}
-size_t RegisterInfoPOSIXDynamic_riscv32::GetRegisterSetFromRegisterIndex(
+size_t RegisterInfoCommonDynamic_riscv32::GetRegisterSetFromRegisterIndex(
uint32_t reg_index) const {
for (size_t set_index = 0; set_index < m_dyn_reg_infos.GetNumRegisterSets();
++set_index) {
@@ -77,24 +77,24 @@ size_t RegisterInfoPOSIXDynamic_riscv32::GetRegisterSetFromRegisterIndex(
}
const lldb_private::RegisterSet *
-RegisterInfoPOSIXDynamic_riscv32::GetRegisterSet(size_t set_index) const {
+RegisterInfoCommonDynamic_riscv32::GetRegisterSet(size_t set_index) const {
if (set_index < GetRegisterSetCount())
return m_dyn_reg_infos.GetRegisterSet(set_index);
return nullptr;
}
-size_t RegisterInfoPOSIXDynamic_riscv32::SetRegisterInfo(
+size_t RegisterInfoCommonDynamic_riscv32::SetRegisterInfo(
std::vector<lldb_private::DynamicRegisterInfo::Register> regs) {
return m_dyn_reg_infos.SetRegisterInfo(std::move(regs), m_target_arch);
}
const lldb_private::RegisterInfo *
-RegisterInfoPOSIXDynamic_riscv32::GetRegisterInfo(
+RegisterInfoCommonDynamic_riscv32::GetRegisterInfo(
llvm::StringRef reg_name) const {
return m_dyn_reg_infos.GetRegisterInfo(reg_name);
}
-void RegisterInfoPOSIXDynamic_riscv32::BuildCSRegInfos(
+void RegisterInfoCommonDynamic_riscv32::BuildCSRegInfos(
llvm::ArrayRef<std::string> features,
llvm::SmallVectorImpl<lldb_private::RegisterInfo> &cs_reg_infos) {
cs_reg_infos.clear();
@@ -143,7 +143,7 @@ void RegisterInfoPOSIXDynamic_riscv32::BuildCSRegInfos(
ConfigureCSRegInfos(feature, cs_reg_infos);
}
-void RegisterInfoPOSIXDynamic_riscv32::ConfigureCSRegInfos(
+void RegisterInfoCommonDynamic_riscv32::ConfigureCSRegInfos(
llvm::StringRef feature,
llvm::SmallVectorImpl<lldb_private::RegisterInfo> &cs_reg_infos) {
// Initialized on first use so that the patch set does not depend on the
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIXDynamic_riscv32.h b/lldb/source/Plugins/Process/Utility/RegisterInfoCommonDynamic_riscv32.h
similarity index 86%
rename from lldb/source/Plugins/Process/Utility/RegisterInfoPOSIXDynamic_riscv32.h
rename to lldb/source/Plugins/Process/Utility/RegisterInfoCommonDynamic_riscv32.h
index adbe318178a669..c02662de68dd2c 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIXDynamic_riscv32.h
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoCommonDynamic_riscv32.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOPOSIXDYNAMIC_RISCV32_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOPOSIXDYNAMIC_RISCV32_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOCOMMONDYNAMIC_RISCV32_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOCOMMONDYNAMIC_RISCV32_H
#include "RegisterInfoAndSetInterface.h"
#include "lldb/Target/DynamicRegisterInfo.h"
@@ -17,10 +17,10 @@
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
-class RegisterInfoPOSIXDynamic_riscv32
+class RegisterInfoCommonDynamic_riscv32
: public lldb_private::RegisterInfoAndSetInterface {
public:
- RegisterInfoPOSIXDynamic_riscv32(const lldb_private::ArchSpec &target_arch);
+ RegisterInfoCommonDynamic_riscv32(const lldb_private::ArchSpec &target_arch);
size_t GetGPRSize() const override;
@@ -67,4 +67,4 @@ class RegisterInfoPOSIXDynamic_riscv32
llvm::SmallVectorImpl<lldb_private::RegisterInfo> &cs_reg_infos);
};
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOPOSIXDYNAMIC_RISCV32_H
+#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOCOMMONDYNAMIC_RISCV32_H
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.cpp b/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_arm.cpp
similarity index 79%
rename from lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.cpp
rename to lldb/source/Plugins/Process/Utility/RegisterInfoCommon_arm.cpp
index 021ea56325e779..5af7bd5dd1ceec 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_arm.cpp
@@ -1,4 +1,4 @@
-//===-- RegisterInfoPOSIX_arm.cpp -----------------------------------------===//
+//===-- RegisterInfoCommon_arm.cpp -----------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -13,37 +13,37 @@
#include "lldb/lldb-defines.h"
#include "llvm/Support/Compiler.h"
-#include "RegisterInfoPOSIX_arm.h"
+#include "RegisterInfoCommon_arm.h"
using namespace lldb;
using namespace lldb_private;
// Based on RegisterContextDarwin_arm.cpp
#define GPR_OFFSET(idx) ((idx)*4)
-#define FPU_OFFSET(idx) ((idx)*4 + sizeof(RegisterInfoPOSIX_arm::GPR))
+#define FPU_OFFSET(idx) ((idx)*4 + sizeof(RegisterInfoCommon_arm::GPR))
#define FPSCR_OFFSET \
- (LLVM_EXTENSION offsetof(RegisterInfoPOSIX_arm::FPU, fpscr) + \
- sizeof(RegisterInfoPOSIX_arm::GPR))
+ (LLVM_EXTENSION offsetof(RegisterInfoCommon_arm::FPU, fpscr) + \
+ sizeof(RegisterInfoCommon_arm::GPR))
#define TLS_OFFSET \
- (sizeof(RegisterInfoPOSIX_arm::GPR) + sizeof(RegisterInfoPOSIX_arm::FPU))
+ (sizeof(RegisterInfoCommon_arm::GPR) + sizeof(RegisterInfoCommon_arm::FPU))
#define EXC_OFFSET(idx) \
- ((idx) * 4 + sizeof(RegisterInfoPOSIX_arm::GPR) + \
- sizeof(RegisterInfoPOSIX_arm::FPU) + sizeof(RegisterInfoPOSIX_arm::TLS))
+ ((idx) * 4 + sizeof(RegisterInfoCommon_arm::GPR) + \
+ sizeof(RegisterInfoCommon_arm::FPU) + sizeof(RegisterInfoCommon_arm::TLS))
#define DBG_OFFSET(reg) \
- ((LLVM_EXTENSION offsetof(RegisterInfoPOSIX_arm::DBG, reg) + \
- sizeof(RegisterInfoPOSIX_arm::GPR) + sizeof(RegisterInfoPOSIX_arm::FPU) + \
- sizeof(RegisterInfoPOSIX_arm::TLS) + sizeof(RegisterInfoPOSIX_arm::EXC)))
+ ((LLVM_EXTENSION offsetof(RegisterInfoCommon_arm::DBG, reg) + \
+ sizeof(RegisterInfoCommon_arm::GPR) + sizeof(RegisterInfoCommon_arm::FPU) + \
+ sizeof(RegisterInfoCommon_arm::TLS) + sizeof(RegisterInfoCommon_arm::EXC)))
#define DEFINE_DBG(reg, i) \
- #reg, NULL, sizeof(((RegisterInfoPOSIX_arm::DBG *) NULL)->reg[i]), \
+ #reg, NULL, sizeof(((RegisterInfoCommon_arm::DBG *) NULL)->reg[i]), \
DBG_OFFSET(reg[i]), eEncodingUint, eFormatHex, \
{LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, \
LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, \
dbg_##reg##i }, \
NULL, NULL, NULL,
#define REG_CONTEXT_SIZE \
- (sizeof(RegisterInfoPOSIX_arm::GPR) + sizeof(RegisterInfoPOSIX_arm::FPU) + \
- sizeof(RegisterInfoPOSIX_arm::EXC))
+ (sizeof(RegisterInfoCommon_arm::GPR) + sizeof(RegisterInfoCommon_arm::FPU) + \
+ sizeof(RegisterInfoCommon_arm::EXC))
// Include RegisterInfos_arm to declare our g_register_infos_arm structure.
#define DECLARE_REGISTER_INFOS_ARM_STRUCT
@@ -163,32 +163,32 @@ static const RegisterSet g_reg_sets_arm[k_num_register_sets_with_tls] = {
{"Thread Local Storage Registers", "tls", k_num_tls_registers,
g_tls_regnums_arm}};
-RegisterInfoPOSIX_arm::RegisterInfoPOSIX_arm(
+RegisterInfoCommon_arm::RegisterInfoCommon_arm(
const lldb_private::ArchSpec &target_arch, bool has_tls_reg)
: lldb_private::RegisterInfoAndSetInterface(target_arch),
m_register_info_p(GetRegisterInfoPtr(target_arch)),
m_register_info_count(GetRegisterInfoCount(target_arch)),
m_has_tls_reg(has_tls_reg) {}
-size_t RegisterInfoPOSIX_arm::GetGPRSize() const {
- return sizeof(struct RegisterInfoPOSIX_arm::GPR);
+size_t RegisterInfoCommon_arm::GetGPRSize() const {
+ return sizeof(struct RegisterInfoCommon_arm::GPR);
}
-size_t RegisterInfoPOSIX_arm::GetFPRSize() const {
- return sizeof(struct RegisterInfoPOSIX_arm::FPU);
+size_t RegisterInfoCommon_arm::GetFPRSize() const {
+ return sizeof(struct RegisterInfoCommon_arm::FPU);
}
const lldb_private::RegisterInfo *
-RegisterInfoPOSIX_arm::GetRegisterInfo() const {
+RegisterInfoCommon_arm::GetRegisterInfo() const {
return m_register_info_p;
}
-size_t RegisterInfoPOSIX_arm::GetRegisterSetCount() const {
+size_t RegisterInfoCommon_arm::GetRegisterSetCount() const {
return m_has_tls_reg ? k_num_register_sets_with_tls
: k_num_register_sets_without_tls;
}
-size_t RegisterInfoPOSIX_arm::GetRegisterSetFromRegisterIndex(
+size_t RegisterInfoCommon_arm::GetRegisterSetFromRegisterIndex(
uint32_t reg_index) const {
if (reg_index <= gpr_cpsr)
return GPRegSet;
@@ -200,12 +200,12 @@ size_t RegisterInfoPOSIX_arm::GetRegisterSetFromRegisterIndex(
}
const lldb_private::RegisterSet *
-RegisterInfoPOSIX_arm::GetRegisterSet(size_t set_index) const {
+RegisterInfoCommon_arm::GetRegisterSet(size_t set_index) const {
if (set_index < GetRegisterSetCount())
return &g_reg_sets_arm[set_index];
return nullptr;
}
-uint32_t RegisterInfoPOSIX_arm::GetRegisterCount() const {
+uint32_t RegisterInfoCommon_arm::GetRegisterCount() const {
return m_register_info_count;
}
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.h b/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_arm.h
similarity index 80%
rename from lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.h
rename to lldb/source/Plugins/Process/Utility/RegisterInfoCommon_arm.h
index 0695b0afd858ed..7045dc56958919 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.h
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_arm.h
@@ -1,4 +1,4 @@
-//===-- RegisterInfoPOSIX_arm.h ---------------------------------*- C++ -*-===//
+//===-- RegisterInfoCommon_arm.h ---------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,14 +6,14 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOPOSIX_ARM_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOPOSIX_ARM_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOCOMMON_ARM_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOCOMMON_ARM_H
#include "RegisterInfoAndSetInterface.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/lldb-private.h"
-class RegisterInfoPOSIX_arm : public lldb_private::RegisterInfoAndSetInterface {
+class RegisterInfoCommon_arm : public lldb_private::RegisterInfoAndSetInterface {
public:
enum { GPRegSet = 0, FPRegSet, TLSRegSet };
@@ -51,7 +51,7 @@ class RegisterInfoPOSIX_arm : public lldb_private::RegisterInfoAndSetInterface {
uint32_t wcr[16];
};
- RegisterInfoPOSIX_arm(const lldb_private::ArchSpec &target_arch,
+ RegisterInfoCommon_arm(const lldb_private::ArchSpec &target_arch,
bool has_tls_reg = false);
size_t GetGPRSize() const override;
@@ -77,4 +77,4 @@ class RegisterInfoPOSIX_arm : public lldb_private::RegisterInfoAndSetInterface {
bool m_has_tls_reg;
};
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOPOSIX_ARM_H
+#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOCOMMON_ARM_H
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp b/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_arm64.cpp
similarity index 83%
rename from lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp
rename to lldb/source/Plugins/Process/Utility/RegisterInfoCommon_arm64.cpp
index 0a6424eec0096b..e2ba9384c361ba 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_arm64.cpp
@@ -1,4 +1,4 @@
-//===-- RegisterInfoPOSIX_arm64.cpp ---------------------------------------===//
+//===-- RegisterInfoCommon_arm64.cpp ---------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -13,17 +13,17 @@
#include "lldb/lldb-defines.h"
#include "llvm/Support/Compiler.h"
-#include "RegisterInfoPOSIX_arm64.h"
+#include "RegisterInfoCommon_arm64.h"
// Based on RegisterContextDarwin_arm64.cpp
#define GPR_OFFSET(idx) ((idx)*8)
#define GPR_OFFSET_NAME(reg) \
- (LLVM_EXTENSION offsetof(RegisterInfoPOSIX_arm64::GPR, reg))
+ (LLVM_EXTENSION offsetof(RegisterInfoCommon_arm64::GPR, reg))
-#define FPU_OFFSET(idx) ((idx)*16 + sizeof(RegisterInfoPOSIX_arm64::GPR))
+#define FPU_OFFSET(idx) ((idx)*16 + sizeof(RegisterInfoCommon_arm64::GPR))
#define FPU_OFFSET_NAME(reg) \
- (LLVM_EXTENSION offsetof(RegisterInfoPOSIX_arm64::FPU, reg) + \
- sizeof(RegisterInfoPOSIX_arm64::GPR))
+ (LLVM_EXTENSION offsetof(RegisterInfoCommon_arm64::FPU, reg) + \
+ sizeof(RegisterInfoCommon_arm64::GPR))
// This information is based on AArch64 with SVE architecture reference manual.
// AArch64 with SVE has 32 Z and 16 P vector registers. There is also an FFR
@@ -39,32 +39,32 @@
// vector length requires register context to update sizes of SVE Z, P and FFR.
// Also register context needs to update byte offsets of all registers affected
// by the change in vector length.
-#define SVE_REGS_DEFAULT_OFFSET_LINUX sizeof(RegisterInfoPOSIX_arm64::GPR)
+#define SVE_REGS_DEFAULT_OFFSET_LINUX sizeof(RegisterInfoCommon_arm64::GPR)
#define SVE_OFFSET_VG SVE_REGS_DEFAULT_OFFSET_LINUX
#define EXC_OFFSET_NAME(reg) \
- (LLVM_EXTENSION offsetof(RegisterInfoPOSIX_arm64::EXC, reg) + \
- sizeof(RegisterInfoPOSIX_arm64::GPR) + \
- sizeof(RegisterInfoPOSIX_arm64::FPU))
+ (LLVM_EXTENSION offsetof(RegisterInfoCommon_arm64::EXC, reg) + \
+ sizeof(RegisterInfoCommon_arm64::GPR) + \
+ sizeof(RegisterInfoCommon_arm64::FPU))
#define DBG_OFFSET_NAME(reg) \
- (LLVM_EXTENSION offsetof(RegisterInfoPOSIX_arm64::DBG, reg) + \
- sizeof(RegisterInfoPOSIX_arm64::GPR) + \
- sizeof(RegisterInfoPOSIX_arm64::FPU) + \
- sizeof(RegisterInfoPOSIX_arm64::EXC))
+ (LLVM_EXTENSION offsetof(RegisterInfoCommon_arm64::DBG, reg) + \
+ sizeof(RegisterInfoCommon_arm64::GPR) + \
+ sizeof(RegisterInfoCommon_arm64::FPU) + \
+ sizeof(RegisterInfoCommon_arm64::EXC))
#define DEFINE_DBG(reg, i) \
#reg, NULL, \
- sizeof(((RegisterInfoPOSIX_arm64::DBG *) NULL)->reg[i]), \
+ sizeof(((RegisterInfoCommon_arm64::DBG *) NULL)->reg[i]), \
DBG_OFFSET_NAME(reg[i]), lldb::eEncodingUint, lldb::eFormatHex, \
{LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, \
LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, \
dbg_##reg##i }, \
NULL, NULL, NULL,
#define REG_CONTEXT_SIZE \
- (sizeof(RegisterInfoPOSIX_arm64::GPR) + \
- sizeof(RegisterInfoPOSIX_arm64::FPU) + \
- sizeof(RegisterInfoPOSIX_arm64::EXC))
+ (sizeof(RegisterInfoCommon_arm64::GPR) + \
+ sizeof(RegisterInfoCommon_arm64::FPU) + \
+ sizeof(RegisterInfoCommon_arm64::EXC))
// Include RegisterInfos_arm64 to declare our g_register_infos_arm64 structure.
#define DECLARE_REGISTER_INFOS_ARM64_STRUCT
@@ -236,7 +236,7 @@ static const lldb_private::RegisterSet g_reg_set_gcs_arm64 = {
static const lldb_private::RegisterSet g_reg_set_poe_arm64 = {
"Permission Overlay Registers", "poe", k_num_poe_register, nullptr};
-RegisterInfoPOSIX_arm64::RegisterInfoPOSIX_arm64(
+RegisterInfoCommon_arm64::RegisterInfoCommon_arm64(
const lldb_private::ArchSpec &target_arch, lldb_private::Flags opt_regsets)
: lldb_private::RegisterInfoAndSetInterface(target_arch),
m_opt_regsets(opt_regsets) {
@@ -306,28 +306,28 @@ RegisterInfoPOSIX_arm64::RegisterInfoPOSIX_arm64(
}
}
-uint32_t RegisterInfoPOSIX_arm64::GetRegisterCount() const {
+uint32_t RegisterInfoCommon_arm64::GetRegisterCount() const {
return m_register_info_count;
}
-size_t RegisterInfoPOSIX_arm64::GetGPRSizeStatic() {
- return sizeof(struct RegisterInfoPOSIX_arm64::GPR);
+size_t RegisterInfoCommon_arm64::GetGPRSizeStatic() {
+ return sizeof(struct RegisterInfoCommon_arm64::GPR);
}
-size_t RegisterInfoPOSIX_arm64::GetFPRSize() const {
- return sizeof(struct RegisterInfoPOSIX_arm64::FPU);
+size_t RegisterInfoCommon_arm64::GetFPRSize() const {
+ return sizeof(struct RegisterInfoCommon_arm64::FPU);
}
const lldb_private::RegisterInfo *
-RegisterInfoPOSIX_arm64::GetRegisterInfo() const {
+RegisterInfoCommon_arm64::GetRegisterInfo() const {
return m_register_info_p;
}
-size_t RegisterInfoPOSIX_arm64::GetRegisterSetCount() const {
+size_t RegisterInfoCommon_arm64::GetRegisterSetCount() const {
return m_register_set_count;
}
-size_t RegisterInfoPOSIX_arm64::GetRegisterSetFromRegisterIndex(
+size_t RegisterInfoCommon_arm64::GetRegisterSetFromRegisterIndex(
uint32_t reg_index) const {
for (const auto ®set_range : m_per_regset_regnum_range) {
if (reg_index >= regset_range.second.first &&
@@ -338,13 +338,13 @@ size_t RegisterInfoPOSIX_arm64::GetRegisterSetFromRegisterIndex(
}
const lldb_private::RegisterSet *
-RegisterInfoPOSIX_arm64::GetRegisterSet(size_t set_index) const {
+RegisterInfoCommon_arm64::GetRegisterSet(size_t set_index) const {
if (set_index < GetRegisterSetCount())
return &m_register_set_p[set_index];
return nullptr;
}
-void RegisterInfoPOSIX_arm64::AddRegSetPAuth() {
+void RegisterInfoCommon_arm64::AddRegSetPAuth() {
uint32_t pa_regnum = m_dynamic_reg_infos.size();
for (uint32_t i = 0; i < k_num_pauth_register; i++) {
pauth_regnum_collection.push_back(pa_regnum + i);
@@ -362,7 +362,7 @@ void RegisterInfoPOSIX_arm64::AddRegSetPAuth() {
m_dynamic_reg_sets.back().registers = pauth_regnum_collection.data();
}
-void RegisterInfoPOSIX_arm64::AddRegSetMTE() {
+void RegisterInfoCommon_arm64::AddRegSetMTE() {
uint32_t mte_regnum = m_dynamic_reg_infos.size();
m_mte_regnum_collection.push_back(mte_regnum);
m_dynamic_reg_infos.push_back(g_register_infos_mte[0]);
@@ -377,7 +377,7 @@ void RegisterInfoPOSIX_arm64::AddRegSetMTE() {
m_dynamic_reg_sets.back().registers = m_mte_regnum_collection.data();
}
-void RegisterInfoPOSIX_arm64::AddRegSetTLS(bool has_tpidr2) {
+void RegisterInfoCommon_arm64::AddRegSetTLS(bool has_tpidr2) {
uint32_t tls_regnum = m_dynamic_reg_infos.size();
uint32_t num_regs = has_tpidr2 ? 2 : 1;
for (uint32_t i = 0; i < num_regs; i++) {
@@ -397,7 +397,7 @@ void RegisterInfoPOSIX_arm64::AddRegSetTLS(bool has_tpidr2) {
m_dynamic_reg_sets.back().registers = m_tls_regnum_collection.data();
}
-void RegisterInfoPOSIX_arm64::AddRegSetSME(bool has_zt) {
+void RegisterInfoCommon_arm64::AddRegSetSME(bool has_zt) {
const uint32_t first_sme_regnum = m_dynamic_reg_infos.size();
uint32_t sme_regnum = first_sme_regnum;
@@ -439,7 +439,7 @@ void RegisterInfoPOSIX_arm64::AddRegSetSME(bool has_zt) {
m_dynamic_reg_infos[GetRegNumSVEVG()].invalidate_regs = vg_invalidates;
}
-void RegisterInfoPOSIX_arm64::AddRegSetFPMR() {
+void RegisterInfoCommon_arm64::AddRegSetFPMR() {
uint32_t fpmr_regnum = m_dynamic_reg_infos.size();
m_fpmr_regnum_collection.push_back(fpmr_regnum);
m_dynamic_reg_infos.push_back(g_register_infos_fpmr[0]);
@@ -454,7 +454,7 @@ void RegisterInfoPOSIX_arm64::AddRegSetFPMR() {
m_dynamic_reg_sets.back().registers = m_fpmr_regnum_collection.data();
}
-void RegisterInfoPOSIX_arm64::AddRegSetGCS() {
+void RegisterInfoCommon_arm64::AddRegSetGCS() {
uint32_t gcs_regnum = m_dynamic_reg_infos.size();
for (uint32_t i = 0; i < k_num_gcs_register; i++) {
m_gcs_regnum_collection.push_back(gcs_regnum + i);
@@ -472,7 +472,7 @@ void RegisterInfoPOSIX_arm64::AddRegSetGCS() {
m_dynamic_reg_sets.back().registers = m_gcs_regnum_collection.data();
}
-void RegisterInfoPOSIX_arm64::AddRegSetPOE() {
+void RegisterInfoCommon_arm64::AddRegSetPOE() {
uint32_t poe_regnum = m_dynamic_reg_infos.size();
m_poe_regnum_collection.push_back(poe_regnum);
m_dynamic_reg_infos.push_back(g_register_infos_poe[0]);
@@ -487,7 +487,7 @@ void RegisterInfoPOSIX_arm64::AddRegSetPOE() {
m_dynamic_reg_sets.back().registers = m_poe_regnum_collection.data();
}
-uint32_t RegisterInfoPOSIX_arm64::ConfigureVectorLengthSVE(uint32_t sve_vq) {
+uint32_t RegisterInfoCommon_arm64::ConfigureVectorLengthSVE(uint32_t sve_vq) {
// sve_vq contains SVE Quad vector length in context of AArch64 SVE.
// SVE register infos if enabled cannot be disabled by selecting sve_vq = 0.
// Also if an invalid or previously set vector length is passed to this
@@ -551,7 +551,7 @@ uint32_t RegisterInfoPOSIX_arm64::ConfigureVectorLengthSVE(uint32_t sve_vq) {
return m_vector_reg_vq;
}
-void RegisterInfoPOSIX_arm64::ConfigureVectorLengthZA(uint32_t za_vq) {
+void RegisterInfoCommon_arm64::ConfigureVectorLengthZA(uint32_t za_vq) {
if (!VectorSizeIsValid(za_vq) || m_za_reg_vq == za_vq)
return;
@@ -565,117 +565,117 @@ void RegisterInfoPOSIX_arm64::ConfigureVectorLengthZA(uint32_t za_vq) {
(za_vq * 16) * (za_vq * 16);
}
-bool RegisterInfoPOSIX_arm64::IsSVEReg(unsigned reg) const {
+bool RegisterInfoCommon_arm64::IsSVEReg(unsigned reg) const {
if (m_vector_reg_vq > eVectorQuadwordAArch64)
return (sve_vg <= reg && reg <= sve_ffr);
else
return false;
}
-bool RegisterInfoPOSIX_arm64::IsSVEZReg(unsigned reg) const {
+bool RegisterInfoCommon_arm64::IsSVEZReg(unsigned reg) const {
return (sve_z0 <= reg && reg <= sve_z31);
}
-bool RegisterInfoPOSIX_arm64::IsSVEPReg(unsigned reg) const {
+bool RegisterInfoCommon_arm64::IsSVEPReg(unsigned reg) const {
return (sve_p0 <= reg && reg <= sve_p15);
}
-bool RegisterInfoPOSIX_arm64::IsSVERegVG(unsigned reg) const {
+bool RegisterInfoCommon_arm64::IsSVERegVG(unsigned reg) const {
return sve_vg == reg;
}
-bool RegisterInfoPOSIX_arm64::IsSVERegFFR(unsigned reg) const {
+bool RegisterInfoCommon_arm64::IsSVERegFFR(unsigned reg) const {
return sve_ffr == reg;
}
-bool RegisterInfoPOSIX_arm64::IsSMERegZA(unsigned reg) const {
+bool RegisterInfoCommon_arm64::IsSMERegZA(unsigned reg) const {
return reg == m_sme_regnum_collection[2];
}
-bool RegisterInfoPOSIX_arm64::IsSMERegZT(unsigned reg) const {
+bool RegisterInfoCommon_arm64::IsSMERegZT(unsigned reg) const {
// ZT0 is part of the SME register set only if SME2 is present.
return m_sme_regnum_collection.size() >= 4 &&
reg == m_sme_regnum_collection[3];
}
-bool RegisterInfoPOSIX_arm64::IsGPR(unsigned reg) const {
+bool RegisterInfoCommon_arm64::IsGPR(unsigned reg) const {
return GetRegisterSetFromRegisterIndex(reg) ==
- RegisterInfoPOSIX_arm64::GPRegSet;
+ RegisterInfoCommon_arm64::GPRegSet;
}
-bool RegisterInfoPOSIX_arm64::IsFPR(unsigned reg) const {
+bool RegisterInfoCommon_arm64::IsFPR(unsigned reg) const {
return GetRegisterSetFromRegisterIndex(reg) ==
- RegisterInfoPOSIX_arm64::FPRegSet;
+ RegisterInfoCommon_arm64::FPRegSet;
}
-bool RegisterInfoPOSIX_arm64::IsPAuthReg(unsigned reg) const {
+bool RegisterInfoCommon_arm64::IsPAuthReg(unsigned reg) const {
return llvm::is_contained(pauth_regnum_collection, reg);
}
-bool RegisterInfoPOSIX_arm64::IsMTEReg(unsigned reg) const {
+bool RegisterInfoCommon_arm64::IsMTEReg(unsigned reg) const {
return llvm::is_contained(m_mte_regnum_collection, reg);
}
-bool RegisterInfoPOSIX_arm64::IsTLSReg(unsigned reg) const {
+bool RegisterInfoCommon_arm64::IsTLSReg(unsigned reg) const {
return llvm::is_contained(m_tls_regnum_collection, reg);
}
-bool RegisterInfoPOSIX_arm64::IsSMEReg(unsigned reg) const {
+bool RegisterInfoCommon_arm64::IsSMEReg(unsigned reg) const {
return llvm::is_contained(m_sme_regnum_collection, reg);
}
-bool RegisterInfoPOSIX_arm64::IsFPMRReg(unsigned reg) const {
+bool RegisterInfoCommon_arm64::IsFPMRReg(unsigned reg) const {
return llvm::is_contained(m_fpmr_regnum_collection, reg);
}
-bool RegisterInfoPOSIX_arm64::IsGCSReg(unsigned reg) const {
+bool RegisterInfoCommon_arm64::IsGCSReg(unsigned reg) const {
return llvm::is_contained(m_gcs_regnum_collection, reg);
}
-bool RegisterInfoPOSIX_arm64::IsPOEReg(unsigned reg) const {
+bool RegisterInfoCommon_arm64::IsPOEReg(unsigned reg) const {
return llvm::is_contained(m_poe_regnum_collection, reg);
}
-uint32_t RegisterInfoPOSIX_arm64::GetRegNumSVEZ0() const { return sve_z0; }
+uint32_t RegisterInfoCommon_arm64::GetRegNumSVEZ0() const { return sve_z0; }
-uint32_t RegisterInfoPOSIX_arm64::GetRegNumSVEFFR() const { return sve_ffr; }
+uint32_t RegisterInfoCommon_arm64::GetRegNumSVEFFR() const { return sve_ffr; }
-uint32_t RegisterInfoPOSIX_arm64::GetRegNumFPCR() const { return fpu_fpcr; }
+uint32_t RegisterInfoCommon_arm64::GetRegNumFPCR() const { return fpu_fpcr; }
-uint32_t RegisterInfoPOSIX_arm64::GetRegNumFPSR() const { return fpu_fpsr; }
+uint32_t RegisterInfoCommon_arm64::GetRegNumFPSR() const { return fpu_fpsr; }
-uint32_t RegisterInfoPOSIX_arm64::GetRegNumFPV0() const { return fpu_v0; }
+uint32_t RegisterInfoCommon_arm64::GetRegNumFPV0() const { return fpu_v0; }
-uint32_t RegisterInfoPOSIX_arm64::GetRegNumSVEVG() const { return sve_vg; }
+uint32_t RegisterInfoCommon_arm64::GetRegNumSVEVG() const { return sve_vg; }
-uint32_t RegisterInfoPOSIX_arm64::GetRegNumSMESVG() const {
+uint32_t RegisterInfoCommon_arm64::GetRegNumSMESVG() const {
return m_sme_regnum_collection[1];
}
-uint32_t RegisterInfoPOSIX_arm64::GetPAuthOffset() const {
+uint32_t RegisterInfoCommon_arm64::GetPAuthOffset() const {
return m_register_info_p[pauth_regnum_collection[0]].byte_offset;
}
-uint32_t RegisterInfoPOSIX_arm64::GetMTEOffset() const {
+uint32_t RegisterInfoCommon_arm64::GetMTEOffset() const {
return m_register_info_p[m_mte_regnum_collection[0]].byte_offset;
}
-uint32_t RegisterInfoPOSIX_arm64::GetTLSOffset() const {
+uint32_t RegisterInfoCommon_arm64::GetTLSOffset() const {
return m_register_info_p[m_tls_regnum_collection[0]].byte_offset;
}
-uint32_t RegisterInfoPOSIX_arm64::GetSMEOffset() const {
+uint32_t RegisterInfoCommon_arm64::GetSMEOffset() const {
return m_register_info_p[m_sme_regnum_collection[0]].byte_offset;
}
-uint32_t RegisterInfoPOSIX_arm64::GetFPMROffset() const {
+uint32_t RegisterInfoCommon_arm64::GetFPMROffset() const {
return m_register_info_p[m_fpmr_regnum_collection[0]].byte_offset;
}
-uint32_t RegisterInfoPOSIX_arm64::GetGCSOffset() const {
+uint32_t RegisterInfoCommon_arm64::GetGCSOffset() const {
return m_register_info_p[m_gcs_regnum_collection[0]].byte_offset;
}
-uint32_t RegisterInfoPOSIX_arm64::GetPOEOffset() const {
+uint32_t RegisterInfoCommon_arm64::GetPOEOffset() const {
return m_register_info_p[m_poe_regnum_collection[0]].byte_offset;
}
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h b/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_arm64.h
similarity index 95%
rename from lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h
rename to lldb/source/Plugins/Process/Utility/RegisterInfoCommon_arm64.h
index 378ea3f524f6c6..e80e4c76d5fe86 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_arm64.h
@@ -1,4 +1,4 @@
-//===-- RegisterInfoPOSIX_arm64.h -------------------------------*- C++ -*-===//
+//===-- RegisterInfoCommon_arm64.h -------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOPOSIX_ARM64_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOPOSIX_ARM64_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOCOMMON_ARM64_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOCOMMON_ARM64_H
#include "RegisterInfoAndSetInterface.h"
#include "lldb/Target/RegisterContext.h"
@@ -30,7 +30,7 @@ enum class SVEState : uint8_t {
StreamingFPSIMD
};
-class RegisterInfoPOSIX_arm64
+class RegisterInfoCommon_arm64
: public lldb_private::RegisterInfoAndSetInterface {
public:
enum { GPRegSet = 0, FPRegSet };
@@ -101,7 +101,7 @@ class RegisterInfoPOSIX_arm64
uint64_t mdscr_el1;
};
- RegisterInfoPOSIX_arm64(const lldb_private::ArchSpec &target_arch,
+ RegisterInfoCommon_arm64(const lldb_private::ArchSpec &target_arch,
lldb_private::Flags opt_regsets);
static size_t GetGPRSizeStatic();
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_loongarch64.cpp b/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_loongarch64.cpp
similarity index 82%
rename from lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_loongarch64.cpp
rename to lldb/source/Plugins/Process/Utility/RegisterInfoCommon_loongarch64.cpp
index 61cd40ddcfc841..95f491671c1e91 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_loongarch64.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_loongarch64.cpp
@@ -1,4 +1,4 @@
-//===-- RegisterInfoPOSIX_loongarch64.cpp --------------------------------===//
+//===-- RegisterInfoCommon_loongarch64.cpp --------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -13,32 +13,32 @@
#include "lldb/lldb-defines.h"
#include "llvm/Support/Compiler.h"
-#include "RegisterInfoPOSIX_loongarch64.h"
+#include "RegisterInfoCommon_loongarch64.h"
#define GPR_OFFSET(idx) ((idx)*8 + 0)
-#define FPR_OFFSET(idx) ((idx)*8 + sizeof(RegisterInfoPOSIX_loongarch64::GPR))
-#define FCC_OFFSET(idx) ((idx)*1 + 32 * 8 + sizeof(RegisterInfoPOSIX_loongarch64::GPR))
-#define FCSR_OFFSET (8 * 1 + 32 * 8 + sizeof(RegisterInfoPOSIX_loongarch64::GPR))
+#define FPR_OFFSET(idx) ((idx)*8 + sizeof(RegisterInfoCommon_loongarch64::GPR))
+#define FCC_OFFSET(idx) ((idx)*1 + 32 * 8 + sizeof(RegisterInfoCommon_loongarch64::GPR))
+#define FCSR_OFFSET (8 * 1 + 32 * 8 + sizeof(RegisterInfoCommon_loongarch64::GPR))
#define LSX_OFFSET(idx) \
- ((idx) * 16 + sizeof(RegisterInfoPOSIX_loongarch64::GPR) + \
- sizeof(RegisterInfoPOSIX_loongarch64::FPR))
+ ((idx) * 16 + sizeof(RegisterInfoCommon_loongarch64::GPR) + \
+ sizeof(RegisterInfoCommon_loongarch64::FPR))
#define LASX_OFFSET(idx) \
- ((idx) * 32 + sizeof(RegisterInfoPOSIX_loongarch64::GPR) + \
- sizeof(RegisterInfoPOSIX_loongarch64::FPR) + \
- sizeof(RegisterInfoPOSIX_loongarch64::LSX))
+ ((idx) * 32 + sizeof(RegisterInfoCommon_loongarch64::GPR) + \
+ sizeof(RegisterInfoCommon_loongarch64::FPR) + \
+ sizeof(RegisterInfoCommon_loongarch64::LSX))
#define REG_CONTEXT_SIZE \
- (sizeof(RegisterInfoPOSIX_loongarch64::GPR) + \
- sizeof(RegisterInfoPOSIX_loongarch64::FPR) + \
- sizeof(RegisterInfoPOSIX_loongarch64::LSX) + \
- sizeof(RegisterInfoPOSIX_loongarch64::LASX))
+ (sizeof(RegisterInfoCommon_loongarch64::GPR) + \
+ sizeof(RegisterInfoCommon_loongarch64::FPR) + \
+ sizeof(RegisterInfoCommon_loongarch64::LSX) + \
+ sizeof(RegisterInfoCommon_loongarch64::LASX))
#define DECLARE_REGISTER_INFOS_LOONGARCH64_STRUCT
#include "RegisterInfos_loongarch64.h"
#undef DECLARE_REGISTER_INFOS_LOONGARCH64_STRUCT
const lldb_private::RegisterInfo *
-RegisterInfoPOSIX_loongarch64::GetRegisterInfoPtr(
+RegisterInfoCommon_loongarch64::GetRegisterInfoPtr(
const lldb_private::ArchSpec &target_arch) {
switch (target_arch.GetMachine()) {
case llvm::Triple::loongarch64:
@@ -49,7 +49,7 @@ RegisterInfoPOSIX_loongarch64::GetRegisterInfoPtr(
}
}
-uint32_t RegisterInfoPOSIX_loongarch64::GetRegisterInfoCount(
+uint32_t RegisterInfoCommon_loongarch64::GetRegisterInfoCount(
const lldb_private::ArchSpec &target_arch) {
switch (target_arch.GetMachine()) {
case llvm::Triple::loongarch64:
@@ -166,34 +166,34 @@ static const lldb_private::RegisterSet
{"LASX Vector Registers", "lasx", k_num_lasx_registers,
g_lasx_regnums_loongarch64}};
-RegisterInfoPOSIX_loongarch64::RegisterInfoPOSIX_loongarch64(
+RegisterInfoCommon_loongarch64::RegisterInfoCommon_loongarch64(
const lldb_private::ArchSpec &target_arch, lldb_private::Flags flags)
: lldb_private::RegisterInfoAndSetInterface(target_arch),
m_register_info_p(GetRegisterInfoPtr(target_arch)),
m_register_info_count(GetRegisterInfoCount(target_arch)) {}
-uint32_t RegisterInfoPOSIX_loongarch64::GetRegisterCount() const {
+uint32_t RegisterInfoCommon_loongarch64::GetRegisterCount() const {
return m_register_info_count;
}
-size_t RegisterInfoPOSIX_loongarch64::GetGPRSize() const {
- return sizeof(struct RegisterInfoPOSIX_loongarch64::GPR);
+size_t RegisterInfoCommon_loongarch64::GetGPRSize() const {
+ return sizeof(struct RegisterInfoCommon_loongarch64::GPR);
}
-size_t RegisterInfoPOSIX_loongarch64::GetFPRSize() const {
- return sizeof(struct RegisterInfoPOSIX_loongarch64::FPR);
+size_t RegisterInfoCommon_loongarch64::GetFPRSize() const {
+ return sizeof(struct RegisterInfoCommon_loongarch64::FPR);
}
const lldb_private::RegisterInfo *
-RegisterInfoPOSIX_loongarch64::GetRegisterInfo() const {
+RegisterInfoCommon_loongarch64::GetRegisterInfo() const {
return m_register_info_p;
}
-size_t RegisterInfoPOSIX_loongarch64::GetRegisterSetCount() const {
+size_t RegisterInfoCommon_loongarch64::GetRegisterSetCount() const {
return k_num_register_sets;
}
-size_t RegisterInfoPOSIX_loongarch64::GetRegisterSetFromRegisterIndex(
+size_t RegisterInfoCommon_loongarch64::GetRegisterSetFromRegisterIndex(
uint32_t reg_index) const {
// coverity[unsigned_compare]
if (reg_index >= gpr_first_loongarch && reg_index <= gpr_last_loongarch)
@@ -208,7 +208,7 @@ size_t RegisterInfoPOSIX_loongarch64::GetRegisterSetFromRegisterIndex(
}
const lldb_private::RegisterSet *
-RegisterInfoPOSIX_loongarch64::GetRegisterSet(size_t set_index) const {
+RegisterInfoCommon_loongarch64::GetRegisterSet(size_t set_index) const {
if (set_index < GetRegisterSetCount())
return &g_reg_sets_loongarch64[set_index];
return nullptr;
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_loongarch64.h b/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_loongarch64.h
similarity index 83%
rename from lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_loongarch64.h
rename to lldb/source/Plugins/Process/Utility/RegisterInfoCommon_loongarch64.h
index 0ff08bb8c0e92a..65941db7244fa5 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_loongarch64.h
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_loongarch64.h
@@ -1,4 +1,4 @@
-//===-- RegisterInfoPOSIX_loongarch64.h -------------------------*- C++ -*-===//
+//===-- RegisterInfoCommon_loongarch64.h -------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,15 +6,15 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOPOSIX_LOONGARCH64_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOPOSIX_LOONGARCH64_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOCOMMON_LOONGARCH64_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOCOMMON_LOONGARCH64_H
#include "RegisterInfoAndSetInterface.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/lldb-private.h"
#include <map>
-class RegisterInfoPOSIX_loongarch64
+class RegisterInfoCommon_loongarch64
: public lldb_private::RegisterInfoAndSetInterface {
public:
static const lldb_private::RegisterInfo *
@@ -55,7 +55,7 @@ class RegisterInfoPOSIX_loongarch64
uint64_t xr[32 * 4];
};
- RegisterInfoPOSIX_loongarch64(const lldb_private::ArchSpec &target_arch,
+ RegisterInfoCommon_loongarch64(const lldb_private::ArchSpec &target_arch,
lldb_private::Flags flags);
size_t GetGPRSize() const override;
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_ppc64.cpp b/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_ppc64.cpp
similarity index 82%
rename from lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_ppc64.cpp
rename to lldb/source/Plugins/Process/Utility/RegisterInfoCommon_ppc64.cpp
index e4969d4b306b70..43a675c4cd4a88 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_ppc64.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_ppc64.cpp
@@ -1,4 +1,4 @@
-//===-- RegisterInfoPOSIX_ppc64.cpp ---------------------------------------===//
+//===-- RegisterInfoCommon_ppc64.cpp ---------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -13,9 +13,9 @@
#include "lldb/lldb-defines.h"
#include "llvm/Support/Compiler.h"
-#include "RegisterInfoPOSIX_ppc64.h"
+#include "RegisterInfoCommon_ppc64.h"
-// Include RegisterInfoPOSIX_ppc64 to declare our g_register_infos_ppc64
+// Include RegisterInfoCommon_ppc64 to declare our g_register_infos_ppc64
#define DECLARE_REGISTER_INFOS_PPC64_STRUCT
#include "RegisterInfos_ppc64.h"
#undef DECLARE_REGISTER_INFOS_PPC64_STRUCT
@@ -48,7 +48,7 @@ GetRegisterInfoCount(const lldb_private::ArchSpec &target_arch) {
}
}
-RegisterInfoPOSIX_ppc64::RegisterInfoPOSIX_ppc64(
+RegisterInfoCommon_ppc64::RegisterInfoCommon_ppc64(
const lldb_private::ArchSpec &target_arch)
: lldb_private::RegisterInfoInterface(target_arch),
m_register_info_p(GetRegisterInfoPtr(target_arch)),
@@ -66,13 +66,13 @@ RegisterInfoPOSIX_ppc64::RegisterInfoPOSIX_ppc64(
}
}
-size_t RegisterInfoPOSIX_ppc64::GetGPRSize() const { return m_gpr_size; }
+size_t RegisterInfoCommon_ppc64::GetGPRSize() const { return m_gpr_size; }
const lldb_private::RegisterInfo *
-RegisterInfoPOSIX_ppc64::GetRegisterInfo() const {
+RegisterInfoCommon_ppc64::GetRegisterInfo() const {
return m_register_info_p;
}
-uint32_t RegisterInfoPOSIX_ppc64::GetRegisterCount() const {
+uint32_t RegisterInfoCommon_ppc64::GetRegisterCount() const {
return m_register_info_count;
}
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_ppc64.h b/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_ppc64.h
similarity index 60%
rename from lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_ppc64.h
rename to lldb/source/Plugins/Process/Utility/RegisterInfoCommon_ppc64.h
index e33d32ae98ad38..64f8c384a87562 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_ppc64.h
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_ppc64.h
@@ -1,4 +1,4 @@
-//===-- RegisterInfoPOSIX_ppc64.h -------------------------------*- C++ -*-===//
+//===-- RegisterInfoCommon_ppc64.h -------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,16 +6,16 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOPOSIX_PPC64_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOPOSIX_PPC64_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOCOMMON_PPC64_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOCOMMON_PPC64_H
#include "RegisterInfoInterface.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/lldb-private.h"
-class RegisterInfoPOSIX_ppc64 : public lldb_private::RegisterInfoInterface {
+class RegisterInfoCommon_ppc64 : public lldb_private::RegisterInfoInterface {
public:
- RegisterInfoPOSIX_ppc64(const lldb_private::ArchSpec &target_arch);
+ RegisterInfoCommon_ppc64(const lldb_private::ArchSpec &target_arch);
size_t GetGPRSize() const override;
@@ -29,4 +29,4 @@ class RegisterInfoPOSIX_ppc64 : public lldb_private::RegisterInfoInterface {
size_t m_gpr_size;
};
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOPOSIX_PPC64_H
+#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOCOMMON_PPC64_H
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_ppc64le.cpp b/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_ppc64le.cpp
similarity index 78%
rename from lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_ppc64le.cpp
rename to lldb/source/Plugins/Process/Utility/RegisterInfoCommon_ppc64le.cpp
index 159fd2856443cc..1b558ce5039593 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_ppc64le.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_ppc64le.cpp
@@ -1,4 +1,4 @@
-//===-- RegisterInfoPOSIX_ppc64le.cpp -------------------------------------===//
+//===-- RegisterInfoCommon_ppc64le.cpp -------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -13,9 +13,9 @@
#include "lldb/lldb-defines.h"
#include "llvm/Support/Compiler.h"
-#include "RegisterInfoPOSIX_ppc64le.h"
+#include "RegisterInfoCommon_ppc64le.h"
-// Include RegisterInfoPOSIX_ppc64le to declare our g_register_infos_ppc64le
+// Include RegisterInfoCommon_ppc64le to declare our g_register_infos_ppc64le
#define DECLARE_REGISTER_INFOS_PPC64LE_STRUCT
#include "RegisterInfos_ppc64le.h"
#undef DECLARE_REGISTER_INFOS_PPC64LE_STRUCT
@@ -43,21 +43,21 @@ GetRegisterInfoCount(const lldb_private::ArchSpec &target_arch) {
}
}
-RegisterInfoPOSIX_ppc64le::RegisterInfoPOSIX_ppc64le(
+RegisterInfoCommon_ppc64le::RegisterInfoCommon_ppc64le(
const lldb_private::ArchSpec &target_arch)
: lldb_private::RegisterInfoInterface(target_arch),
m_register_info_p(GetRegisterInfoPtr(target_arch)),
m_register_info_count(GetRegisterInfoCount(target_arch)) {}
-size_t RegisterInfoPOSIX_ppc64le::GetGPRSize() const {
+size_t RegisterInfoCommon_ppc64le::GetGPRSize() const {
return sizeof(GPR);
}
const lldb_private::RegisterInfo *
-RegisterInfoPOSIX_ppc64le::GetRegisterInfo() const {
+RegisterInfoCommon_ppc64le::GetRegisterInfo() const {
return m_register_info_p;
}
-uint32_t RegisterInfoPOSIX_ppc64le::GetRegisterCount() const {
+uint32_t RegisterInfoCommon_ppc64le::GetRegisterCount() const {
return m_register_info_count;
}
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_ppc64le.h b/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_ppc64le.h
similarity index 63%
rename from lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_ppc64le.h
rename to lldb/source/Plugins/Process/Utility/RegisterInfoCommon_ppc64le.h
index 98549ac0dda404..aae01666a7951e 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_ppc64le.h
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_ppc64le.h
@@ -1,4 +1,4 @@
-//===-- RegisterInfoPOSIX_ppc64le.h -----------------------------*- C++ -*-===//
+//===-- RegisterInfoCommon_ppc64le.h -----------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,16 +6,16 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOPOSIX_PPC64LE_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOPOSIX_PPC64LE_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOCOMMON_PPC64LE_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOCOMMON_PPC64LE_H
#include "RegisterInfoInterface.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/lldb-private.h"
-class RegisterInfoPOSIX_ppc64le : public lldb_private::RegisterInfoInterface {
+class RegisterInfoCommon_ppc64le : public lldb_private::RegisterInfoInterface {
public:
- RegisterInfoPOSIX_ppc64le(const lldb_private::ArchSpec &target_arch);
+ RegisterInfoCommon_ppc64le(const lldb_private::ArchSpec &target_arch);
size_t GetGPRSize() const override;
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_riscv32.cpp b/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_riscv32.cpp
similarity index 80%
rename from lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_riscv32.cpp
rename to lldb/source/Plugins/Process/Utility/RegisterInfoCommon_riscv32.cpp
index e213b4a4a18200..69e302e87d1001 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_riscv32.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_riscv32.cpp
@@ -1,4 +1,4 @@
-//===-- RegisterInfoPOSIX_riscv32.cpp -------------------------------------===//
+//===-- RegisterInfoCommon_riscv32.cpp -------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,7 +6,7 @@
//
//===---------------------------------------------------------------------===//
-#include "RegisterInfoPOSIX_riscv32.h"
+#include "RegisterInfoCommon_riscv32.h"
#include "lldb/Utility/Flags.h"
#include "lldb/lldb-defines.h"
#include "llvm/Support/Compiler.h"
@@ -15,17 +15,17 @@
#include <stddef.h>
#define GPR_OFFSET(idx) ((idx) * 4 + 0)
-#define FPR_OFFSET(idx) ((idx) * 4 + sizeof(RegisterInfoPOSIX_riscv32::GPR))
+#define FPR_OFFSET(idx) ((idx) * 4 + sizeof(RegisterInfoCommon_riscv32::GPR))
#define REG_CONTEXT_SIZE \
- (sizeof(RegisterInfoPOSIX_riscv32::GPR) + \
- sizeof(RegisterInfoPOSIX_riscv32::FPR))
+ (sizeof(RegisterInfoCommon_riscv32::GPR) + \
+ sizeof(RegisterInfoCommon_riscv32::FPR))
#define DECLARE_REGISTER_INFOS_RISCV32_STRUCT
#include "RegisterInfos_riscv32.h"
#undef DECLARE_REGISTER_INFOS_RISCV32_STRUCT
-const lldb_private::RegisterInfo *RegisterInfoPOSIX_riscv32::GetRegisterInfoPtr(
+const lldb_private::RegisterInfo *RegisterInfoCommon_riscv32::GetRegisterInfoPtr(
const lldb_private::ArchSpec &target_arch) {
switch (target_arch.GetMachine()) {
case llvm::Triple::riscv32:
@@ -36,7 +36,7 @@ const lldb_private::RegisterInfo *RegisterInfoPOSIX_riscv32::GetRegisterInfoPtr(
}
}
-uint32_t RegisterInfoPOSIX_riscv32::GetRegisterInfoCount(
+uint32_t RegisterInfoCommon_riscv32::GetRegisterInfoCount(
const lldb_private::ArchSpec &target_arch) {
switch (target_arch.GetMachine()) {
case llvm::Triple::riscv32:
@@ -96,35 +96,35 @@ static const lldb_private::RegisterSet g_reg_sets_riscv32[k_num_register_sets] =
{"Floating Point Registers", "fpr", k_num_fpr_registers,
g_fpr_regnums_riscv32}};
-RegisterInfoPOSIX_riscv32::RegisterInfoPOSIX_riscv32(
+RegisterInfoCommon_riscv32::RegisterInfoCommon_riscv32(
const lldb_private::ArchSpec &target_arch, lldb_private::Flags opt_regsets)
: lldb_private::RegisterInfoAndSetInterface(target_arch),
m_register_info_p(GetRegisterInfoPtr(target_arch)),
m_register_info_count(GetRegisterInfoCount(target_arch)),
m_opt_regsets(opt_regsets) {}
-uint32_t RegisterInfoPOSIX_riscv32::GetRegisterCount() const {
+uint32_t RegisterInfoCommon_riscv32::GetRegisterCount() const {
return m_register_info_count;
}
-size_t RegisterInfoPOSIX_riscv32::GetGPRSize() const {
- return sizeof(struct RegisterInfoPOSIX_riscv32::GPR);
+size_t RegisterInfoCommon_riscv32::GetGPRSize() const {
+ return sizeof(struct RegisterInfoCommon_riscv32::GPR);
}
-size_t RegisterInfoPOSIX_riscv32::GetFPRSize() const {
- return sizeof(struct RegisterInfoPOSIX_riscv32::FPR);
+size_t RegisterInfoCommon_riscv32::GetFPRSize() const {
+ return sizeof(struct RegisterInfoCommon_riscv32::FPR);
}
const lldb_private::RegisterInfo *
-RegisterInfoPOSIX_riscv32::GetRegisterInfo() const {
+RegisterInfoCommon_riscv32::GetRegisterInfo() const {
return m_register_info_p;
}
-size_t RegisterInfoPOSIX_riscv32::GetRegisterSetCount() const {
+size_t RegisterInfoCommon_riscv32::GetRegisterSetCount() const {
return k_num_register_sets;
}
-size_t RegisterInfoPOSIX_riscv32::GetRegisterSetFromRegisterIndex(
+size_t RegisterInfoCommon_riscv32::GetRegisterSetFromRegisterIndex(
uint32_t reg_index) const {
// coverity[unsigned_compare]
if (reg_index >= gpr_first_riscv && reg_index <= gpr_last_riscv)
@@ -135,7 +135,7 @@ size_t RegisterInfoPOSIX_riscv32::GetRegisterSetFromRegisterIndex(
}
const lldb_private::RegisterSet *
-RegisterInfoPOSIX_riscv32::GetRegisterSet(size_t set_index) const {
+RegisterInfoCommon_riscv32::GetRegisterSet(size_t set_index) const {
if (set_index < GetRegisterSetCount())
return &g_reg_sets_riscv32[set_index];
return nullptr;
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_riscv32.h b/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_riscv32.h
similarity index 83%
rename from lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_riscv32.h
rename to lldb/source/Plugins/Process/Utility/RegisterInfoCommon_riscv32.h
index a2648d6f2faec2..bcdec7767ee4d6 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_riscv32.h
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_riscv32.h
@@ -1,4 +1,4 @@
-//===-- RegisterInfoPOSIX_riscv32.h -----------------------------*- C++ -*-===//
+//===-- RegisterInfoCommon_riscv32.h -----------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOPOSIX_RISCV32_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOPOSIX_RISCV32_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOCOMMON_RISCV32_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOCOMMON_RISCV32_H
#include "RegisterInfoAndSetInterface.h"
#include "lldb/Target/RegisterContext.h"
@@ -16,7 +16,7 @@
#include <map>
-class RegisterInfoPOSIX_riscv32
+class RegisterInfoCommon_riscv32
: public lldb_private::RegisterInfoAndSetInterface {
public:
static const lldb_private::RegisterInfo *
@@ -42,7 +42,7 @@ class RegisterInfoPOSIX_riscv32
uint32_t fcsr;
};
- RegisterInfoPOSIX_riscv32(const lldb_private::ArchSpec &target_arch,
+ RegisterInfoCommon_riscv32(const lldb_private::ArchSpec &target_arch,
lldb_private::Flags flags);
size_t GetGPRSize() const override;
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_riscv64.cpp b/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_riscv64.cpp
similarity index 82%
rename from lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_riscv64.cpp
rename to lldb/source/Plugins/Process/Utility/RegisterInfoCommon_riscv64.cpp
index a0be54fc76cd53..f2490817e2a1de 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_riscv64.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_riscv64.cpp
@@ -1,4 +1,4 @@
-//===-- RegisterInfoPOSIX_riscv64.cpp -------------------------------------===//
+//===-- RegisterInfoCommon_riscv64.cpp -------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,7 +6,7 @@
//
//===---------------------------------------------------------------------===//
-#include "RegisterInfoPOSIX_riscv64.h"
+#include "RegisterInfoCommon_riscv64.h"
#include "lldb/Utility/Flags.h"
#include "lldb/lldb-defines.h"
#include "llvm/Support/Compiler.h"
@@ -15,7 +15,7 @@
#include <stddef.h>
#define GPR_OFFSET(idx) ((idx)*8 + 0)
-#define FPR_OFFSET(idx) ((idx)*8 + sizeof(RegisterInfoPOSIX_riscv64::GPR))
+#define FPR_OFFSET(idx) ((idx)*8 + sizeof(RegisterInfoCommon_riscv64::GPR))
#define DECLARE_REGISTER_INFOS_RISCV64_STRUCT
#include "RegisterInfos_riscv64.h"
@@ -52,7 +52,7 @@ static const lldb_private::RegisterSet g_reg_set_gpr_riscv64 = {
static const lldb_private::RegisterSet g_reg_set_fpr_riscv64 = {
"Floating Point Registers", "fpr", k_num_fpr_registers, nullptr};
-RegisterInfoPOSIX_riscv64::RegisterInfoPOSIX_riscv64(
+RegisterInfoCommon_riscv64::RegisterInfoCommon_riscv64(
const lldb_private::ArchSpec &target_arch, lldb_private::Flags opt_regsets)
: lldb_private::RegisterInfoAndSetInterface(target_arch),
m_opt_regsets(opt_regsets) {
@@ -72,7 +72,7 @@ RegisterInfoPOSIX_riscv64::RegisterInfoPOSIX_riscv64(
}
}
-void RegisterInfoPOSIX_riscv64::AddRegSetGP() {
+void RegisterInfoCommon_riscv64::AddRegSetGP() {
m_register_infos.resize(k_num_gpr_registers);
memcpy(&m_register_infos[0], g_register_infos_riscv64_gpr,
sizeof(g_register_infos_riscv64_gpr));
@@ -82,7 +82,7 @@ void RegisterInfoPOSIX_riscv64::AddRegSetGP() {
std::make_pair(gpr_first_riscv, m_register_infos.size());
}
-void RegisterInfoPOSIX_riscv64::AddRegSetFP() {
+void RegisterInfoCommon_riscv64::AddRegSetFP() {
const uint32_t register_info_count = m_register_infos.size();
const uint32_t register_set_count = m_register_sets.size();
@@ -106,28 +106,28 @@ void RegisterInfoPOSIX_riscv64::AddRegSetFP() {
std::make_pair(register_info_count, m_register_infos.size());
}
-uint32_t RegisterInfoPOSIX_riscv64::GetRegisterCount() const {
+uint32_t RegisterInfoCommon_riscv64::GetRegisterCount() const {
return m_register_infos.size();
}
-size_t RegisterInfoPOSIX_riscv64::GetGPRSize() const {
- return sizeof(struct RegisterInfoPOSIX_riscv64::GPR);
+size_t RegisterInfoCommon_riscv64::GetGPRSize() const {
+ return sizeof(struct RegisterInfoCommon_riscv64::GPR);
}
-size_t RegisterInfoPOSIX_riscv64::GetFPRSize() const {
- return sizeof(struct RegisterInfoPOSIX_riscv64::FPR);
+size_t RegisterInfoCommon_riscv64::GetFPRSize() const {
+ return sizeof(struct RegisterInfoCommon_riscv64::FPR);
}
const lldb_private::RegisterInfo *
-RegisterInfoPOSIX_riscv64::GetRegisterInfo() const {
+RegisterInfoCommon_riscv64::GetRegisterInfo() const {
return m_register_infos.data();
}
-size_t RegisterInfoPOSIX_riscv64::GetRegisterSetCount() const {
+size_t RegisterInfoCommon_riscv64::GetRegisterSetCount() const {
return m_register_sets.size();
}
-size_t RegisterInfoPOSIX_riscv64::GetRegisterSetFromRegisterIndex(
+size_t RegisterInfoCommon_riscv64::GetRegisterSetFromRegisterIndex(
uint32_t reg_index) const {
for (const auto ®set_range : m_per_regset_regnum_range) {
if (reg_index >= regset_range.second.first &&
@@ -137,12 +137,12 @@ size_t RegisterInfoPOSIX_riscv64::GetRegisterSetFromRegisterIndex(
return LLDB_INVALID_REGNUM;
}
-bool RegisterInfoPOSIX_riscv64::IsFPReg(unsigned reg) const {
+bool RegisterInfoCommon_riscv64::IsFPReg(unsigned reg) const {
return llvm::is_contained(m_fp_regnum_collection, reg);
}
const lldb_private::RegisterSet *
-RegisterInfoPOSIX_riscv64::GetRegisterSet(size_t set_index) const {
+RegisterInfoCommon_riscv64::GetRegisterSet(size_t set_index) const {
if (set_index < GetRegisterSetCount())
return &m_register_sets[set_index];
return nullptr;
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_riscv64.h b/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_riscv64.h
similarity index 85%
rename from lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_riscv64.h
rename to lldb/source/Plugins/Process/Utility/RegisterInfoCommon_riscv64.h
index f8e22c7df3c88f..72d051fee3916a 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_riscv64.h
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_riscv64.h
@@ -1,4 +1,4 @@
-//===-- RegisterInfoPOSIX_riscv64.h -----------------------------*- C++ -*-===//
+//===-- RegisterInfoCommon_riscv64.h -----------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOPOSIX_RISCV64_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOPOSIX_RISCV64_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOCOMMON_RISCV64_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOCOMMON_RISCV64_H
#include "RegisterInfoAndSetInterface.h"
#include "lldb/Target/RegisterContext.h"
@@ -15,7 +15,7 @@
#include "lldb/lldb-private.h"
#include <map>
-class RegisterInfoPOSIX_riscv64
+class RegisterInfoCommon_riscv64
: public lldb_private::RegisterInfoAndSetInterface {
public:
enum { GPRegSet = 0 };
@@ -42,7 +42,7 @@ class RegisterInfoPOSIX_riscv64
void *vpr;
};
- RegisterInfoPOSIX_riscv64(const lldb_private::ArchSpec &target_arch,
+ RegisterInfoCommon_riscv64(const lldb_private::ArchSpec &target_arch,
lldb_private::Flags opt_regsets);
void AddRegSetGP();
diff --git a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm.cpp b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm.cpp
index fd8a0c05c1b25c..f4f52f7193bf12 100644
--- a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm.cpp
+++ b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm.cpp
@@ -10,7 +10,7 @@
#include "NativeRegisterContextWindows_arm.h"
#include "NativeThreadWindows.h"
-#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm.h"
+#include "Plugins/Process/Utility/RegisterInfoCommon_arm.h"
#include "ProcessWindowsLog.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Host/HostThread.h"
@@ -82,7 +82,7 @@ static RegisterInfoInterface *
CreateRegisterInfoInterface(const ArchSpec &target_arch) {
assert((HostInfo::GetArchitecture().GetAddressByteSize() == 4) &&
"Register setting path assumes this is a 32-bit host");
- return new RegisterInfoPOSIX_arm(target_arch);
+ return new RegisterInfoCommon_arm(target_arch);
}
static Status GetThreadContextHelper(lldb::thread_t thread_handle,
diff --git a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm64.cpp b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm64.cpp
index 2a09c42531074b..af6307757dc4a1 100644
--- a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm64.cpp
+++ b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm64.cpp
@@ -97,8 +97,8 @@ static RegisterInfoInterface *
CreateRegisterInfoInterface(const ArchSpec &target_arch) {
assert((HostInfo::GetArchitecture().GetAddressByteSize() == 8) &&
"Register setting path assumes this is a 64-bit host");
- return new RegisterInfoPOSIX_arm64(
- target_arch, RegisterInfoPOSIX_arm64::eRegsetMaskDefault);
+ return new RegisterInfoCommon_arm64(
+ target_arch, RegisterInfoCommon_arm64::eRegsetMaskDefault);
}
static Status GetThreadContextLength(DWORD context_flags,
diff --git a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm64.h b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm64.h
index 4cfb3bf13c91bb..ec9e3e74ad3cf1 100644
--- a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm64.h
+++ b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm64.h
@@ -13,7 +13,7 @@
#include "NativeRegisterContextWindows.h"
#include "Plugins/Process/Utility/NativeRegisterContextDBReg_arm64.h"
-#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h"
+#include "Plugins/Process/Utility/RegisterInfoCommon_arm64.h"
#include "Plugins/Process/Utility/lldb-arm64-register-enums.h"
#include "lldb/Host/windows/windows.h"
diff --git a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm.cpp b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm.cpp
index c9e90ebf8a4ddf..d64fa9a567c852 100644
--- a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm.cpp
+++ b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm.cpp
@@ -16,7 +16,7 @@
using namespace lldb_private;
RegisterContextCorePOSIX_arm::RegisterContextCorePOSIX_arm(
- Thread &thread, std::unique_ptr<RegisterInfoPOSIX_arm> register_info,
+ Thread &thread, std::unique_ptr<RegisterInfoCommon_arm> register_info,
const DataExtractor &gpregset, llvm::ArrayRef<CoreNote> notes)
: RegisterContextPOSIX_arm(thread, std::move(register_info)) {
m_gpr_buffer = std::make_shared<DataBufferHeap>(gpregset.GetDataStart(),
diff --git a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm.h b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm.h
index e466ee242181bc..3b41cbc24d5547 100644
--- a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm.h
+++ b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm.h
@@ -18,7 +18,7 @@ class RegisterContextCorePOSIX_arm : public RegisterContextPOSIX_arm {
public:
RegisterContextCorePOSIX_arm(
lldb_private::Thread &thread,
- std::unique_ptr<RegisterInfoPOSIX_arm> register_info,
+ std::unique_ptr<RegisterInfoCommon_arm> register_info,
const lldb_private::DataExtractor &gpregset,
llvm::ArrayRef<lldb_private::CoreNote> notes);
diff --git a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.cpp b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.cpp
index 837cb30798fe19..f910f62fb92a03 100644
--- a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.cpp
+++ b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.cpp
@@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//
#include "RegisterContextPOSIXCore_arm64.h"
-#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h"
+#include "Plugins/Process/Utility/RegisterInfoCommon_arm64.h"
#include "Plugins/Process/Utility/AuxVector.h"
#include "Plugins/Process/Utility/RegisterTypeDetector_arm64.h"
@@ -24,50 +24,50 @@ std::unique_ptr<RegisterContextCorePOSIX_arm64>
RegisterContextCorePOSIX_arm64::Create(Thread &thread, const ArchSpec &arch,
const DataExtractor &gpregset,
llvm::ArrayRef<CoreNote> notes) {
- Flags opt_regsets = RegisterInfoPOSIX_arm64::eRegsetMaskDefault;
+ Flags opt_regsets = RegisterInfoCommon_arm64::eRegsetMaskDefault;
DataExtractor ssve_data =
getRegset(notes, arch.GetTriple(), AARCH64_SSVE_Desc);
if (ssve_data.GetByteSize() >= sizeof(sve::user_sve_header))
- opt_regsets.Set(RegisterInfoPOSIX_arm64::eRegsetMaskSSVE);
+ opt_regsets.Set(RegisterInfoCommon_arm64::eRegsetMaskSSVE);
DataExtractor sve_data = getRegset(notes, arch.GetTriple(), AARCH64_SVE_Desc);
if (sve_data.GetByteSize() >= sizeof(sve::user_sve_header))
- opt_regsets.Set(RegisterInfoPOSIX_arm64::eRegsetMaskSVE);
+ opt_regsets.Set(RegisterInfoCommon_arm64::eRegsetMaskSVE);
// Pointer Authentication register set data is based on struct
// user_pac_mask declared in ptrace.h. See reference implementation
// in Linux kernel source at arch/arm64/include/uapi/asm/ptrace.h.
DataExtractor pac_data = getRegset(notes, arch.GetTriple(), AARCH64_PAC_Desc);
if (pac_data.GetByteSize() >= sizeof(uint64_t) * 2)
- opt_regsets.Set(RegisterInfoPOSIX_arm64::eRegsetMaskPAuth);
+ opt_regsets.Set(RegisterInfoCommon_arm64::eRegsetMaskPAuth);
DataExtractor tls_data = getRegset(notes, arch.GetTriple(), AARCH64_TLS_Desc);
// A valid note will always contain at least one register, "tpidr". It may
// expand in future.
if (tls_data.GetByteSize() >= sizeof(uint64_t))
- opt_regsets.Set(RegisterInfoPOSIX_arm64::eRegsetMaskTLS);
+ opt_regsets.Set(RegisterInfoCommon_arm64::eRegsetMaskTLS);
DataExtractor za_data = getRegset(notes, arch.GetTriple(), AARCH64_ZA_Desc);
// Nothing if ZA is not present, just the header if it is disabled.
if (za_data.GetByteSize() >= sizeof(sve::user_za_header))
- opt_regsets.Set(RegisterInfoPOSIX_arm64::eRegsetMaskZA);
+ opt_regsets.Set(RegisterInfoCommon_arm64::eRegsetMaskZA);
DataExtractor mte_data = getRegset(notes, arch.GetTriple(), AARCH64_MTE_Desc);
if (mte_data.GetByteSize() >= sizeof(uint64_t))
- opt_regsets.Set(RegisterInfoPOSIX_arm64::eRegsetMaskMTE);
+ opt_regsets.Set(RegisterInfoCommon_arm64::eRegsetMaskMTE);
DataExtractor zt_data = getRegset(notes, arch.GetTriple(), AARCH64_ZT_Desc);
// Although ZT0 can be in a disabled state like ZA can, the kernel reports
// its content as 0s in that state. Therefore even a disabled ZT0 will have
// a note containing those 0s. ZT0 is a 512 bit / 64 byte register.
if (zt_data.GetByteSize() >= 64)
- opt_regsets.Set(RegisterInfoPOSIX_arm64::eRegsetMaskZT);
+ opt_regsets.Set(RegisterInfoCommon_arm64::eRegsetMaskZT);
DataExtractor fpmr_data =
getRegset(notes, arch.GetTriple(), AARCH64_FPMR_Desc);
if (fpmr_data.GetByteSize() >= sizeof(uint64_t))
- opt_regsets.Set(RegisterInfoPOSIX_arm64::eRegsetMaskFPMR);
+ opt_regsets.Set(RegisterInfoCommon_arm64::eRegsetMaskFPMR);
DataExtractor gcs_data = getRegset(notes, arch.GetTriple(), AARCH64_GCS_Desc);
struct __attribute__((packed)) gcs_regs {
@@ -76,24 +76,24 @@ RegisterContextCorePOSIX_arm64::Create(Thread &thread, const ArchSpec &arch,
uint64_t gcspr_e0;
};
if (gcs_data.GetByteSize() >= sizeof(gcs_regs))
- opt_regsets.Set(RegisterInfoPOSIX_arm64::eRegsetMaskGCS);
+ opt_regsets.Set(RegisterInfoCommon_arm64::eRegsetMaskGCS);
DataExtractor poe_data = getRegset(notes, arch.GetTriple(), AARCH64_POE_Desc);
struct poe_regs {
uint64_t por_el0_reg;
};
if (poe_data.GetByteSize() >= sizeof(poe_regs))
- opt_regsets.Set(RegisterInfoPOSIX_arm64::eRegsetMaskPOE);
+ opt_regsets.Set(RegisterInfoCommon_arm64::eRegsetMaskPOE);
auto register_info_up =
- std::make_unique<RegisterInfoPOSIX_arm64>(arch, opt_regsets);
+ std::make_unique<RegisterInfoCommon_arm64>(arch, opt_regsets);
return std::unique_ptr<RegisterContextCorePOSIX_arm64>(
new RegisterContextCorePOSIX_arm64(thread, std::move(register_info_up),
gpregset, notes));
}
RegisterContextCorePOSIX_arm64::RegisterContextCorePOSIX_arm64(
- Thread &thread, std::unique_ptr<RegisterInfoPOSIX_arm64> register_info,
+ Thread &thread, std::unique_ptr<RegisterInfoCommon_arm64> register_info,
const DataExtractor &gpregset, llvm::ArrayRef<CoreNote> notes)
: RegisterContextPOSIX_arm64(thread, std::move(register_info)) {
::memset(&m_sme_pseudo_regs, 0, sizeof(m_sme_pseudo_regs));
diff --git a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.h b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.h
index 9d9a2da2bc1b99..2499556e203d4d 100644
--- a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.h
+++ b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.h
@@ -41,7 +41,7 @@ class RegisterContextCorePOSIX_arm64 : public RegisterContextPOSIX_arm64 {
protected:
RegisterContextCorePOSIX_arm64(
lldb_private::Thread &thread,
- std::unique_ptr<RegisterInfoPOSIX_arm64> register_info,
+ std::unique_ptr<RegisterInfoCommon_arm64> register_info,
const lldb_private::DataExtractor &gpregset,
llvm::ArrayRef<lldb_private::CoreNote> notes);
diff --git a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_loongarch64.cpp b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_loongarch64.cpp
index f0500948a6ab22..9b0dc0984f5f60 100644
--- a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_loongarch64.cpp
+++ b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_loongarch64.cpp
@@ -20,13 +20,13 @@ RegisterContextCorePOSIX_loongarch64::Create(Thread &thread,
return std::unique_ptr<RegisterContextCorePOSIX_loongarch64>(
new RegisterContextCorePOSIX_loongarch64(
thread,
- std::make_unique<RegisterInfoPOSIX_loongarch64>(arch, Flags()),
+ std::make_unique<RegisterInfoCommon_loongarch64>(arch, Flags()),
gpregset, notes));
}
RegisterContextCorePOSIX_loongarch64::RegisterContextCorePOSIX_loongarch64(
Thread &thread,
- std::unique_ptr<RegisterInfoPOSIX_loongarch64> register_info,
+ std::unique_ptr<RegisterInfoCommon_loongarch64> register_info,
const DataExtractor &gpregset, llvm::ArrayRef<CoreNote> notes)
: RegisterContextPOSIX_loongarch64(thread, std::move(register_info)) {
diff --git a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_loongarch64.h b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_loongarch64.h
index 7bb53bd642030a..63b97551bbbeed 100644
--- a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_loongarch64.h
+++ b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_loongarch64.h
@@ -10,7 +10,7 @@
#define LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTPOSIXCORE_LOONGARCH64_H
#include "Plugins/Process/Utility/RegisterContextPOSIX_loongarch64.h"
-#include "Plugins/Process/Utility/RegisterInfoPOSIX_loongarch64.h"
+#include "Plugins/Process/Utility/RegisterInfoCommon_loongarch64.h"
#include "Plugins/Process/elf-core/RegisterUtilities.h"
#include "lldb/Target/Thread.h"
@@ -38,7 +38,7 @@ class RegisterContextCorePOSIX_loongarch64
protected:
RegisterContextCorePOSIX_loongarch64(
lldb_private::Thread &thread,
- std::unique_ptr<RegisterInfoPOSIX_loongarch64> register_info,
+ std::unique_ptr<RegisterInfoCommon_loongarch64> register_info,
const lldb_private::DataExtractor &gpregset,
llvm::ArrayRef<lldb_private::CoreNote> notes);
diff --git a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_riscv32.cpp b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_riscv32.cpp
index 9718e1b0fe1a99..a52d99c2791ab6 100644
--- a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_riscv32.cpp
+++ b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_riscv32.cpp
@@ -42,13 +42,13 @@ RegisterContextCorePOSIX_riscv32::Create(Thread &thread, const ArchSpec &arch,
llvm::ArrayRef<CoreNote> notes) {
return std::unique_ptr<RegisterContextCorePOSIX_riscv32>(
new RegisterContextCorePOSIX_riscv32(
- thread, std::make_unique<RegisterInfoPOSIXDynamic_riscv32>(arch),
+ thread, std::make_unique<RegisterInfoCommonDynamic_riscv32>(arch),
gpregset, notes));
}
RegisterContextCorePOSIX_riscv32::RegisterContextCorePOSIX_riscv32(
Thread &thread,
- std::unique_ptr<RegisterInfoPOSIXDynamic_riscv32> register_info,
+ std::unique_ptr<RegisterInfoCommonDynamic_riscv32> register_info,
const DataExtractor &gpregset, llvm::ArrayRef<CoreNote> notes)
: RegisterContext(thread, 0), m_reg_infos_up(std::move(register_info)) {
// Compute the maximum register counts for GPR, FPR, and CSR.
diff --git a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_riscv32.h b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_riscv32.h
index 40407982145b9c..6f154bcfbceb99 100644
--- a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_riscv32.h
+++ b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_riscv32.h
@@ -9,7 +9,7 @@
#ifndef LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTPOSIXCORE_RISCV32_H
#define LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTPOSIXCORE_RISCV32_H
-#include "Plugins/Process/Utility/RegisterInfoPOSIXDynamic_riscv32.h"
+#include "Plugins/Process/Utility/RegisterInfoCommonDynamic_riscv32.h"
#include "Plugins/Process/elf-core/RegisterUtilities.h"
#include "lldb/Target/Thread.h"
#include "lldb/Utility/DataExtractor.h"
@@ -51,7 +51,7 @@ class RegisterContextCorePOSIX_riscv32 : public lldb_private::RegisterContext {
protected:
RegisterContextCorePOSIX_riscv32(
lldb_private::Thread &thread,
- std::unique_ptr<RegisterInfoPOSIXDynamic_riscv32> register_info,
+ std::unique_ptr<RegisterInfoCommonDynamic_riscv32> register_info,
const lldb_private::DataExtractor &gpregset,
llvm::ArrayRef<lldb_private::CoreNote> notes);
@@ -71,7 +71,7 @@ class RegisterContextCorePOSIX_riscv32 : public lldb_private::RegisterContext {
void GetFeatures(llvm::SmallVectorImpl<std::string> &features) const;
private:
- std::unique_ptr<RegisterInfoPOSIXDynamic_riscv32> m_reg_infos_up;
+ std::unique_ptr<RegisterInfoCommonDynamic_riscv32> m_reg_infos_up;
lldb_private::DataExtractor m_gpregset;
lldb_private::DataExtractor m_fpregset;
lldb_private::DataExtractor m_csregset;
diff --git a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_riscv64.cpp b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_riscv64.cpp
index 3dca4b16099056..6e4e6451297488 100644
--- a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_riscv64.cpp
+++ b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_riscv64.cpp
@@ -16,22 +16,22 @@ std::unique_ptr<RegisterContextCorePOSIX_riscv64>
RegisterContextCorePOSIX_riscv64::Create(Thread &thread, const ArchSpec &arch,
const DataExtractor &gpregset,
llvm::ArrayRef<CoreNote> notes) {
- Flags opt_regsets = RegisterInfoPOSIX_riscv64::eRegsetMaskDefault;
+ Flags opt_regsets = RegisterInfoCommon_riscv64::eRegsetMaskDefault;
DataExtractor fpregset = getRegset(notes, arch.GetTriple(), FPR_Desc);
if (fpregset.GetByteSize() >= sizeof(uint64_t)) {
- opt_regsets.Set(RegisterInfoPOSIX_riscv64::eRegsetMaskFP);
+ opt_regsets.Set(RegisterInfoCommon_riscv64::eRegsetMaskFP);
}
return std::unique_ptr<RegisterContextCorePOSIX_riscv64>(
new RegisterContextCorePOSIX_riscv64(
thread,
- std::make_unique<RegisterInfoPOSIX_riscv64>(arch, opt_regsets),
+ std::make_unique<RegisterInfoCommon_riscv64>(arch, opt_regsets),
gpregset, notes));
}
RegisterContextCorePOSIX_riscv64::RegisterContextCorePOSIX_riscv64(
- Thread &thread, std::unique_ptr<RegisterInfoPOSIX_riscv64> register_info,
+ Thread &thread, std::unique_ptr<RegisterInfoCommon_riscv64> register_info,
const DataExtractor &gpregset, llvm::ArrayRef<CoreNote> notes)
: RegisterContextPOSIX_riscv64(thread, std::move(register_info)) {
diff --git a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_riscv64.h b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_riscv64.h
index a9a59844635749..9a0153d78d867f 100644
--- a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_riscv64.h
+++ b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_riscv64.h
@@ -10,7 +10,7 @@
#define LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTPOSIXCORE_RISCV64_H
#include "Plugins/Process/Utility/RegisterContextPOSIX_riscv64.h"
-#include "Plugins/Process/Utility/RegisterInfoPOSIX_riscv64.h"
+#include "Plugins/Process/Utility/RegisterInfoCommon_riscv64.h"
#include "Plugins/Process/elf-core/RegisterUtilities.h"
#include "lldb/Target/Thread.h"
@@ -37,7 +37,7 @@ class RegisterContextCorePOSIX_riscv64 : public RegisterContextPOSIX_riscv64 {
protected:
RegisterContextCorePOSIX_riscv64(
lldb_private::Thread &thread,
- std::unique_ptr<RegisterInfoPOSIX_riscv64> register_info,
+ std::unique_ptr<RegisterInfoCommon_riscv64> register_info,
const lldb_private::DataExtractor &gpregset,
llvm::ArrayRef<lldb_private::CoreNote> notes);
diff --git a/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp b/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp
index 25f9a6a164d26f..f024211abc2b6d 100644
--- a/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp
+++ b/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp
@@ -26,9 +26,9 @@
#include "Plugins/Process/Utility/RegisterInfoNetBSD_x86_64.h"
#include "Plugins/Process/Utility/RegisterInfoOpenBSD_i386.h"
#include "Plugins/Process/Utility/RegisterInfoOpenBSD_x86_64.h"
-#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm.h"
-#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h"
-#include "Plugins/Process/Utility/RegisterInfoPOSIX_ppc64le.h"
+#include "Plugins/Process/Utility/RegisterInfoCommon_arm.h"
+#include "Plugins/Process/Utility/RegisterInfoCommon_arm64.h"
+#include "Plugins/Process/Utility/RegisterInfoCommon_ppc64le.h"
#include "ProcessElfCore.h"
#include "RegisterContextLinuxCore_x86.h"
#include "RegisterContextPOSIXCore_arm.h"
@@ -131,7 +131,7 @@ ThreadElfCore::CreateRegisterContextForFrame(StackFrame *frame) {
case llvm::Triple::aarch64:
break;
case llvm::Triple::ppc64le:
- reg_interface = new RegisterInfoPOSIX_ppc64le(arch);
+ reg_interface = new RegisterInfoCommon_ppc64le(arch);
break;
case llvm::Triple::systemz:
reg_interface = new RegisterInfoLinux_s390x(arch);
@@ -185,7 +185,7 @@ ThreadElfCore::CreateRegisterContextForFrame(StackFrame *frame) {
break;
case llvm::Triple::arm:
m_thread_reg_ctx_sp = std::make_shared<RegisterContextCorePOSIX_arm>(
- *this, std::make_unique<RegisterInfoPOSIX_arm>(arch), m_gpregset_data,
+ *this, std::make_unique<RegisterInfoCommon_arm>(arch), m_gpregset_data,
m_notes);
break;
case llvm::Triple::loongarch64:
diff --git a/lldb/unittests/Instruction/ARM64/TestAArch64Emulator.cpp b/lldb/unittests/Instruction/ARM64/TestAArch64Emulator.cpp
index c6bfe0fa687599..1ad9ec8f88f929 100644
--- a/lldb/unittests/Instruction/ARM64/TestAArch64Emulator.cpp
+++ b/lldb/unittests/Instruction/ARM64/TestAArch64Emulator.cpp
@@ -16,14 +16,14 @@
#include "lldb/Utility/RegisterValue.h"
#include "Plugins/Instruction/ARM64/EmulateInstructionARM64.h"
-#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h"
+#include "Plugins/Process/Utility/RegisterInfoCommon_arm64.h"
#include "Plugins/Process/Utility/lldb-arm64-register-enums.h"
using namespace lldb;
using namespace lldb_private;
struct Arch64EmulatorTester : public EmulateInstructionARM64 {
- RegisterInfoPOSIX_arm64::GPR gpr;
+ RegisterInfoCommon_arm64::GPR gpr;
uint8_t memory[64] = {0};
uint64_t memory_offset = 0;
diff --git a/lldb/unittests/Instruction/LoongArch/TestLoongArchEmulator.cpp b/lldb/unittests/Instruction/LoongArch/TestLoongArchEmulator.cpp
index f3b0d65c2cbfe0..c53b0bde52a090 100644
--- a/lldb/unittests/Instruction/LoongArch/TestLoongArchEmulator.cpp
+++ b/lldb/unittests/Instruction/LoongArch/TestLoongArchEmulator.cpp
@@ -15,7 +15,7 @@
#include "gtest/gtest.h"
#include "Plugins/Instruction/LoongArch/EmulateInstructionLoongArch.h"
-#include "Plugins/Process/Utility/RegisterInfoPOSIX_loongarch64.h"
+#include "Plugins/Process/Utility/RegisterInfoCommon_loongarch64.h"
#include "Plugins/Process/Utility/lldb-loongarch-register-enums.h"
using namespace llvm;
@@ -48,8 +48,8 @@ using namespace lldb_private;
struct LoongArch64EmulatorTester : public EmulateInstructionLoongArch,
testing::Test {
- RegisterInfoPOSIX_loongarch64::GPR gpr;
- RegisterInfoPOSIX_loongarch64::FPR fpr;
+ RegisterInfoCommon_loongarch64::GPR gpr;
+ RegisterInfoCommon_loongarch64::FPR fpr;
LoongArch64EmulatorTester(
std::string triple = "loongarch64-unknown-linux-gnu")
diff --git a/lldb/unittests/Instruction/RISCV/TestRISCVEmulator.cpp b/lldb/unittests/Instruction/RISCV/TestRISCVEmulator.cpp
index f713755c77a7c7..ebc80a3dd45d52 100644
--- a/lldb/unittests/Instruction/RISCV/TestRISCVEmulator.cpp
+++ b/lldb/unittests/Instruction/RISCV/TestRISCVEmulator.cpp
@@ -16,8 +16,8 @@
#include "lldb/Utility/RegisterValue.h"
#include "Plugins/Instruction/RISCV/EmulateInstructionRISCV.h"
-#include "Plugins/Process/Utility/RegisterInfoPOSIX_riscv32.h"
-#include "Plugins/Process/Utility/RegisterInfoPOSIX_riscv64.h"
+#include "Plugins/Process/Utility/RegisterInfoCommon_riscv32.h"
+#include "Plugins/Process/Utility/RegisterInfoCommon_riscv64.h"
#include "Plugins/Process/Utility/lldb-riscv-register-enums.h"
using namespace llvm;
@@ -25,8 +25,8 @@ using namespace lldb;
using namespace lldb_private;
struct RISCVEmulatorTester : public EmulateInstructionRISCV, testing::Test {
- RegisterInfoPOSIX_riscv64::GPR gpr;
- RegisterInfoPOSIX_riscv64::FPR fpr;
+ RegisterInfoCommon_riscv64::GPR gpr;
+ RegisterInfoCommon_riscv64::FPR fpr;
uint8_t memory[1024] = {0};
RISCVEmulatorTester(std::string triple = "riscv64-unknown-linux-gnu")
diff --git a/lldb/unittests/Process/Utility/RegisterInfoFreeBSDTest.cpp b/lldb/unittests/Process/Utility/RegisterInfoFreeBSDTest.cpp
index e14307dad4a480..f8be5f7262aa45 100644
--- a/lldb/unittests/Process/Utility/RegisterInfoFreeBSDTest.cpp
+++ b/lldb/unittests/Process/Utility/RegisterInfoFreeBSDTest.cpp
@@ -21,8 +21,8 @@
#include "Plugins/Process/Utility/RegisterInfoFreeBSD_powerpc.h"
#include "Plugins/Process/Utility/RegisterInfoFreeBSD_x86_64.h"
#include "Plugins/Process/Utility/RegisterContextPOSIX_powerpc.h"
-#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm.h"
-#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h"
+#include "Plugins/Process/Utility/RegisterInfoCommon_arm.h"
+#include "Plugins/Process/Utility/RegisterInfoCommon_arm64.h"
#include "Plugins/Process/Utility/lldb-arm-register-enums.h"
#include "Plugins/Process/Utility/lldb-arm64-register-enums.h"
#include "Plugins/Process/Utility/lldb-x86-register-enums.h"
@@ -253,7 +253,7 @@ TEST(RegisterInfoFreeBSDTest, i386) {
TEST(RegisterInfoFreeBSDTest, arm) {
ArchSpec arch{"arm-unknown-freebsd"};
- RegisterInfoPOSIX_arm reg_ctx{arch};
+ RegisterInfoCommon_arm reg_ctx{arch};
EXPECT_GPR_ARM(r0, r[0]);
EXPECT_GPR_ARM(r1, r[1]);
@@ -323,9 +323,9 @@ TEST(RegisterInfoFreeBSDTest, arm) {
sizeof(fpreg::fbsd_reg)))
TEST(RegisterInfoFreeBSDTest, arm64) {
- Flags opt_regsets = RegisterInfoPOSIX_arm64::eRegsetMaskDefault;
+ Flags opt_regsets = RegisterInfoCommon_arm64::eRegsetMaskDefault;
ArchSpec arch{"aarch64-unknown-freebsd"};
- RegisterInfoPOSIX_arm64 reg_ctx{arch, opt_regsets};
+ RegisterInfoCommon_arm64 reg_ctx{arch, opt_regsets};
EXPECT_GPR_ARM64(x0, x[0]);
EXPECT_GPR_ARM64(x1, x[1]);
diff --git a/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Utility/BUILD.gn b/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Utility/BUILD.gn
index ee138642d78f15..88841256310bf6 100644
--- a/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Utility/BUILD.gn
+++ b/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Utility/BUILD.gn
@@ -23,14 +23,14 @@ static_library("Register") {
"RegisterInfoWindows_i386.cpp",
"RegisterInfoWindows_x86_64.cpp",
"RegisterContext_x86.cpp",
- "RegisterInfoPOSIXDynamic_riscv32.cpp",
- "RegisterInfoPOSIX_arm.cpp",
- "RegisterInfoPOSIX_arm64.cpp",
- "RegisterInfoPOSIX_loongarch64.cpp",
- "RegisterInfoPOSIX_ppc64.cpp",
- "RegisterInfoPOSIX_ppc64le.cpp",
- "RegisterInfoPOSIX_riscv32.cpp",
- "RegisterInfoPOSIX_riscv64.cpp",
+ "RegisterInfoCommonDynamic_riscv32.cpp",
+ "RegisterInfoCommon_arm.cpp",
+ "RegisterInfoCommon_arm64.cpp",
+ "RegisterInfoCommon_loongarch64.cpp",
+ "RegisterInfoCommon_ppc64.cpp",
+ "RegisterInfoCommon_ppc64le.cpp",
+ "RegisterInfoCommon_riscv32.cpp",
+ "RegisterInfoCommon_riscv64.cpp",
"RegisterInfos_x86_64_with_base_shared.cpp",
"RegisterTypeDetector_arm64.cpp",
]
>From 83fea46644fec0004e14ca11f16956a53ff238b2 Mon Sep 17 00:00:00 2001
From: Minsoo Choo <minsoo at minsoo.io>
Date: Thu, 10 Sep 2026 10:39:03 -0400
Subject: [PATCH 3/6] [lldb] Move register support out of ProcessUtility
---
lldb/source/CMakeLists.txt | 1 +
.../Plugins/ABI/PowerPC/ABISysV_ppc64.cpp | 4 +-
.../ARM64/EmulateInstructionARM64.cpp | 4 +-
.../LoongArch/EmulateInstructionLoongArch.cpp | 4 +-
.../MIPS/EmulateInstructionMIPS.cpp | 2 +-
.../MIPS64/EmulateInstructionMIPS64.cpp | 2 +-
.../PPC64/EmulateInstructionPPC64.cpp | 4 +-
.../RISCV/EmulateInstructionRISCV.cpp | 8 +-
.../Instruction/RISCV/RISCVCInstructions.h | 2 +-
.../ObjectFile/PECOFF/PECallFrameInfo.cpp | 2 +-
.../Plugins/Platform/Linux/PlatformLinux.cpp | 2 +-
.../Plugins/Process/AIX/NativeProcessAIX.cpp | 2 +-
.../AIX/NativeRegisterContextAIX_ppc64.cpp | 2 +-
.../AIX/NativeRegisterContextAIX_ppc64.h | 4 +-
.../RegisterContextFreeBSDKernelCore_arm.cpp | 2 +-
...RegisterContextFreeBSDKernelCore_arm64.cpp | 2 +-
.../ThreadFreeBSDKernelCore.cpp | 12 +-
.../NativeRegisterContextFreeBSD_arm.cpp | 2 +-
.../NativeRegisterContextFreeBSD_arm.h | 2 +-
.../NativeRegisterContextFreeBSD_arm64.cpp | 4 +-
.../NativeRegisterContextFreeBSD_arm64.h | 2 +-
.../NativeRegisterContextFreeBSD_powerpc.h | 2 +-
.../NativeRegisterContextFreeBSD_x86.cpp | 4 +-
.../NativeRegisterContextFreeBSD_x86.h | 4 +-
.../Linux/NativeRegisterContextLinux_arm.cpp | 2 +-
.../Linux/NativeRegisterContextLinux_arm.h | 4 +-
.../NativeRegisterContextLinux_arm64.cpp | 4 +-
.../Linux/NativeRegisterContextLinux_arm64.h | 2 +-
...NativeRegisterContextLinux_loongarch64.cpp | 4 +-
.../NativeRegisterContextLinux_loongarch64.h | 2 +-
.../NativeRegisterContextLinux_ppc64le.cpp | 2 +-
.../NativeRegisterContextLinux_ppc64le.h | 4 +-
.../NativeRegisterContextLinux_riscv64.cpp | 4 +-
.../NativeRegisterContextLinux_riscv64.h | 2 +-
.../NativeRegisterContextLinux_s390x.cpp | 2 +-
.../Linux/NativeRegisterContextLinux_s390x.h | 4 +-
.../Linux/NativeRegisterContextLinux_x86.cpp | 4 +-
.../Linux/NativeRegisterContextLinux_x86.h | 6 +-
.../NativeRegisterContextNetBSD_x86.cpp | 4 +-
.../NetBSD/NativeRegisterContextNetBSD_x86.h | 4 +-
.../Plugins/Process/Utility/CMakeLists.txt | 36 ---
.../NativeRegisterContextDBReg_x86.cpp | 2 +-
.../Utility/RegisterContextPOSIX_ppc64le.h | 2 +-
.../RegisterInfos_x86_64_with_base_shared.h | 16 +-
.../NativeRegisterContextWindows_WoW64.cpp | 2 +-
.../NativeRegisterContextWindows_WoW64.h | 4 +-
.../NativeRegisterContextWindows_arm.cpp | 2 +-
.../Common/NativeRegisterContextWindows_arm.h | 2 +-
.../NativeRegisterContextWindows_arm64.h | 4 +-
.../NativeRegisterContextWindows_i386.cpp | 2 +-
.../NativeRegisterContextWindows_i386.h | 4 +-
.../NativeRegisterContextWindows_x86_64.cpp | 4 +-
.../NativeRegisterContextWindows_x86_64.h | 4 +-
.../Common/arm/RegisterContextWindows_arm.cpp | 2 +-
.../arm64/RegisterContextWindows_arm64.cpp | 2 +-
.../Common/x64/RegisterContextWindows_x64.cpp | 4 +-
.../Common/x86/RegisterContextWindows_x86.cpp | 4 +-
.../RegisterContextPOSIXCore_arm64.cpp | 4 +-
.../elf-core/RegisterContextPOSIXCore_arm64.h | 2 +-
.../RegisterContextPOSIXCore_loongarch64.h | 2 +-
.../RegisterContextPOSIXCore_ppc64le.cpp | 2 +-
.../RegisterContextPOSIXCore_riscv32.cpp | 2 +-
.../RegisterContextPOSIXCore_riscv32.h | 2 +-
.../RegisterContextPOSIXCore_riscv64.h | 2 +-
.../Process/elf-core/ThreadElfCore.cpp | 26 +-
.../minidump/RegisterContextMinidump_ARM.h | 2 +-
.../minidump/RegisterContextMinidump_ARM64.h | 2 +-
.../minidump/RegisterContextMinidump_x86_32.h | 4 +-
.../minidump/RegisterContextMinidump_x86_64.h | 4 +-
.../Process/minidump/ThreadMinidump.cpp | 4 +-
.../NativePDB/CodeViewRegisterMapping.cpp | 4 +-
.../Arch}/RegisterContext_mips.h | 6 +-
.../Arch}/RegisterContext_powerpc.h | 6 +-
.../Arch}/RegisterContext_s390x.h | 4 +-
.../Arch}/RegisterContext_x86.cpp | 4 +-
.../Arch}/RegisterContext_x86.h | 4 +-
.../Arch}/RegisterInfos_arm.h | 0
.../Arch}/RegisterInfos_arm64.h | 0
.../Arch}/RegisterInfos_arm64_sve.h | 0
.../Arch}/RegisterInfos_i386.h | 0
.../Arch}/RegisterInfos_loongarch64.h | 2 +-
.../Arch}/RegisterInfos_mips.h | 0
.../Arch}/RegisterInfos_mips64.h | 0
.../Arch}/RegisterInfos_powerpc.h | 0
.../Arch}/RegisterInfos_ppc64.h | 2 +-
.../Arch}/RegisterInfos_ppc64le.h | 2 +-
.../Arch}/RegisterInfos_riscv32.h | 2 +-
.../Arch}/RegisterInfos_riscv64.h | 2 +-
.../Arch}/RegisterInfos_s390x.h | 0
.../Arch}/RegisterInfos_x86_64.h | 0
.../Arch}/RegisterInfos_x86_64_with_base.h | 2 +-
.../RegisterInfos_x86_64_with_base_shared.cpp | 2 +-
.../RegisterInfos_x86_64_with_base_shared.h | 142 +++++++++++
.../Arch}/lldb-arm-register-enums.h | 6 +-
.../Arch}/lldb-arm64-register-enums.h | 6 +-
.../Arch}/lldb-loongarch-register-enums.h | 6 +-
.../Arch}/lldb-ppc64-register-enums.h | 6 +-
.../Arch}/lldb-ppc64le-register-enums.h | 6 +-
.../Arch}/lldb-riscv-register-enums.h | 6 +-
.../Arch}/lldb-s390x-register-enums.h | 6 +-
.../Arch}/lldb-x86-register-enums.h | 6 +-
lldb/source/Register/CMakeLists.txt | 33 +++
.../RegisterInfoCommonDynamic_riscv32.cpp | 6 +-
.../RegisterInfoCommonDynamic_riscv32.h | 8 +-
.../Common}/RegisterInfoCommon_arm.cpp | 4 +-
.../Common}/RegisterInfoCommon_arm.h | 8 +-
.../Common}/RegisterInfoCommon_arm64.cpp | 6 +-
.../Common}/RegisterInfoCommon_arm64.h | 6 +-
.../RegisterInfoCommon_loongarch64.cpp | 4 +-
.../Common}/RegisterInfoCommon_loongarch64.h | 6 +-
.../Common}/RegisterInfoCommon_ppc64.cpp | 4 +-
.../Common}/RegisterInfoCommon_ppc64.h | 8 +-
.../Common}/RegisterInfoCommon_ppc64le.cpp | 4 +-
.../Common}/RegisterInfoCommon_ppc64le.h | 6 +-
.../Common}/RegisterInfoCommon_riscv32.cpp | 4 +-
.../Common}/RegisterInfoCommon_riscv32.h | 6 +-
.../Common}/RegisterInfoCommon_riscv64.cpp | 4 +-
.../Common}/RegisterInfoCommon_riscv64.h | 6 +-
.../Common}/RegisterTypeDetector_arm64.cpp | 2 +-
.../Common}/RegisterTypeDetector_arm64.h | 6 +-
.../FreeBSD/RegisterInfoFreeBSD_i386.cpp | 85 +++++++
.../FreeBSD/RegisterInfoFreeBSD_i386.h | 25 ++
.../FreeBSD/RegisterInfoFreeBSD_powerpc.cpp | 233 ++++++++++++++++++
.../FreeBSD/RegisterInfoFreeBSD_powerpc.h | 52 ++++
.../FreeBSD/RegisterInfoFreeBSD_x86_64.cpp | 143 +++++++++++
.../FreeBSD/RegisterInfoFreeBSD_x86_64.h | 30 +++
.../Register/Linux/RegisterInfoLinux_i386.cpp | 127 ++++++++++
.../Register/Linux/RegisterInfoLinux_i386.h | 29 +++
.../Linux/RegisterInfoLinux_s390x.cpp | 69 ++++++
.../Register/Linux/RegisterInfoLinux_s390x.h | 32 +++
.../Register/Linux/RegisterInfoLinux_x86.h | 30 +++
.../Linux/RegisterInfoLinux_x86_64.cpp | 186 ++++++++++++++
.../Register/Linux/RegisterInfoLinux_x86_64.h | 34 +++
.../NetBSD/RegisterInfoNetBSD_i386.cpp | 98 ++++++++
.../Register/NetBSD/RegisterInfoNetBSD_i386.h | 25 ++
.../NetBSD/RegisterInfoNetBSD_x86_64.cpp | 180 ++++++++++++++
.../NetBSD/RegisterInfoNetBSD_x86_64.h | 33 +++
.../OpenBSD/RegisterInfoOpenBSD_i386.cpp | 79 ++++++
.../OpenBSD/RegisterInfoOpenBSD_i386.h | 25 ++
.../OpenBSD/RegisterInfoOpenBSD_x86_64.cpp | 106 ++++++++
.../OpenBSD/RegisterInfoOpenBSD_x86_64.h | 30 +++
.../RegisterInfoAndSetInterface.h | 6 +-
.../RegisterInfoInterface.h | 4 +-
.../Windows/RegisterInfoWindows_i386.cpp | 90 +++++++
.../Windows/RegisterInfoWindows_i386.h | 27 ++
.../Windows/RegisterInfoWindows_x86_64.cpp | 153 ++++++++++++
.../Windows/RegisterInfoWindows_x86_64.h | 28 +++
.../Instruction/ARM64/TestAArch64Emulator.cpp | 4 +-
.../LoongArch/TestLoongArchEmulator.cpp | 4 +-
.../Instruction/RISCV/TestRISCVEmulator.cpp | 6 +-
.../RISCV/TestRiscvInstEmulation.cpp | 2 +-
.../ObjectFile/PECOFF/TestPECallFrameInfo.cpp | 2 +-
.../ObjectFile/PECOFF/TestSectionSize.cpp | 3 +-
.../Utility/RegisterInfoFreeBSDTest.cpp | 16 +-
.../Utility/RegisterInfoNetBSDTest_i386.cpp | 4 +-
.../Utility/RegisterInfoNetBSDTest_x86_64.cpp | 6 +-
.../Process/Utility/RegisterInfo_x86Test.cpp | 2 +-
.../minidump/RegisterContextMinidumpTest.cpp | 4 +-
.../Symbol/TestDWARFCallFrameInfo.cpp | 2 +-
.../ARM64/TestArm64InstEmulation.cpp | 1 +
.../PPC64/TestPPC64InstEmulation.cpp | 2 +-
.../source/Plugins/Process/Utility/BUILD.gn | 40 +--
.../secondary/lldb/source/Register/BUILD.gn | 37 +++
163 files changed, 2416 insertions(+), 328 deletions(-)
rename lldb/source/{Plugins/Process/Utility => Register/Arch}/RegisterContext_mips.h (97%)
rename lldb/source/{Plugins/Process/Utility => Register/Arch}/RegisterContext_powerpc.h (92%)
rename lldb/source/{Plugins/Process/Utility => Register/Arch}/RegisterContext_s390x.h (93%)
rename lldb/source/{Plugins/Process/Utility => Register/Arch}/RegisterContext_x86.cpp (99%)
rename lldb/source/{Plugins/Process/Utility => Register/Arch}/RegisterContext_x86.h (99%)
rename lldb/source/{Plugins/Process/Utility => Register/Arch}/RegisterInfos_arm.h (100%)
rename lldb/source/{Plugins/Process/Utility => Register/Arch}/RegisterInfos_arm64.h (100%)
rename lldb/source/{Plugins/Process/Utility => Register/Arch}/RegisterInfos_arm64_sve.h (100%)
rename lldb/source/{Plugins/Process/Utility => Register/Arch}/RegisterInfos_i386.h (100%)
rename lldb/source/{Plugins/Process/Utility => Register/Arch}/RegisterInfos_loongarch64.h (99%)
rename lldb/source/{Plugins/Process/Utility => Register/Arch}/RegisterInfos_mips.h (100%)
rename lldb/source/{Plugins/Process/Utility => Register/Arch}/RegisterInfos_mips64.h (100%)
rename lldb/source/{Plugins/Process/Utility => Register/Arch}/RegisterInfos_powerpc.h (100%)
rename lldb/source/{Plugins/Process/Utility => Register/Arch}/RegisterInfos_ppc64.h (99%)
rename lldb/source/{Plugins/Process/Utility => Register/Arch}/RegisterInfos_ppc64le.h (99%)
rename lldb/source/{Plugins/Process/Utility => Register/Arch}/RegisterInfos_riscv32.h (99%)
rename lldb/source/{Plugins/Process/Utility => Register/Arch}/RegisterInfos_riscv64.h (99%)
rename lldb/source/{Plugins/Process/Utility => Register/Arch}/RegisterInfos_s390x.h (100%)
rename lldb/source/{Plugins/Process/Utility => Register/Arch}/RegisterInfos_x86_64.h (100%)
rename lldb/source/{Plugins/Process/Utility => Register/Arch}/RegisterInfos_x86_64_with_base.h (99%)
rename lldb/source/{Plugins/Process/Utility => Register/Arch}/RegisterInfos_x86_64_with_base_shared.cpp (99%)
create mode 100644 lldb/source/Register/Arch/RegisterInfos_x86_64_with_base_shared.h
rename lldb/source/{Plugins/Process/Utility => Register/Arch}/lldb-arm-register-enums.h (94%)
rename lldb/source/{Plugins/Process/Utility => Register/Arch}/lldb-arm64-register-enums.h (95%)
rename lldb/source/{Plugins/Process/Utility => Register/Arch}/lldb-loongarch-register-enums.h (96%)
rename lldb/source/{Plugins/Process/Utility => Register/Arch}/lldb-ppc64-register-enums.h (94%)
rename lldb/source/{Plugins/Process/Utility => Register/Arch}/lldb-ppc64le-register-enums.h (95%)
rename lldb/source/{Plugins/Process/Utility => Register/Arch}/lldb-riscv-register-enums.h (99%)
rename lldb/source/{Plugins/Process/Utility => Register/Arch}/lldb-s390x-register-enums.h (90%)
rename lldb/source/{Plugins/Process/Utility => Register/Arch}/lldb-x86-register-enums.h (98%)
create mode 100644 lldb/source/Register/CMakeLists.txt
rename lldb/source/{Plugins/Process/Utility => Register/Common}/RegisterInfoCommonDynamic_riscv32.cpp (97%)
rename lldb/source/{Plugins/Process/Utility => Register/Common}/RegisterInfoCommonDynamic_riscv32.h (89%)
rename lldb/source/{Plugins/Process/Utility => Register/Common}/RegisterInfoCommon_arm.cpp (98%)
rename lldb/source/{Plugins/Process/Utility => Register/Common}/RegisterInfoCommon_arm.h (88%)
rename lldb/source/{Plugins/Process/Utility => Register/Common}/RegisterInfoCommon_arm64.cpp (99%)
rename lldb/source/{Plugins/Process/Utility => Register/Common}/RegisterInfoCommon_arm64.h (97%)
rename lldb/source/{Plugins/Process/Utility => Register/Common}/RegisterInfoCommon_loongarch64.cpp (98%)
rename lldb/source/{Plugins/Process/Utility => Register/Common}/RegisterInfoCommon_loongarch64.h (90%)
rename lldb/source/{Plugins/Process/Utility => Register/Common}/RegisterInfoCommon_ppc64.cpp (95%)
rename lldb/source/{Plugins/Process/Utility => Register/Common}/RegisterInfoCommon_ppc64.h (77%)
rename lldb/source/{Plugins/Process/Utility => Register/Common}/RegisterInfoCommon_ppc64le.cpp (94%)
rename lldb/source/{Plugins/Process/Utility => Register/Common}/RegisterInfoCommon_ppc64le.h (82%)
rename lldb/source/{Plugins/Process/Utility => Register/Common}/RegisterInfoCommon_riscv32.cpp (98%)
rename lldb/source/{Plugins/Process/Utility => Register/Common}/RegisterInfoCommon_riscv32.h (90%)
rename lldb/source/{Plugins/Process/Utility => Register/Common}/RegisterInfoCommon_riscv64.cpp (98%)
rename lldb/source/{Plugins/Process/Utility => Register/Common}/RegisterInfoCommon_riscv64.h (92%)
rename lldb/source/{Plugins/Process/Utility => Register/Common}/RegisterTypeDetector_arm64.cpp (99%)
rename lldb/source/{Plugins/Process/Utility => Register/Common}/RegisterTypeDetector_arm64.h (96%)
create mode 100644 lldb/source/Register/FreeBSD/RegisterInfoFreeBSD_i386.cpp
create mode 100644 lldb/source/Register/FreeBSD/RegisterInfoFreeBSD_i386.h
create mode 100644 lldb/source/Register/FreeBSD/RegisterInfoFreeBSD_powerpc.cpp
create mode 100644 lldb/source/Register/FreeBSD/RegisterInfoFreeBSD_powerpc.h
create mode 100644 lldb/source/Register/FreeBSD/RegisterInfoFreeBSD_x86_64.cpp
create mode 100644 lldb/source/Register/FreeBSD/RegisterInfoFreeBSD_x86_64.h
create mode 100644 lldb/source/Register/Linux/RegisterInfoLinux_i386.cpp
create mode 100644 lldb/source/Register/Linux/RegisterInfoLinux_i386.h
create mode 100644 lldb/source/Register/Linux/RegisterInfoLinux_s390x.cpp
create mode 100644 lldb/source/Register/Linux/RegisterInfoLinux_s390x.h
create mode 100644 lldb/source/Register/Linux/RegisterInfoLinux_x86.h
create mode 100644 lldb/source/Register/Linux/RegisterInfoLinux_x86_64.cpp
create mode 100644 lldb/source/Register/Linux/RegisterInfoLinux_x86_64.h
create mode 100644 lldb/source/Register/NetBSD/RegisterInfoNetBSD_i386.cpp
create mode 100644 lldb/source/Register/NetBSD/RegisterInfoNetBSD_i386.h
create mode 100644 lldb/source/Register/NetBSD/RegisterInfoNetBSD_x86_64.cpp
create mode 100644 lldb/source/Register/NetBSD/RegisterInfoNetBSD_x86_64.h
create mode 100644 lldb/source/Register/OpenBSD/RegisterInfoOpenBSD_i386.cpp
create mode 100644 lldb/source/Register/OpenBSD/RegisterInfoOpenBSD_i386.h
create mode 100644 lldb/source/Register/OpenBSD/RegisterInfoOpenBSD_x86_64.cpp
create mode 100644 lldb/source/Register/OpenBSD/RegisterInfoOpenBSD_x86_64.h
rename lldb/source/{Plugins/Process/Utility => Register}/RegisterInfoAndSetInterface.h (84%)
rename lldb/source/{Plugins/Process/Utility => Register}/RegisterInfoInterface.h (91%)
create mode 100644 lldb/source/Register/Windows/RegisterInfoWindows_i386.cpp
create mode 100644 lldb/source/Register/Windows/RegisterInfoWindows_i386.h
create mode 100644 lldb/source/Register/Windows/RegisterInfoWindows_x86_64.cpp
create mode 100644 lldb/source/Register/Windows/RegisterInfoWindows_x86_64.h
create mode 100644 llvm/utils/gn/secondary/lldb/source/Register/BUILD.gn
diff --git a/lldb/source/CMakeLists.txt b/lldb/source/CMakeLists.txt
index ae02227ca35788..4125f32197b261 100644
--- a/lldb/source/CMakeLists.txt
+++ b/lldb/source/CMakeLists.txt
@@ -9,6 +9,7 @@ add_subdirectory(Expression)
add_subdirectory(Host)
add_subdirectory(Initialization)
add_subdirectory(Interpreter)
+add_subdirectory(Register)
add_subdirectory(Plugins)
add_subdirectory(Protocol)
add_subdirectory(Symbol)
diff --git a/lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc64.cpp b/lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc64.cpp
index 0895cd3d75df66..3c2b391cfb8699 100644
--- a/lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc64.cpp
+++ b/lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc64.cpp
@@ -38,11 +38,11 @@
#include "clang/AST/Decl.h"
#define DECLARE_REGISTER_INFOS_PPC64_STRUCT
-#include "Plugins/Process/Utility/RegisterInfos_ppc64.h"
+#include "Register/Arch/RegisterInfos_ppc64.h"
#undef DECLARE_REGISTER_INFOS_PPC64_STRUCT
#define DECLARE_REGISTER_INFOS_PPC64LE_STRUCT
-#include "Plugins/Process/Utility/RegisterInfos_ppc64le.h"
+#include "Register/Arch/RegisterInfos_ppc64le.h"
#undef DECLARE_REGISTER_INFOS_PPC64LE_STRUCT
#include <optional>
diff --git a/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp b/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp
index 4ef62bbfa2bc7a..78c51531260a8d 100644
--- a/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp
+++ b/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp
@@ -19,7 +19,7 @@
#include "Plugins/Process/Utility/ARMDefines.h"
#include "Plugins/Process/Utility/ARMUtils.h"
-#include "Plugins/Process/Utility/lldb-arm64-register-enums.h"
+#include "Register/Arch/lldb-arm64-register-enums.h"
#include <algorithm>
#include <cstdlib>
@@ -40,7 +40,7 @@
#define DECLARE_REGISTER_INFOS_ARM64_STRUCT
-#include "Plugins/Process/Utility/RegisterInfos_arm64.h"
+#include "Register/Arch/RegisterInfos_arm64.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/MathExtras.h"
diff --git a/lldb/source/Plugins/Instruction/LoongArch/EmulateInstructionLoongArch.cpp b/lldb/source/Plugins/Instruction/LoongArch/EmulateInstructionLoongArch.cpp
index 5090ddf0b6d1e9..73041bbcad9c88 100644
--- a/lldb/source/Plugins/Instruction/LoongArch/EmulateInstructionLoongArch.cpp
+++ b/lldb/source/Plugins/Instruction/LoongArch/EmulateInstructionLoongArch.cpp
@@ -11,8 +11,8 @@
#include "EmulateInstructionLoongArch.h"
#include "Plugins/Process/Utility/InstructionUtils.h"
-#include "Plugins/Process/Utility/RegisterInfoCommon_loongarch64.h"
-#include "Plugins/Process/Utility/lldb-loongarch-register-enums.h"
+#include "Register/Common/RegisterInfoCommon_loongarch64.h"
+#include "Register/Arch/lldb-loongarch-register-enums.h"
#include "lldb/Core/Address.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Interpreter/OptionValueArray.h"
diff --git a/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp b/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
index deaa2fdadd22ea..de158426064b9c 100644
--- a/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
+++ b/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
@@ -36,7 +36,7 @@
#include "llvm/ADT/STLExtras.h"
#include "Plugins/Process/Utility/InstructionUtils.h"
-#include "Plugins/Process/Utility/RegisterContext_mips.h"
+#include "Register/Arch/RegisterContext_mips.h"
using namespace lldb;
using namespace lldb_private;
diff --git a/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp b/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp
index 57f04fb8d19b77..7d2ebd15632d0d 100644
--- a/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp
+++ b/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp
@@ -36,7 +36,7 @@
#include "llvm/ADT/STLExtras.h"
#include "Plugins/Process/Utility/InstructionUtils.h"
-#include "Plugins/Process/Utility/RegisterContext_mips.h"
+#include "Register/Arch/RegisterContext_mips.h"
using namespace lldb;
using namespace lldb_private;
diff --git a/lldb/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp b/lldb/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp
index 29516c57d2a204..299b61f774132b 100644
--- a/lldb/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp
+++ b/lldb/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp
@@ -11,7 +11,7 @@
#include <cstdlib>
#include <optional>
-#include "Plugins/Process/Utility/lldb-ppc64le-register-enums.h"
+#include "Register/Arch/lldb-ppc64le-register-enums.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Symbol/UnwindPlan.h"
#include "lldb/Utility/ArchSpec.h"
@@ -19,7 +19,7 @@
#include "lldb/Utility/LLDBLog.h"
#define DECLARE_REGISTER_INFOS_PPC64LE_STRUCT
-#include "Plugins/Process/Utility/RegisterInfos_ppc64le.h"
+#include "Register/Arch/RegisterInfos_ppc64le.h"
#include "Plugins/Process/Utility/InstructionUtils.h"
diff --git a/lldb/source/Plugins/Instruction/RISCV/EmulateInstructionRISCV.cpp b/lldb/source/Plugins/Instruction/RISCV/EmulateInstructionRISCV.cpp
index ba6990ba235a7f..aff404caeac115 100644
--- a/lldb/source/Plugins/Instruction/RISCV/EmulateInstructionRISCV.cpp
+++ b/lldb/source/Plugins/Instruction/RISCV/EmulateInstructionRISCV.cpp
@@ -7,10 +7,10 @@
//===----------------------------------------------------------------------===//
#include "EmulateInstructionRISCV.h"
-#include "Plugins/Process/Utility/RegisterInfoInterface.h"
-#include "Plugins/Process/Utility/RegisterInfoCommon_riscv32.h"
-#include "Plugins/Process/Utility/RegisterInfoCommon_riscv64.h"
-#include "Plugins/Process/Utility/lldb-riscv-register-enums.h"
+#include "Register/RegisterInfoInterface.h"
+#include "Register/Common/RegisterInfoCommon_riscv32.h"
+#include "Register/Common/RegisterInfoCommon_riscv64.h"
+#include "Register/Arch/lldb-riscv-register-enums.h"
#include "RISCVCInstructions.h"
#include "RISCVInstructions.h"
diff --git a/lldb/source/Plugins/Instruction/RISCV/RISCVCInstructions.h b/lldb/source/Plugins/Instruction/RISCV/RISCVCInstructions.h
index 54140703d7049c..fee0da0b0c282e 100644
--- a/lldb/source/Plugins/Instruction/RISCV/RISCVCInstructions.h
+++ b/lldb/source/Plugins/Instruction/RISCV/RISCVCInstructions.h
@@ -12,7 +12,7 @@
#include <cstdint>
#include <variant>
-#include "Plugins/Process/Utility/lldb-riscv-register-enums.h"
+#include "Register/Arch/lldb-riscv-register-enums.h"
#include "RISCVInstructions.h"
namespace lldb_private {
diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/PECallFrameInfo.cpp b/lldb/source/Plugins/ObjectFile/PECOFF/PECallFrameInfo.cpp
index 4b516b2e954bd6..6a312b39057e53 100644
--- a/lldb/source/Plugins/ObjectFile/PECOFF/PECallFrameInfo.cpp
+++ b/lldb/source/Plugins/ObjectFile/PECOFF/PECallFrameInfo.cpp
@@ -2,7 +2,7 @@
#include "ObjectFilePECOFF.h"
-#include "Plugins/Process/Utility/lldb-x86-register-enums.h"
+#include "Register/Arch/lldb-x86-register-enums.h"
#include "lldb/Symbol/UnwindPlan.h"
#include "llvm/Support/Win64EH.h"
diff --git a/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp b/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp
index eda300b21b981a..dab63b6becf7cb 100644
--- a/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp
+++ b/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp
@@ -15,7 +15,7 @@
#endif
#include "Plugins/Process/Utility/LinuxSignals.h"
-#include "Plugins/Process/Utility/lldb-riscv-register-enums.h"
+#include "Register/Arch/lldb-riscv-register-enums.h"
#include "Utility/ARM64_DWARF_Registers.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Core/PluginManager.h"
diff --git a/lldb/source/Plugins/Process/AIX/NativeProcessAIX.cpp b/lldb/source/Plugins/Process/AIX/NativeProcessAIX.cpp
index 6d99c228575490..cfc78219dcd87d 100644
--- a/lldb/source/Plugins/Process/AIX/NativeProcessAIX.cpp
+++ b/lldb/source/Plugins/Process/AIX/NativeProcessAIX.cpp
@@ -27,7 +27,7 @@
#include <sys/ptrace.h>
#include <unistd.h>
#define DECLARE_REGISTER_INFOS_PPC64_STRUCT
-#include "Plugins/Process/Utility/RegisterInfos_ppc64.h"
+#include "Register/Arch/RegisterInfos_ppc64.h"
#undef DECLARE_REGISTER_INFOS_PPC64_STRUCT
using namespace lldb;
diff --git a/lldb/source/Plugins/Process/AIX/NativeRegisterContextAIX_ppc64.cpp b/lldb/source/Plugins/Process/AIX/NativeRegisterContextAIX_ppc64.cpp
index 0726e3ac779789..cc87f411e91c81 100644
--- a/lldb/source/Plugins/Process/AIX/NativeRegisterContextAIX_ppc64.cpp
+++ b/lldb/source/Plugins/Process/AIX/NativeRegisterContextAIX_ppc64.cpp
@@ -10,7 +10,7 @@
#include "NativeRegisterContextAIX_ppc64.h"
#include "NativeThreadAIX.h"
-#include "Plugins/Process/Utility/RegisterInfoCommon_ppc64.h"
+#include "Register/Common/RegisterInfoCommon_ppc64.h"
#include "lldb/Utility/RegisterValue.h"
using namespace lldb;
diff --git a/lldb/source/Plugins/Process/AIX/NativeRegisterContextAIX_ppc64.h b/lldb/source/Plugins/Process/AIX/NativeRegisterContextAIX_ppc64.h
index aa0a6b8549900c..c61d3133abdb87 100644
--- a/lldb/source/Plugins/Process/AIX/NativeRegisterContextAIX_ppc64.h
+++ b/lldb/source/Plugins/Process/AIX/NativeRegisterContextAIX_ppc64.h
@@ -12,10 +12,10 @@
#define LLDB_SOURCE_PLUGINS_PROCESS_AIX_NATIVEREGISTERCONTEXTAIX_PPC64_H
#include "Plugins/Process/AIX/NativeRegisterContextAIX.h"
-#include "Plugins/Process/Utility/lldb-ppc64-register-enums.h"
+#include "Register/Arch/lldb-ppc64-register-enums.h"
#define DECLARE_REGISTER_INFOS_PPC64_STRUCT
-#include "Plugins/Process/Utility/RegisterInfos_ppc64.h"
+#include "Register/Arch/RegisterInfos_ppc64.h"
#undef DECLARE_REGISTER_INFOS_PPC64_STRUCT
namespace lldb_private {
diff --git a/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_arm.cpp b/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_arm.cpp
index 621a7a314ab46c..e527ca6ab589cb 100644
--- a/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_arm.cpp
+++ b/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_arm.cpp
@@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//
#include "RegisterContextFreeBSDKernelCore_arm.h"
-#include "Plugins/Process/Utility/lldb-arm-register-enums.h"
+#include "Register/Arch/lldb-arm-register-enums.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/Thread.h"
diff --git a/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_arm64.cpp b/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_arm64.cpp
index 3af209e406ae9a..42f81ef5542401 100644
--- a/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_arm64.cpp
+++ b/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_arm64.cpp
@@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//
#include "RegisterContextFreeBSDKernelCore_arm64.h"
-#include "Plugins/Process/Utility/lldb-arm64-register-enums.h"
+#include "Register/Arch/lldb-arm64-register-enums.h"
#include "lldb/Symbol/Symbol.h"
#include "lldb/Target/Process.h"
diff --git a/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/ThreadFreeBSDKernelCore.cpp b/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/ThreadFreeBSDKernelCore.cpp
index 4f0e7021d692db..0e415b6d03da95 100644
--- a/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/ThreadFreeBSDKernelCore.cpp
+++ b/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/ThreadFreeBSDKernelCore.cpp
@@ -12,12 +12,12 @@
#include "lldb/Target/Unwind.h"
#include "lldb/Utility/Log.h"
-#include "Plugins/Process/Utility/RegisterInfoFreeBSD_i386.h"
-#include "Plugins/Process/Utility/RegisterInfoFreeBSD_x86_64.h"
-#include "Plugins/Process/Utility/RegisterInfoCommon_arm.h"
-#include "Plugins/Process/Utility/RegisterInfoCommon_arm64.h"
-#include "Plugins/Process/Utility/RegisterInfoCommon_ppc64le.h"
-#include "Plugins/Process/Utility/RegisterInfoCommon_riscv64.h"
+#include "Register/FreeBSD/RegisterInfoFreeBSD_i386.h"
+#include "Register/FreeBSD/RegisterInfoFreeBSD_x86_64.h"
+#include "Register/Common/RegisterInfoCommon_arm.h"
+#include "Register/Common/RegisterInfoCommon_arm64.h"
+#include "Register/Common/RegisterInfoCommon_ppc64le.h"
+#include "Register/Common/RegisterInfoCommon_riscv64.h"
#include "ProcessFreeBSDKernelCore.h"
#include "RegisterContextFreeBSDKernelCore_arm.h"
#include "RegisterContextFreeBSDKernelCore_arm64.h"
diff --git a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm.cpp b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm.cpp
index fe4a6d3f104de0..1b0cb0b1cf930a 100644
--- a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm.cpp
+++ b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm.cpp
@@ -15,7 +15,7 @@
#include "lldb/Utility/Status.h"
#include "Plugins/Process/FreeBSD/NativeProcessFreeBSD.h"
-#include "Plugins/Process/Utility/RegisterInfoCommon_arm.h"
+#include "Register/Common/RegisterInfoCommon_arm.h"
// clang-format off
#include <sys/param.h>
diff --git a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm.h b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm.h
index eecc6b89502efc..5b9913fa6cbb4d 100644
--- a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm.h
+++ b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm.h
@@ -18,7 +18,7 @@
// clang-format on
#include "Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD.h"
-#include "Plugins/Process/Utility/RegisterInfoCommon_arm.h"
+#include "Register/Common/RegisterInfoCommon_arm.h"
#include <array>
diff --git a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm64.cpp b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm64.cpp
index f30dd262ebf1ff..8ecf690a48b2bc 100644
--- a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm64.cpp
+++ b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm64.cpp
@@ -16,8 +16,8 @@
#include "Plugins/Process/FreeBSD/NativeProcessFreeBSD.h"
#include "Plugins/Process/POSIX/ProcessPOSIXLog.h"
-#include "Plugins/Process/Utility/RegisterInfoCommon_arm64.h"
-#include "Plugins/Process/Utility/RegisterTypeDetector_arm64.h"
+#include "Register/Common/RegisterInfoCommon_arm64.h"
+#include "Register/Common/RegisterTypeDetector_arm64.h"
// clang-format off
#include <sys/param.h>
diff --git a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm64.h b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm64.h
index 613cfb761e52f7..b40507add17f3f 100644
--- a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm64.h
+++ b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm64.h
@@ -19,7 +19,7 @@
#include "Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD.h"
#include "Plugins/Process/Utility/NativeRegisterContextDBReg_arm64.h"
-#include "Plugins/Process/Utility/RegisterInfoCommon_arm64.h"
+#include "Register/Common/RegisterInfoCommon_arm64.h"
#include <array>
diff --git a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_powerpc.h b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_powerpc.h
index b0dcec4575de9d..632393704c8299 100644
--- a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_powerpc.h
+++ b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_powerpc.h
@@ -17,7 +17,7 @@
// clang-format on
#include "Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD.h"
-#include "Plugins/Process/Utility/RegisterInfoFreeBSD_powerpc.h"
+#include "Register/FreeBSD/RegisterInfoFreeBSD_powerpc.h"
#include <array>
#include <optional>
diff --git a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_x86.cpp b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_x86.cpp
index 50cea232972ceb..3359c59f88d8e2 100644
--- a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_x86.cpp
+++ b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_x86.cpp
@@ -23,8 +23,8 @@
#include "lldb/Utility/Status.h"
#include "NativeProcessFreeBSD.h"
-#include "Plugins/Process/Utility/RegisterInfoFreeBSD_i386.h"
-#include "Plugins/Process/Utility/RegisterInfoFreeBSD_x86_64.h"
+#include "Register/FreeBSD/RegisterInfoFreeBSD_i386.h"
+#include "Register/FreeBSD/RegisterInfoFreeBSD_x86_64.h"
#include <optional>
using namespace lldb_private;
diff --git a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_x86.h b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_x86.h
index cd519691eb5ad3..9d86935d13c32a 100644
--- a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_x86.h
+++ b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_x86.h
@@ -23,8 +23,8 @@
#include "Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD.h"
#include "Plugins/Process/Utility/NativeRegisterContextDBReg_x86.h"
-#include "Plugins/Process/Utility/RegisterContext_x86.h"
-#include "Plugins/Process/Utility/lldb-x86-register-enums.h"
+#include "Register/Arch/RegisterContext_x86.h"
+#include "Register/Arch/lldb-x86-register-enums.h"
#define LLDB_INVALID_XSAVE_OFFSET UINT32_MAX
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
index 515b9ed9f1dcdc..5ea3f73f5228b2 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
@@ -13,7 +13,7 @@
#include "Plugins/Process/Linux/NativeProcessLinux.h"
#include "Plugins/Process/Linux/Procfs.h"
#include "Plugins/Process/POSIX/ProcessPOSIXLog.h"
-#include "Plugins/Process/Utility/RegisterInfoCommon_arm.h"
+#include "Register/Common/RegisterInfoCommon_arm.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Utility/DataBufferHeap.h"
#include "lldb/Utility/Log.h"
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h
index 1fea0aa4baf38f..949a27fc5c139e 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h
@@ -13,8 +13,8 @@
#include "Plugins/Process/Linux/NativeRegisterContextLinux.h"
#include "Plugins/Process/Utility/NativeRegisterContextDBReg_arm.h"
-#include "Plugins/Process/Utility/RegisterInfoCommon_arm.h"
-#include "Plugins/Process/Utility/lldb-arm-register-enums.h"
+#include "Register/Common/RegisterInfoCommon_arm.h"
+#include "Register/Arch/lldb-arm-register-enums.h"
namespace lldb_private {
namespace process_linux {
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
index 6a7a5d615a3a86..0c28881e5433e0 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
@@ -16,8 +16,8 @@
#include "Plugins/Process/Linux/Procfs.h"
#include "Plugins/Process/POSIX/ProcessPOSIXLog.h"
#include "Plugins/Process/Utility/MemoryTagManagerAArch64MTE.h"
-#include "Plugins/Process/Utility/RegisterInfoCommon_arm64.h"
-#include "Plugins/Process/Utility/RegisterTypeDetector_arm64.h"
+#include "Register/Common/RegisterInfoCommon_arm64.h"
+#include "Register/Common/RegisterTypeDetector_arm64.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Host/common/NativeProcessProtocol.h"
#include "lldb/Utility/DataBufferHeap.h"
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h
index 8dfc1f54c5dbdf..44d3b191d509a5 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h
@@ -14,7 +14,7 @@
#include "Plugins/Process/Linux/NativeRegisterContextLinux.h"
#include "Plugins/Process/Utility/LinuxPTraceDefines_arm64sve.h"
#include "Plugins/Process/Utility/NativeRegisterContextDBReg_arm64.h"
-#include "Plugins/Process/Utility/RegisterInfoCommon_arm64.h"
+#include "Register/Common/RegisterInfoCommon_arm64.h"
#include "llvm/ADT/BitmaskEnum.h"
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_loongarch64.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_loongarch64.cpp
index ed5da5c4b61965..52e3dad6bdfe4b 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_loongarch64.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_loongarch64.cpp
@@ -12,8 +12,8 @@
#include "Plugins/Process/Linux/NativeProcessLinux.h"
#include "Plugins/Process/Linux/Procfs.h"
-#include "Plugins/Process/Utility/RegisterInfoCommon_loongarch64.h"
-#include "Plugins/Process/Utility/lldb-loongarch-register-enums.h"
+#include "Register/Common/RegisterInfoCommon_loongarch64.h"
+#include "Register/Arch/lldb-loongarch-register-enums.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Utility/DataBufferHeap.h"
#include "lldb/Utility/Log.h"
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_loongarch64.h b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_loongarch64.h
index fc6bb05211c7da..1ee8ffa8681f23 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_loongarch64.h
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_loongarch64.h
@@ -13,7 +13,7 @@
#include "Plugins/Process/Linux/NativeRegisterContextLinux.h"
#include "Plugins/Process/Utility/NativeRegisterContextDBReg_loongarch.h"
-#include "Plugins/Process/Utility/RegisterInfoCommon_loongarch64.h"
+#include "Register/Common/RegisterInfoCommon_loongarch64.h"
#include <asm/ptrace.h>
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.cpp
index b58954510a40ba..d1df65952ccaec 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.cpp
@@ -16,7 +16,7 @@
#include "Plugins/Process/Linux/NativeProcessLinux.h"
#include "Plugins/Process/Linux/Procfs.h"
#include "Plugins/Process/POSIX/ProcessPOSIXLog.h"
-#include "Plugins/Process/Utility/RegisterInfoCommon_ppc64le.h"
+#include "Register/Common/RegisterInfoCommon_ppc64le.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Host/common/NativeProcessProtocol.h"
#include "lldb/Utility/DataBufferHeap.h"
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.h b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.h
index 4ca9d43a249267..d8ad09e8dc5116 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.h
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.h
@@ -15,10 +15,10 @@
#define lldb_NativeRegisterContextLinux_ppc64le_h
#include "Plugins/Process/Linux/NativeRegisterContextLinux.h"
-#include "Plugins/Process/Utility/lldb-ppc64le-register-enums.h"
+#include "Register/Arch/lldb-ppc64le-register-enums.h"
#define DECLARE_REGISTER_INFOS_PPC64LE_STRUCT
-#include "Plugins/Process/Utility/RegisterInfos_ppc64le.h"
+#include "Register/Arch/RegisterInfos_ppc64le.h"
#undef DECLARE_REGISTER_INFOS_PPC64LE_STRUCT
namespace lldb_private {
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_riscv64.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_riscv64.cpp
index 43cc522eff0367..294fff439589ac 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_riscv64.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_riscv64.cpp
@@ -12,8 +12,8 @@
#include "Plugins/Process/Linux/NativeProcessLinux.h"
#include "Plugins/Process/Linux/Procfs.h"
-#include "Plugins/Process/Utility/RegisterInfoCommon_riscv64.h"
-#include "Plugins/Process/Utility/lldb-riscv-register-enums.h"
+#include "Register/Common/RegisterInfoCommon_riscv64.h"
+#include "Register/Arch/lldb-riscv-register-enums.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Utility/DataBufferHeap.h"
#include "lldb/Utility/Log.h"
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_riscv64.h b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_riscv64.h
index d5df762c9bee63..bd0048bb315579 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_riscv64.h
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_riscv64.h
@@ -12,7 +12,7 @@
#define lldb_NativeRegisterContextLinux_riscv64_h
#include "Plugins/Process/Linux/NativeRegisterContextLinux.h"
-#include "Plugins/Process/Utility/RegisterInfoCommon_riscv64.h"
+#include "Register/Common/RegisterInfoCommon_riscv64.h"
#include <asm/ptrace.h>
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp
index 1851eb21c6351e..d56fe891d37920 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp
@@ -10,7 +10,7 @@
#include "NativeRegisterContextLinux_s390x.h"
#include "Plugins/Process/Linux/NativeProcessLinux.h"
-#include "Plugins/Process/Utility/RegisterInfoLinux_s390x.h"
+#include "Register/Linux/RegisterInfoLinux_s390x.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Utility/DataBufferHeap.h"
#include "lldb/Utility/Log.h"
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.h b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.h
index 4b97fc89c3482b..23ea6db981241d 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.h
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.h
@@ -12,8 +12,8 @@
#define lldb_NativeRegisterContextLinux_s390x_h
#include "Plugins/Process/Linux/NativeRegisterContextLinux.h"
-#include "Plugins/Process/Utility/RegisterContext_s390x.h"
-#include "Plugins/Process/Utility/lldb-s390x-register-enums.h"
+#include "Register/Arch/RegisterContext_s390x.h"
+#include "Register/Arch/lldb-s390x-register-enums.h"
#include <asm/ptrace.h>
namespace lldb_private {
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86.cpp
index 1ab29f277b70a5..0d6356c75bd500 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86.cpp
@@ -12,8 +12,8 @@
#include "Plugins/Process/Linux/NativeProcessLinux.h"
#include "Plugins/Process/Linux/NativeThreadLinux.h"
-#include "Plugins/Process/Utility/RegisterInfoLinux_i386.h"
-#include "Plugins/Process/Utility/RegisterInfoLinux_x86_64.h"
+#include "Register/Linux/RegisterInfoLinux_i386.h"
+#include "Register/Linux/RegisterInfoLinux_x86_64.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Utility/DataBufferHeap.h"
#include "lldb/Utility/Log.h"
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86.h b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86.h
index 92793118939105..b58ae5bebe95fa 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86.h
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86.h
@@ -13,9 +13,9 @@
#include "Plugins/Process/Linux/NativeRegisterContextLinux.h"
#include "Plugins/Process/Utility/NativeRegisterContextDBReg_x86.h"
-#include "Plugins/Process/Utility/RegisterInfoLinux_x86.h"
-#include "Plugins/Process/Utility/RegisterContext_x86.h"
-#include "Plugins/Process/Utility/lldb-x86-register-enums.h"
+#include "Register/Linux/RegisterInfoLinux_x86.h"
+#include "Register/Arch/RegisterContext_x86.h"
+#include "Register/Arch/lldb-x86-register-enums.h"
#include <optional>
#include <sys/uio.h>
diff --git a/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86.cpp b/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86.cpp
index 55f13bda25ce20..b8f7bffbbf69f7 100644
--- a/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86.cpp
+++ b/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86.cpp
@@ -16,8 +16,8 @@
#include "lldb/Utility/RegisterValue.h"
#include "lldb/Utility/Status.h"
-#include "Plugins/Process/Utility/RegisterInfoNetBSD_i386.h"
-#include "Plugins/Process/Utility/RegisterInfoNetBSD_x86_64.h"
+#include "Register/NetBSD/RegisterInfoNetBSD_i386.h"
+#include "Register/NetBSD/RegisterInfoNetBSD_x86_64.h"
// clang-format off
#include <sys/types.h>
diff --git a/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86.h b/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86.h
index 10f11bd92db820..dba5ac78f67d39 100644
--- a/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86.h
+++ b/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86.h
@@ -22,9 +22,9 @@
#include <optional>
#include "Plugins/Process/NetBSD/NativeRegisterContextNetBSD.h"
-#include "Plugins/Process/Utility/RegisterContext_x86.h"
+#include "Register/Arch/RegisterContext_x86.h"
#include "Plugins/Process/Utility/NativeRegisterContextDBReg_x86.h"
-#include "Plugins/Process/Utility/lldb-x86-register-enums.h"
+#include "Register/Arch/lldb-x86-register-enums.h"
namespace lldb_private {
namespace process_netbsd {
diff --git a/lldb/source/Plugins/Process/Utility/CMakeLists.txt b/lldb/source/Plugins/Process/Utility/CMakeLists.txt
index 43bd2848c34b59..19a65bfa4fde1f 100644
--- a/lldb/source/Plugins/Process/Utility/CMakeLists.txt
+++ b/lldb/source/Plugins/Process/Utility/CMakeLists.txt
@@ -1,43 +1,7 @@
# TODO: Clean up this directory and its dependencies
set_property(DIRECTORY PROPERTY LLDB_PLUGIN_KIND ProcessUtility)
-add_lldb_library(lldbRegister NO_PLUGIN_DEPENDENCIES
- PARTIAL_SOURCES_INTENDED
- RegisterContext_x86.cpp
- RegisterInfoFreeBSD_i386.cpp
- RegisterInfoFreeBSD_powerpc.cpp
- RegisterInfoFreeBSD_x86_64.cpp
- RegisterInfoLinux_i386.cpp
- RegisterInfoLinux_x86_64.cpp
- RegisterInfoLinux_s390x.cpp
- RegisterInfoNetBSD_i386.cpp
- RegisterInfoNetBSD_x86_64.cpp
- RegisterInfoOpenBSD_i386.cpp
- RegisterInfoOpenBSD_x86_64.cpp
- RegisterInfoWindows_i386.cpp
- RegisterInfoWindows_x86_64.cpp
- RegisterTypeDetector_arm64.cpp
- RegisterInfos_x86_64_with_base_shared.cpp
- RegisterInfoCommon_arm.cpp
- RegisterInfoCommon_arm64.cpp
- RegisterInfoCommon_loongarch64.cpp
- RegisterInfoCommon_ppc64le.cpp
- RegisterInfoCommon_ppc64.cpp
- RegisterInfoCommon_riscv32.cpp
- RegisterInfoCommon_riscv64.cpp
- RegisterInfoCommonDynamic_riscv32.cpp
-
- LINK_COMPONENTS
- Support
- TargetParser
- LINK_LIBS
- lldbUtility
- ALLOWED_INTERNAL_DEPENDENCIES
- lldbUtility
- )
-
add_lldb_library(lldbPluginProcessUtility
- PARTIAL_SOURCES_INTENDED
AuxVector.cpp
FreeBSDSignals.cpp
GDBRemoteSignals.cpp
diff --git a/lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_x86.cpp b/lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_x86.cpp
index 3038cbcb723718..ed927691629e8e 100644
--- a/lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_x86.cpp
+++ b/lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_x86.cpp
@@ -10,7 +10,7 @@
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/RegisterValue.h"
-#include "Plugins/Process/Utility/lldb-x86-register-enums.h"
+#include "Register/Arch/lldb-x86-register-enums.h"
using namespace lldb_private;
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_ppc64le.h b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_ppc64le.h
index 66794ec9e9cabe..65209179596295 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_ppc64le.h
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_ppc64le.h
@@ -9,7 +9,7 @@
#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_PPC64LE_H
#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_PPC64LE_H
-#include "Plugins/Process/Utility/lldb-ppc64le-register-enums.h"
+#include "Register/Arch/lldb-ppc64le-register-enums.h"
#include "RegisterInfoInterface.h"
#include "Utility/PPC64LE_DWARF_Registers.h"
#include "lldb/Target/RegisterContext.h"
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64_with_base_shared.h b/lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64_with_base_shared.h
index efd6ab542016d4..a0562c8d94ceb9 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64_with_base_shared.h
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64_with_base_shared.h
@@ -1,11 +1,11 @@
-//===-- RegisterInfos_x86_64_with_base_shared.h -----------------*- C++ -*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
+ //===-- RegisterInfos_x86_64_with_base_shared.h -----------------*- C++ -*-===//
+ //
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+ // See https://llvm.org/LICENSE.txt for license information.
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+ //
+ //===----------------------------------------------------------------------===//
+
#ifndef lldb_RegisterInfos_x86_64_with_base_shared_h
#define lldb_RegisterInfos_x86_64_with_base_shared_h
diff --git a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_WoW64.cpp b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_WoW64.cpp
index b188bf979a01b4..f6a155f9ba8f97 100644
--- a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_WoW64.cpp
+++ b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_WoW64.cpp
@@ -11,7 +11,7 @@
#include "NativeRegisterContextWindows_WoW64.h"
#include "NativeThreadWindows.h"
-#include "Plugins/Process/Utility/RegisterInfoWindows_i386.h"
+#include "Register/Windows/RegisterInfoWindows_i386.h"
#include "ProcessWindowsLog.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Host/HostThread.h"
diff --git a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_WoW64.h b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_WoW64.h
index 213826ac7feda9..fa22c59f7c3ac1 100644
--- a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_WoW64.h
+++ b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_WoW64.h
@@ -10,8 +10,8 @@
#ifndef liblldb_NativeRegisterContextWindows_WoW64_h_
#define liblldb_NativeRegisterContextWindows_WoW64_h_
-#include "Plugins/Process/Utility/RegisterContext_x86.h"
-#include "Plugins/Process/Utility/lldb-x86-register-enums.h"
+#include "Register/Arch/RegisterContext_x86.h"
+#include "Register/Arch/lldb-x86-register-enums.h"
#include "NativeRegisterContextWindows.h"
diff --git a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm.cpp b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm.cpp
index f4f52f7193bf12..28181ca089303b 100644
--- a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm.cpp
+++ b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm.cpp
@@ -10,7 +10,7 @@
#include "NativeRegisterContextWindows_arm.h"
#include "NativeThreadWindows.h"
-#include "Plugins/Process/Utility/RegisterInfoCommon_arm.h"
+#include "Register/Common/RegisterInfoCommon_arm.h"
#include "ProcessWindowsLog.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Host/HostThread.h"
diff --git a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm.h b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm.h
index d8e8e81dde13d0..62464c60e253e2 100644
--- a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm.h
+++ b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm.h
@@ -10,7 +10,7 @@
#ifndef liblldb_NativeRegisterContextWindows_arm_h_
#define liblldb_NativeRegisterContextWindows_arm_h_
-#include "Plugins/Process/Utility/lldb-arm-register-enums.h"
+#include "Register/Arch/lldb-arm-register-enums.h"
#include "NativeRegisterContextWindows.h"
diff --git a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm64.h b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm64.h
index ec9e3e74ad3cf1..970d4ce26c61f4 100644
--- a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm64.h
+++ b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm64.h
@@ -13,8 +13,8 @@
#include "NativeRegisterContextWindows.h"
#include "Plugins/Process/Utility/NativeRegisterContextDBReg_arm64.h"
-#include "Plugins/Process/Utility/RegisterInfoCommon_arm64.h"
-#include "Plugins/Process/Utility/lldb-arm64-register-enums.h"
+#include "Register/Common/RegisterInfoCommon_arm64.h"
+#include "Register/Arch/lldb-arm64-register-enums.h"
#include "lldb/Host/windows/windows.h"
diff --git a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_i386.cpp b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_i386.cpp
index 940ae503a97c8c..563d54385f0807 100644
--- a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_i386.cpp
+++ b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_i386.cpp
@@ -11,7 +11,7 @@
#include "NativeRegisterContextWindows_i386.h"
#include "NativeThreadWindows.h"
-#include "Plugins/Process/Utility/RegisterInfoWindows_i386.h"
+#include "Register/Windows/RegisterInfoWindows_i386.h"
#include "ProcessWindowsLog.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Host/HostThread.h"
diff --git a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_i386.h b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_i386.h
index 325fbc35d3482d..be589fc6992cdb 100644
--- a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_i386.h
+++ b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_i386.h
@@ -10,8 +10,8 @@
#ifndef liblldb_NativeRegisterContextWindows_i386_h_
#define liblldb_NativeRegisterContextWindows_i386_h_
-#include "Plugins/Process/Utility/RegisterContext_x86.h"
-#include "Plugins/Process/Utility/lldb-x86-register-enums.h"
+#include "Register/Arch/RegisterContext_x86.h"
+#include "Register/Arch/lldb-x86-register-enums.h"
#include "NativeRegisterContextWindows.h"
diff --git a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_x86_64.cpp b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_x86_64.cpp
index 0695a42fc1848a..bb244e4ac1a638 100644
--- a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_x86_64.cpp
+++ b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_x86_64.cpp
@@ -11,8 +11,8 @@
#include "NativeRegisterContextWindows_x86_64.h"
#include "NativeRegisterContextWindows_WoW64.h"
#include "NativeThreadWindows.h"
-#include "Plugins/Process/Utility/RegisterInfoWindows_i386.h"
-#include "Plugins/Process/Utility/RegisterInfoWindows_x86_64.h"
+#include "Register/Windows/RegisterInfoWindows_i386.h"
+#include "Register/Windows/RegisterInfoWindows_x86_64.h"
#include "ProcessWindowsLog.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Host/HostThread.h"
diff --git a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_x86_64.h b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_x86_64.h
index 1eea8fbaa2e1cb..52bc7085210573 100644
--- a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_x86_64.h
+++ b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_x86_64.h
@@ -10,8 +10,8 @@
#ifndef liblldb_NativeRegisterContextWindows_x86_64_h_
#define liblldb_NativeRegisterContextWindows_x86_64_h_
-#include "Plugins/Process/Utility/RegisterContext_x86.h"
-#include "Plugins/Process/Utility/lldb-x86-register-enums.h"
+#include "Register/Arch/RegisterContext_x86.h"
+#include "Register/Arch/lldb-x86-register-enums.h"
#include "NativeRegisterContextWindows.h"
diff --git a/lldb/source/Plugins/Process/Windows/Common/arm/RegisterContextWindows_arm.cpp b/lldb/source/Plugins/Process/Windows/Common/arm/RegisterContextWindows_arm.cpp
index a31a299c337899..1c2a7b77f16cd6 100644
--- a/lldb/source/Plugins/Process/Windows/Common/arm/RegisterContextWindows_arm.cpp
+++ b/lldb/source/Plugins/Process/Windows/Common/arm/RegisterContextWindows_arm.cpp
@@ -38,7 +38,7 @@ using namespace lldb_private;
// Include RegisterInfos_arm to declare our g_register_infos_arm structure.
#define DECLARE_REGISTER_INFOS_ARM_STRUCT
-#include "Plugins/Process/Utility/RegisterInfos_arm.h"
+#include "Register/Arch/RegisterInfos_arm.h"
#undef DECLARE_REGISTER_INFOS_ARM_STRUCT
static size_t k_num_register_infos = std::size(g_register_infos_arm);
diff --git a/lldb/source/Plugins/Process/Windows/Common/arm64/RegisterContextWindows_arm64.cpp b/lldb/source/Plugins/Process/Windows/Common/arm64/RegisterContextWindows_arm64.cpp
index 33bb0712d4b5e4..38ebf8fb80466f 100644
--- a/lldb/source/Plugins/Process/Windows/Common/arm64/RegisterContextWindows_arm64.cpp
+++ b/lldb/source/Plugins/Process/Windows/Common/arm64/RegisterContextWindows_arm64.cpp
@@ -39,7 +39,7 @@ using namespace lldb_private;
// Include RegisterInfos_arm64 to declare our g_register_infos_arm64 structure.
#define DECLARE_REGISTER_INFOS_ARM64_STRUCT
-#include "Plugins/Process/Utility/RegisterInfos_arm64.h"
+#include "Register/Arch/RegisterInfos_arm64.h"
#undef DECLARE_REGISTER_INFOS_ARM64_STRUCT
static size_t k_num_register_infos = std::size(g_register_infos_arm64_le);
diff --git a/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp b/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp
index ae1e7a47e92bc2..25d7bdbc81b10b 100644
--- a/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp
+++ b/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp
@@ -14,8 +14,8 @@
#include "lldb/Utility/Status.h"
#include "lldb/lldb-private-types.h"
-#include "Plugins/Process/Utility/RegisterContext_x86.h"
-#include "Plugins/Process/Utility/lldb-x86-register-enums.h"
+#include "Register/Arch/RegisterContext_x86.h"
+#include "Register/Arch/lldb-x86-register-enums.h"
#include "ProcessWindowsLog.h"
#include "RegisterContextWindows_x64.h"
#include "TargetThreadWindows.h"
diff --git a/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp b/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp
index 3613120f5e3b9c..4d3ef9588b09dc 100644
--- a/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp
+++ b/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp
@@ -16,9 +16,9 @@
#include "ProcessWindowsLog.h"
#include "RegisterContextWindows_x86.h"
-#include "Plugins/Process/Utility/RegisterContext_x86.h"
+#include "Register/Arch/RegisterContext_x86.h"
#include "TargetThreadWindows.h"
-#include "Plugins/Process/Utility/lldb-x86-register-enums.h"
+#include "Register/Arch/lldb-x86-register-enums.h"
#include "llvm/ADT/STLExtras.h"
diff --git a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.cpp b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.cpp
index f910f62fb92a03..f1e90318a42279 100644
--- a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.cpp
+++ b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.cpp
@@ -7,10 +7,10 @@
//===----------------------------------------------------------------------===//
#include "RegisterContextPOSIXCore_arm64.h"
-#include "Plugins/Process/Utility/RegisterInfoCommon_arm64.h"
+#include "Register/Common/RegisterInfoCommon_arm64.h"
#include "Plugins/Process/Utility/AuxVector.h"
-#include "Plugins/Process/Utility/RegisterTypeDetector_arm64.h"
+#include "Register/Common/RegisterTypeDetector_arm64.h"
#include "Plugins/Process/elf-core/ProcessElfCore.h"
#include "Plugins/Process/elf-core/RegisterUtilities.h"
#include "lldb/Target/Thread.h"
diff --git a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.h b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.h
index 2499556e203d4d..c9314b6b7ea1d2 100644
--- a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.h
+++ b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.h
@@ -11,7 +11,7 @@
#include "Plugins/Process/Utility/LinuxPTraceDefines_arm64sve.h"
#include "Plugins/Process/Utility/RegisterContextPOSIX_arm64.h"
-#include "Plugins/Process/Utility/RegisterTypeDetector_arm64.h"
+#include "Register/Common/RegisterTypeDetector_arm64.h"
#include "Plugins/Process/elf-core/RegisterUtilities.h"
#include "lldb/Utility/DataBufferHeap.h"
diff --git a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_loongarch64.h b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_loongarch64.h
index 63b97551bbbeed..a12a23adf89dd0 100644
--- a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_loongarch64.h
+++ b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_loongarch64.h
@@ -10,7 +10,7 @@
#define LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTPOSIXCORE_LOONGARCH64_H
#include "Plugins/Process/Utility/RegisterContextPOSIX_loongarch64.h"
-#include "Plugins/Process/Utility/RegisterInfoCommon_loongarch64.h"
+#include "Register/Common/RegisterInfoCommon_loongarch64.h"
#include "Plugins/Process/elf-core/RegisterUtilities.h"
#include "lldb/Target/Thread.h"
diff --git a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_ppc64le.cpp b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_ppc64le.cpp
index d44fb399e18a74..4f0f46b2213c45 100644
--- a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_ppc64le.cpp
+++ b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_ppc64le.cpp
@@ -12,7 +12,7 @@
#include "lldb/Utility/DataBufferHeap.h"
#include "lldb/Utility/RegisterValue.h"
-#include "Plugins/Process/Utility/lldb-ppc64le-register-enums.h"
+#include "Register/Arch/lldb-ppc64le-register-enums.h"
#include "Plugins/Process/elf-core/RegisterUtilities.h"
#include <memory>
diff --git a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_riscv32.cpp b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_riscv32.cpp
index a52d99c2791ab6..07bedccd01f2d6 100644
--- a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_riscv32.cpp
+++ b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_riscv32.cpp
@@ -20,7 +20,7 @@
#define FPR_OFFSET(idx) ((idx) * sizeof(uint32_t))
#define DECLARE_REGISTER_INFOS_RISCV32_STRUCT
-#include "Plugins/Process/Utility/RegisterInfos_riscv32.h"
+#include "Register/Arch/RegisterInfos_riscv32.h"
#undef DECLARE_REGISTER_INFOS_RISCV32_STRUCT
using namespace lldb_private;
diff --git a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_riscv32.h b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_riscv32.h
index 6f154bcfbceb99..4cae36cf319e39 100644
--- a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_riscv32.h
+++ b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_riscv32.h
@@ -9,7 +9,7 @@
#ifndef LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTPOSIXCORE_RISCV32_H
#define LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTPOSIXCORE_RISCV32_H
-#include "Plugins/Process/Utility/RegisterInfoCommonDynamic_riscv32.h"
+#include "Register/Common/RegisterInfoCommonDynamic_riscv32.h"
#include "Plugins/Process/elf-core/RegisterUtilities.h"
#include "lldb/Target/Thread.h"
#include "lldb/Utility/DataExtractor.h"
diff --git a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_riscv64.h b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_riscv64.h
index 9a0153d78d867f..22a67654bbc790 100644
--- a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_riscv64.h
+++ b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_riscv64.h
@@ -10,7 +10,7 @@
#define LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTPOSIXCORE_RISCV64_H
#include "Plugins/Process/Utility/RegisterContextPOSIX_riscv64.h"
-#include "Plugins/Process/Utility/RegisterInfoCommon_riscv64.h"
+#include "Register/Common/RegisterInfoCommon_riscv64.h"
#include "Plugins/Process/elf-core/RegisterUtilities.h"
#include "lldb/Target/Thread.h"
diff --git a/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp b/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp
index f024211abc2b6d..6372eff29de97d 100644
--- a/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp
+++ b/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp
@@ -16,19 +16,19 @@
#include "lldb/Utility/Log.h"
#include "lldb/Utility/ProcessInfo.h"
-#include "Plugins/Process/Utility/RegisterInfoFreeBSD_i386.h"
-#include "Plugins/Process/Utility/RegisterInfoFreeBSD_powerpc.h"
-#include "Plugins/Process/Utility/RegisterInfoFreeBSD_x86_64.h"
-#include "Plugins/Process/Utility/RegisterInfoLinux_i386.h"
-#include "Plugins/Process/Utility/RegisterInfoLinux_s390x.h"
-#include "Plugins/Process/Utility/RegisterInfoLinux_x86_64.h"
-#include "Plugins/Process/Utility/RegisterInfoNetBSD_i386.h"
-#include "Plugins/Process/Utility/RegisterInfoNetBSD_x86_64.h"
-#include "Plugins/Process/Utility/RegisterInfoOpenBSD_i386.h"
-#include "Plugins/Process/Utility/RegisterInfoOpenBSD_x86_64.h"
-#include "Plugins/Process/Utility/RegisterInfoCommon_arm.h"
-#include "Plugins/Process/Utility/RegisterInfoCommon_arm64.h"
-#include "Plugins/Process/Utility/RegisterInfoCommon_ppc64le.h"
+#include "Register/FreeBSD/RegisterInfoFreeBSD_i386.h"
+#include "Register/FreeBSD/RegisterInfoFreeBSD_powerpc.h"
+#include "Register/FreeBSD/RegisterInfoFreeBSD_x86_64.h"
+#include "Register/Linux/RegisterInfoLinux_i386.h"
+#include "Register/Linux/RegisterInfoLinux_s390x.h"
+#include "Register/Linux/RegisterInfoLinux_x86_64.h"
+#include "Register/NetBSD/RegisterInfoNetBSD_i386.h"
+#include "Register/NetBSD/RegisterInfoNetBSD_x86_64.h"
+#include "Register/OpenBSD/RegisterInfoOpenBSD_i386.h"
+#include "Register/OpenBSD/RegisterInfoOpenBSD_x86_64.h"
+#include "Register/Common/RegisterInfoCommon_arm.h"
+#include "Register/Common/RegisterInfoCommon_arm64.h"
+#include "Register/Common/RegisterInfoCommon_ppc64le.h"
#include "ProcessElfCore.h"
#include "RegisterContextLinuxCore_x86.h"
#include "RegisterContextPOSIXCore_arm.h"
diff --git a/lldb/source/Plugins/Process/minidump/RegisterContextMinidump_ARM.h b/lldb/source/Plugins/Process/minidump/RegisterContextMinidump_ARM.h
index 857f9c0a376743..07388cbe0f65f1 100644
--- a/lldb/source/Plugins/Process/minidump/RegisterContextMinidump_ARM.h
+++ b/lldb/source/Plugins/Process/minidump/RegisterContextMinidump_ARM.h
@@ -11,7 +11,7 @@
#include "MinidumpTypes.h"
-#include "Plugins/Process/Utility/RegisterInfoInterface.h"
+#include "Register/RegisterInfoInterface.h"
#include "lldb/Target/RegisterContext.h"
diff --git a/lldb/source/Plugins/Process/minidump/RegisterContextMinidump_ARM64.h b/lldb/source/Plugins/Process/minidump/RegisterContextMinidump_ARM64.h
index 58cf8d62fb8653..e761fda93b67f0 100644
--- a/lldb/source/Plugins/Process/minidump/RegisterContextMinidump_ARM64.h
+++ b/lldb/source/Plugins/Process/minidump/RegisterContextMinidump_ARM64.h
@@ -11,7 +11,7 @@
#include "MinidumpTypes.h"
-#include "Plugins/Process/Utility/RegisterInfoInterface.h"
+#include "Register/RegisterInfoInterface.h"
#include "lldb/Target/RegisterContext.h"
#include "llvm/ADT/ArrayRef.h"
diff --git a/lldb/source/Plugins/Process/minidump/RegisterContextMinidump_x86_32.h b/lldb/source/Plugins/Process/minidump/RegisterContextMinidump_x86_32.h
index 4dffc4f9db0ebd..5599843771bcb5 100644
--- a/lldb/source/Plugins/Process/minidump/RegisterContextMinidump_x86_32.h
+++ b/lldb/source/Plugins/Process/minidump/RegisterContextMinidump_x86_32.h
@@ -11,8 +11,8 @@
#include "MinidumpTypes.h"
-#include "Plugins/Process/Utility/RegisterInfoInterface.h"
-#include "Plugins/Process/Utility/lldb-x86-register-enums.h"
+#include "Register/RegisterInfoInterface.h"
+#include "Register/Arch/lldb-x86-register-enums.h"
#include "lldb/Target/RegisterContext.h"
diff --git a/lldb/source/Plugins/Process/minidump/RegisterContextMinidump_x86_64.h b/lldb/source/Plugins/Process/minidump/RegisterContextMinidump_x86_64.h
index f8d38e4ba53786..09fbde77a06e01 100644
--- a/lldb/source/Plugins/Process/minidump/RegisterContextMinidump_x86_64.h
+++ b/lldb/source/Plugins/Process/minidump/RegisterContextMinidump_x86_64.h
@@ -11,8 +11,8 @@
#include "MinidumpTypes.h"
-#include "Plugins/Process/Utility/RegisterInfoInterface.h"
-#include "Plugins/Process/Utility/lldb-x86-register-enums.h"
+#include "Register/RegisterInfoInterface.h"
+#include "Register/Arch/lldb-x86-register-enums.h"
#include "lldb/Target/RegisterContext.h"
diff --git a/lldb/source/Plugins/Process/minidump/ThreadMinidump.cpp b/lldb/source/Plugins/Process/minidump/ThreadMinidump.cpp
index 270dded14cf3b4..905fb9348ab9b7 100644
--- a/lldb/source/Plugins/Process/minidump/ThreadMinidump.cpp
+++ b/lldb/source/Plugins/Process/minidump/ThreadMinidump.cpp
@@ -15,8 +15,8 @@
#include "RegisterContextMinidump_x86_32.h"
#include "RegisterContextMinidump_x86_64.h"
-#include "Plugins/Process/Utility/RegisterInfoLinux_i386.h"
-#include "Plugins/Process/Utility/RegisterInfoLinux_x86_64.h"
+#include "Register/Linux/RegisterInfoLinux_i386.h"
+#include "Register/Linux/RegisterInfoLinux_x86_64.h"
#include "Plugins/Process/elf-core/RegisterContextPOSIXCore_x86.h"
#include "Plugins/Process/elf-core/RegisterUtilities.h"
diff --git a/lldb/source/Plugins/SymbolFile/NativePDB/CodeViewRegisterMapping.cpp b/lldb/source/Plugins/SymbolFile/NativePDB/CodeViewRegisterMapping.cpp
index 3c10d4aa314b20..44d5ff84a9b3ef 100644
--- a/lldb/source/Plugins/SymbolFile/NativePDB/CodeViewRegisterMapping.cpp
+++ b/lldb/source/Plugins/SymbolFile/NativePDB/CodeViewRegisterMapping.cpp
@@ -10,8 +10,8 @@
#include "lldb/lldb-defines.h"
-#include "Plugins/Process/Utility/lldb-arm64-register-enums.h"
-#include "Plugins/Process/Utility/lldb-x86-register-enums.h"
+#include "Register/Arch/lldb-arm64-register-enums.h"
+#include "Register/Arch/lldb-x86-register-enums.h"
using namespace lldb_private;
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContext_mips.h b/lldb/source/Register/Arch/RegisterContext_mips.h
similarity index 97%
rename from lldb/source/Plugins/Process/Utility/RegisterContext_mips.h
rename to lldb/source/Register/Arch/RegisterContext_mips.h
index 15081f974c667d..07e0add1f1c1c0 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContext_mips.h
+++ b/lldb/source/Register/Arch/RegisterContext_mips.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXT_MIPS_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXT_MIPS_H
+#ifndef LLDB_SOURCE_REGISTER_ARCH_REGISTERCONTEXT_MIPS_H
+#define LLDB_SOURCE_REGISTER_ARCH_REGISTERCONTEXT_MIPS_H
#include <cstddef>
#include <cstdint>
@@ -371,4 +371,4 @@ struct UserArea {
MSA_linux_mips msa; // MSA registers.
};
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXT_MIPS_H
+#endif // LLDB_SOURCE_REGISTER_ARCH_REGISTERCONTEXT_MIPS_H
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContext_powerpc.h b/lldb/source/Register/Arch/RegisterContext_powerpc.h
similarity index 92%
rename from lldb/source/Plugins/Process/Utility/RegisterContext_powerpc.h
rename to lldb/source/Register/Arch/RegisterContext_powerpc.h
index 7407e2f402e08a..1ca6ac4685720f 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContext_powerpc.h
+++ b/lldb/source/Register/Arch/RegisterContext_powerpc.h
@@ -7,8 +7,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXT_POWERPC_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXT_POWERPC_H
+#ifndef LLDB_SOURCE_REGISTER_ARCH_REGISTERCONTEXT_POWERPC_H
+#define LLDB_SOURCE_REGISTER_ARCH_REGISTERCONTEXT_POWERPC_H
// eh_frame and DWARF Register numbers (eRegisterKindEHFrame &
// eRegisterKindDWARF)
@@ -120,4 +120,4 @@ enum {
dwarf_v31_powerpc,
};
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXT_POWERPC_H
+#endif // LLDB_SOURCE_REGISTER_ARCH_REGISTERCONTEXT_POWERPC_H
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContext_s390x.h b/lldb/source/Register/Arch/RegisterContext_s390x.h
similarity index 93%
rename from lldb/source/Plugins/Process/Utility/RegisterContext_s390x.h
rename to lldb/source/Register/Arch/RegisterContext_s390x.h
index 248b3bd0beacb9..2bea399dfd2985 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContext_s390x.h
+++ b/lldb/source/Register/Arch/RegisterContext_s390x.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXT_S390X_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXT_S390X_H
+#ifndef LLDB_SOURCE_REGISTER_ARCH_REGISTERCONTEXT_S390X_H
+#define LLDB_SOURCE_REGISTER_ARCH_REGISTERCONTEXT_S390X_H
// SystemZ ehframe, dwarf regnums
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContext_x86.cpp b/lldb/source/Register/Arch/RegisterContext_x86.cpp
similarity index 99%
rename from lldb/source/Plugins/Process/Utility/RegisterContext_x86.cpp
rename to lldb/source/Register/Arch/RegisterContext_x86.cpp
index 059862d0481dad..e1617120c686ea 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContext_x86.cpp
+++ b/lldb/source/Register/Arch/RegisterContext_x86.cpp
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#include "RegisterContext_x86.h"
-#include "lldb-x86-register-enums.h"
+#include "Register/Arch/RegisterContext_x86.h"
+#include "Register/Arch/lldb-x86-register-enums.h"
#include "lldb/lldb-defines.h"
using namespace lldb_private;
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContext_x86.h b/lldb/source/Register/Arch/RegisterContext_x86.h
similarity index 99%
rename from lldb/source/Plugins/Process/Utility/RegisterContext_x86.h
rename to lldb/source/Register/Arch/RegisterContext_x86.h
index d1d7e94f31776e..2e06f9ae281385 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContext_x86.h
+++ b/lldb/source/Register/Arch/RegisterContext_x86.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXT_X86_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXT_X86_H
+#ifndef LLDB_SOURCE_REGISTER_ARCH_REGISTERCONTEXT_X86_H
+#define LLDB_SOURCE_REGISTER_ARCH_REGISTERCONTEXT_X86_H
#include <cstddef>
#include <cstdint>
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfos_arm.h b/lldb/source/Register/Arch/RegisterInfos_arm.h
similarity index 100%
rename from lldb/source/Plugins/Process/Utility/RegisterInfos_arm.h
rename to lldb/source/Register/Arch/RegisterInfos_arm.h
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfos_arm64.h b/lldb/source/Register/Arch/RegisterInfos_arm64.h
similarity index 100%
rename from lldb/source/Plugins/Process/Utility/RegisterInfos_arm64.h
rename to lldb/source/Register/Arch/RegisterInfos_arm64.h
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfos_arm64_sve.h b/lldb/source/Register/Arch/RegisterInfos_arm64_sve.h
similarity index 100%
rename from lldb/source/Plugins/Process/Utility/RegisterInfos_arm64_sve.h
rename to lldb/source/Register/Arch/RegisterInfos_arm64_sve.h
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfos_i386.h b/lldb/source/Register/Arch/RegisterInfos_i386.h
similarity index 100%
rename from lldb/source/Plugins/Process/Utility/RegisterInfos_i386.h
rename to lldb/source/Register/Arch/RegisterInfos_i386.h
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfos_loongarch64.h b/lldb/source/Register/Arch/RegisterInfos_loongarch64.h
similarity index 99%
rename from lldb/source/Plugins/Process/Utility/RegisterInfos_loongarch64.h
rename to lldb/source/Register/Arch/RegisterInfos_loongarch64.h
index ff8fe5990ce118..ee16c9606a90a2 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfos_loongarch64.h
+++ b/lldb/source/Register/Arch/RegisterInfos_loongarch64.h
@@ -15,7 +15,7 @@
#include "lldb/lldb-private.h"
#include "Utility/LoongArch_DWARF_Registers.h"
-#include "lldb-loongarch-register-enums.h"
+#include "Register/Arch/lldb-loongarch-register-enums.h"
#ifndef GPR_OFFSET
#error GPR_OFFSET must be defined before including this header file
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfos_mips.h b/lldb/source/Register/Arch/RegisterInfos_mips.h
similarity index 100%
rename from lldb/source/Plugins/Process/Utility/RegisterInfos_mips.h
rename to lldb/source/Register/Arch/RegisterInfos_mips.h
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfos_mips64.h b/lldb/source/Register/Arch/RegisterInfos_mips64.h
similarity index 100%
rename from lldb/source/Plugins/Process/Utility/RegisterInfos_mips64.h
rename to lldb/source/Register/Arch/RegisterInfos_mips64.h
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfos_powerpc.h b/lldb/source/Register/Arch/RegisterInfos_powerpc.h
similarity index 100%
rename from lldb/source/Plugins/Process/Utility/RegisterInfos_powerpc.h
rename to lldb/source/Register/Arch/RegisterInfos_powerpc.h
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfos_ppc64.h b/lldb/source/Register/Arch/RegisterInfos_ppc64.h
similarity index 99%
rename from lldb/source/Plugins/Process/Utility/RegisterInfos_ppc64.h
rename to lldb/source/Register/Arch/RegisterInfos_ppc64.h
index ba0b6d45d95ba7..61165ad0df3ecd 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfos_ppc64.h
+++ b/lldb/source/Register/Arch/RegisterInfos_ppc64.h
@@ -22,7 +22,7 @@
#define GPR_PPC64_SIZE(regname) (sizeof(((GPR_PPC64 *)NULL)->regname))
#include "Utility/PPC64_DWARF_Registers.h"
-#include "lldb-ppc64-register-enums.h"
+#include "Register/Arch/lldb-ppc64-register-enums.h"
// Note that the size and offset will be updated by platform-specific classes.
#define DEFINE_GPR_PPC64(reg, alt, lldb_kind) \
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfos_ppc64le.h b/lldb/source/Register/Arch/RegisterInfos_ppc64le.h
similarity index 99%
rename from lldb/source/Plugins/Process/Utility/RegisterInfos_ppc64le.h
rename to lldb/source/Register/Arch/RegisterInfos_ppc64le.h
index 18489fb74f86ee..dbf3c425d420c1 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfos_ppc64le.h
+++ b/lldb/source/Register/Arch/RegisterInfos_ppc64le.h
@@ -19,7 +19,7 @@
#define GPR_SIZE(regname) (sizeof(((GPR *)NULL)->regname))
#include "Utility/PPC64LE_DWARF_Registers.h"
-#include "lldb-ppc64le-register-enums.h"
+#include "Register/Arch/lldb-ppc64le-register-enums.h"
// Note that the size and offset will be updated by platform-specific classes.
#define DEFINE_GPR(reg, alt, lldb_kind) \
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfos_riscv32.h b/lldb/source/Register/Arch/RegisterInfos_riscv32.h
similarity index 99%
rename from lldb/source/Plugins/Process/Utility/RegisterInfos_riscv32.h
rename to lldb/source/Register/Arch/RegisterInfos_riscv32.h
index 8ceec7fa234dce..943058b817702c 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfos_riscv32.h
+++ b/lldb/source/Register/Arch/RegisterInfos_riscv32.h
@@ -9,7 +9,7 @@
#ifdef DECLARE_REGISTER_INFOS_RISCV32_STRUCT
#include "Utility/RISCV_DWARF_Registers.h"
-#include "lldb-riscv-register-enums.h"
+#include "Register/Arch/lldb-riscv-register-enums.h"
#include "lldb/lldb-defines.h"
#include "lldb/lldb-enumerations.h"
#include "lldb/lldb-private.h"
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfos_riscv64.h b/lldb/source/Register/Arch/RegisterInfos_riscv64.h
similarity index 99%
rename from lldb/source/Plugins/Process/Utility/RegisterInfos_riscv64.h
rename to lldb/source/Register/Arch/RegisterInfos_riscv64.h
index c9959168b15365..4ba73b24d456e6 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfos_riscv64.h
+++ b/lldb/source/Register/Arch/RegisterInfos_riscv64.h
@@ -15,7 +15,7 @@
#include "lldb/lldb-private.h"
#include "Utility/RISCV_DWARF_Registers.h"
-#include "lldb-riscv-register-enums.h"
+#include "Register/Arch/lldb-riscv-register-enums.h"
#ifndef GPR_OFFSET
#error GPR_OFFSET must be defined before including this header file
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfos_s390x.h b/lldb/source/Register/Arch/RegisterInfos_s390x.h
similarity index 100%
rename from lldb/source/Plugins/Process/Utility/RegisterInfos_s390x.h
rename to lldb/source/Register/Arch/RegisterInfos_s390x.h
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64.h b/lldb/source/Register/Arch/RegisterInfos_x86_64.h
similarity index 100%
rename from lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64.h
rename to lldb/source/Register/Arch/RegisterInfos_x86_64.h
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64_with_base.h b/lldb/source/Register/Arch/RegisterInfos_x86_64_with_base.h
similarity index 99%
rename from lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64_with_base.h
rename to lldb/source/Register/Arch/RegisterInfos_x86_64_with_base.h
index b111d8f62d1f3d..473fc699875314 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64_with_base.h
+++ b/lldb/source/Register/Arch/RegisterInfos_x86_64_with_base.h
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "RegisterInfos_x86_64_with_base_shared.h"
+#include "Register/Arch/RegisterInfos_x86_64_with_base_shared.h"
// This file is meant to be textually included. Do not #include modular
// headers here.
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64_with_base_shared.cpp b/lldb/source/Register/Arch/RegisterInfos_x86_64_with_base_shared.cpp
similarity index 99%
rename from lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64_with_base_shared.cpp
rename to lldb/source/Register/Arch/RegisterInfos_x86_64_with_base_shared.cpp
index 7b2d64de230f33..af70efef86ac28 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64_with_base_shared.cpp
+++ b/lldb/source/Register/Arch/RegisterInfos_x86_64_with_base_shared.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "RegisterInfos_x86_64_with_base_shared.h"
+#include "Register/Arch/RegisterInfos_x86_64_with_base_shared.h"
#include "lldb/lldb-defines.h"
#include <mutex>
diff --git a/lldb/source/Register/Arch/RegisterInfos_x86_64_with_base_shared.h b/lldb/source/Register/Arch/RegisterInfos_x86_64_with_base_shared.h
new file mode 100644
index 00000000000000..8486e1fe1eb5c1
--- /dev/null
+++ b/lldb/source/Register/Arch/RegisterInfos_x86_64_with_base_shared.h
@@ -0,0 +1,142 @@
+//===-- RegisterInfos_x86_64_with_base_shared.h -----------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "Register/Arch/lldb-x86-register-enums.h"
+#include <stdint.h>
+
+#ifndef lldb_RegisterInfos_x86_64_with_base_shared_h
+#define lldb_RegisterInfos_x86_64_with_base_shared_h
+
+#include "Plugins/Process/Utility/NativeRegisterContextRegisterInfo.h"
+
+namespace lldb_private {
+
+struct RegisterInfos_x86_64_with_base_shared {
+ static uint32_t g_contained_eax[];
+ static uint32_t g_contained_ebx[];
+ static uint32_t g_contained_ecx[];
+ static uint32_t g_contained_edx[];
+ static uint32_t g_contained_edi[];
+ static uint32_t g_contained_esi[];
+ static uint32_t g_contained_ebp[];
+ static uint32_t g_contained_esp[];
+
+ static uint32_t g_invalidate_eax[];
+ static uint32_t g_invalidate_ebx[];
+ static uint32_t g_invalidate_ecx[];
+ static uint32_t g_invalidate_edx[];
+ static uint32_t g_invalidate_edi[];
+ static uint32_t g_invalidate_esi[];
+ static uint32_t g_invalidate_ebp[];
+ static uint32_t g_invalidate_esp[];
+
+ static uint32_t g_contained_rax[];
+ static uint32_t g_contained_rbx[];
+ static uint32_t g_contained_rcx[];
+ static uint32_t g_contained_rdx[];
+ static uint32_t g_contained_rdi[];
+ static uint32_t g_contained_rsi[];
+ static uint32_t g_contained_rbp[];
+ static uint32_t g_contained_rsp[];
+ static uint32_t g_contained_r8[];
+ static uint32_t g_contained_r9[];
+ static uint32_t g_contained_r10[];
+ static uint32_t g_contained_r11[];
+ static uint32_t g_contained_r12[];
+ static uint32_t g_contained_r13[];
+ static uint32_t g_contained_r14[];
+ static uint32_t g_contained_r15[];
+
+ static uint32_t g_invalidate_rax[];
+ static uint32_t g_invalidate_rbx[];
+ static uint32_t g_invalidate_rcx[];
+ static uint32_t g_invalidate_rdx[];
+ static uint32_t g_invalidate_rdi[];
+ static uint32_t g_invalidate_rsi[];
+ static uint32_t g_invalidate_rbp[];
+ static uint32_t g_invalidate_rsp[];
+ static uint32_t g_invalidate_r8[];
+ static uint32_t g_invalidate_r9[];
+ static uint32_t g_invalidate_r10[];
+ static uint32_t g_invalidate_r11[];
+ static uint32_t g_invalidate_r12[];
+ static uint32_t g_invalidate_r13[];
+ static uint32_t g_invalidate_r14[];
+ static uint32_t g_invalidate_r15[];
+
+ static uint32_t g_contained_fip[];
+ static uint32_t g_contained_fdp[];
+
+ static uint32_t g_invalidate_fip[];
+ static uint32_t g_invalidate_fdp[];
+
+ static uint32_t g_contained_st0_32[];
+ static uint32_t g_contained_st1_32[];
+ static uint32_t g_contained_st2_32[];
+ static uint32_t g_contained_st3_32[];
+ static uint32_t g_contained_st4_32[];
+ static uint32_t g_contained_st5_32[];
+ static uint32_t g_contained_st6_32[];
+ static uint32_t g_contained_st7_32[];
+
+ static uint32_t g_invalidate_st0_32[];
+ static uint32_t g_invalidate_st1_32[];
+ static uint32_t g_invalidate_st2_32[];
+ static uint32_t g_invalidate_st3_32[];
+ static uint32_t g_invalidate_st4_32[];
+ static uint32_t g_invalidate_st5_32[];
+ static uint32_t g_invalidate_st6_32[];
+ static uint32_t g_invalidate_st7_32[];
+
+ static uint32_t g_contained_st0_64[];
+ static uint32_t g_contained_st1_64[];
+ static uint32_t g_contained_st2_64[];
+ static uint32_t g_contained_st3_64[];
+ static uint32_t g_contained_st4_64[];
+ static uint32_t g_contained_st5_64[];
+ static uint32_t g_contained_st6_64[];
+ static uint32_t g_contained_st7_64[];
+
+ static uint32_t g_invalidate_st0_64[];
+ static uint32_t g_invalidate_st1_64[];
+ static uint32_t g_invalidate_st2_64[];
+ static uint32_t g_invalidate_st3_64[];
+ static uint32_t g_invalidate_st4_64[];
+ static uint32_t g_invalidate_st5_64[];
+ static uint32_t g_invalidate_st6_64[];
+ static uint32_t g_invalidate_st7_64[];
+};
+
+struct RegInfo {
+ uint32_t num_registers;
+ uint32_t num_gpr_registers;
+ uint32_t num_fpr_registers;
+ uint32_t num_avx_registers;
+
+ uint32_t last_gpr;
+ uint32_t first_fpr;
+ uint32_t last_fpr;
+
+ uint32_t first_st;
+ uint32_t last_st;
+ uint32_t first_mm;
+ uint32_t last_mm;
+ uint32_t first_xmm;
+ uint32_t last_xmm;
+ uint32_t first_ymm;
+ uint32_t last_ymm;
+
+ uint32_t first_dr;
+ uint32_t gpr_flags;
+};
+
+RegInfo &GetRegInfoShared(llvm::Triple::ArchType arch_type, bool with_base);
+
+} // namespace lldb_private
+
+#endif // ifndef lldb_RegisterInfos_x86_64_with_base_shared_h
diff --git a/lldb/source/Plugins/Process/Utility/lldb-arm-register-enums.h b/lldb/source/Register/Arch/lldb-arm-register-enums.h
similarity index 94%
rename from lldb/source/Plugins/Process/Utility/lldb-arm-register-enums.h
rename to lldb/source/Register/Arch/lldb-arm-register-enums.h
index 8f0eed4f02c902..eb0fbe1d3e34b3 100644
--- a/lldb/source/Plugins/Process/Utility/lldb-arm-register-enums.h
+++ b/lldb/source/Register/Arch/lldb-arm-register-enums.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_LLDB_ARM_REGISTER_ENUMS_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_LLDB_ARM_REGISTER_ENUMS_H
+#ifndef LLDB_SOURCE_REGISTER_ARCH_LLDB_ARM_REGISTER_ENUMS_H
+#define LLDB_SOURCE_REGISTER_ARCH_LLDB_ARM_REGISTER_ENUMS_H
namespace lldb_private {
// LLDB register codes (e.g. RegisterKind == eRegisterKindLLDB)
@@ -196,4 +196,4 @@ enum {
};
}
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_LLDB_ARM_REGISTER_ENUMS_H
+#endif // LLDB_SOURCE_REGISTER_ARCH_LLDB_ARM_REGISTER_ENUMS_H
diff --git a/lldb/source/Plugins/Process/Utility/lldb-arm64-register-enums.h b/lldb/source/Register/Arch/lldb-arm64-register-enums.h
similarity index 95%
rename from lldb/source/Plugins/Process/Utility/lldb-arm64-register-enums.h
rename to lldb/source/Register/Arch/lldb-arm64-register-enums.h
index 39d47b8801ccf0..d89acda4f34376 100644
--- a/lldb/source/Plugins/Process/Utility/lldb-arm64-register-enums.h
+++ b/lldb/source/Register/Arch/lldb-arm64-register-enums.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_LLDB_ARM64_REGISTER_ENUMS_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_LLDB_ARM64_REGISTER_ENUMS_H
+#ifndef LLDB_SOURCE_REGISTER_ARCH_LLDB_ARM64_REGISTER_ENUMS_H
+#define LLDB_SOURCE_REGISTER_ARCH_LLDB_ARM64_REGISTER_ENUMS_H
namespace lldb_private {
// LLDB register codes (e.g. RegisterKind == eRegisterKindLLDB)
@@ -261,4 +261,4 @@ enum {
};
}
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_LLDB_ARM64_REGISTER_ENUMS_H
+#endif // LLDB_SOURCE_REGISTER_ARCH_LLDB_ARM64_REGISTER_ENUMS_H
diff --git a/lldb/source/Plugins/Process/Utility/lldb-loongarch-register-enums.h b/lldb/source/Register/Arch/lldb-loongarch-register-enums.h
similarity index 96%
rename from lldb/source/Plugins/Process/Utility/lldb-loongarch-register-enums.h
rename to lldb/source/Register/Arch/lldb-loongarch-register-enums.h
index accd53048f93e2..22726cf98de320 100644
--- a/lldb/source/Plugins/Process/Utility/lldb-loongarch-register-enums.h
+++ b/lldb/source/Register/Arch/lldb-loongarch-register-enums.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_LLDB_LOONGARCH_REGISTER_ENUMS_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_LLDB_LOONGARCH_REGISTER_ENUMS_H
+#ifndef LLDB_SOURCE_REGISTER_ARCH_LLDB_LOONGARCH_REGISTER_ENUMS_H
+#define LLDB_SOURCE_REGISTER_ARCH_LLDB_LOONGARCH_REGISTER_ENUMS_H
// LLDB register codes (e.g. RegisterKind == eRegisterKindLLDB)
@@ -245,4 +245,4 @@ enum {
k_num_registers_loongarch
};
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_LLDB_LOONGARCH_REGISTER_ENUMS_H
+#endif // LLDB_SOURCE_REGISTER_ARCH_LLDB_LOONGARCH_REGISTER_ENUMS_H
diff --git a/lldb/source/Plugins/Process/Utility/lldb-ppc64-register-enums.h b/lldb/source/Register/Arch/lldb-ppc64-register-enums.h
similarity index 94%
rename from lldb/source/Plugins/Process/Utility/lldb-ppc64-register-enums.h
rename to lldb/source/Register/Arch/lldb-ppc64-register-enums.h
index 19525b2c4ee34b..5f9e6604c4026d 100644
--- a/lldb/source/Plugins/Process/Utility/lldb-ppc64-register-enums.h
+++ b/lldb/source/Register/Arch/lldb-ppc64-register-enums.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_LLDB_PPC64_REGISTER_ENUMS_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_LLDB_PPC64_REGISTER_ENUMS_H
+#ifndef LLDB_SOURCE_REGISTER_ARCH_LLDB_PPC64_REGISTER_ENUMS_H
+#define LLDB_SOURCE_REGISTER_ARCH_LLDB_PPC64_REGISTER_ENUMS_H
// LLDB register codes (e.g. RegisterKind == eRegisterKindLLDB)
@@ -201,4 +201,4 @@ enum {
k_num_vsx_registers_ppc64 = k_last_vsx_ppc64 - k_first_vsx_ppc64 + 1,
};
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_LLDB_PPC64_REGISTER_ENUMS_H
+#endif // LLDB_SOURCE_REGISTER_ARCH_LLDB_PPC64_REGISTER_ENUMS_H
diff --git a/lldb/source/Plugins/Process/Utility/lldb-ppc64le-register-enums.h b/lldb/source/Register/Arch/lldb-ppc64le-register-enums.h
similarity index 95%
rename from lldb/source/Plugins/Process/Utility/lldb-ppc64le-register-enums.h
rename to lldb/source/Register/Arch/lldb-ppc64le-register-enums.h
index a7b5bc5ad9e342..53df636bb2dfa4 100644
--- a/lldb/source/Plugins/Process/Utility/lldb-ppc64le-register-enums.h
+++ b/lldb/source/Register/Arch/lldb-ppc64le-register-enums.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_LLDB_PPC64LE_REGISTER_ENUMS_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_LLDB_PPC64LE_REGISTER_ENUMS_H
+#ifndef LLDB_SOURCE_REGISTER_ARCH_LLDB_PPC64LE_REGISTER_ENUMS_H
+#define LLDB_SOURCE_REGISTER_ARCH_LLDB_PPC64LE_REGISTER_ENUMS_H
// LLDB register codes (e.g. RegisterKind == eRegisterKindLLDB)
@@ -204,4 +204,4 @@ enum {
k_num_vsx_registers_ppc64le = k_last_vsx_ppc64le - k_first_vsx_ppc64le + 1,
};
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_LLDB_PPC64LE_REGISTER_ENUMS_H
+#endif // LLDB_SOURCE_REGISTER_ARCH_LLDB_PPC64LE_REGISTER_ENUMS_H
diff --git a/lldb/source/Plugins/Process/Utility/lldb-riscv-register-enums.h b/lldb/source/Register/Arch/lldb-riscv-register-enums.h
similarity index 99%
rename from lldb/source/Plugins/Process/Utility/lldb-riscv-register-enums.h
rename to lldb/source/Register/Arch/lldb-riscv-register-enums.h
index 1d3a7189583303..edad96d91e4c17 100644
--- a/lldb/source/Plugins/Process/Utility/lldb-riscv-register-enums.h
+++ b/lldb/source/Register/Arch/lldb-riscv-register-enums.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_LLDB_RISCV_REGISTER_ENUMS_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_LLDB_RISCV_REGISTER_ENUMS_H
+#ifndef LLDB_SOURCE_REGISTER_ARCH_LLDB_RISCV_REGISTER_ENUMS_H
+#define LLDB_SOURCE_REGISTER_ARCH_LLDB_RISCV_REGISTER_ENUMS_H
// LLDB register codes (e.g. RegisterKind == eRegisterKindLLDB)
@@ -4730,4 +4730,4 @@ enum {
k_num_registers_riscv
};
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_LLDB_RISCV_REGISTER_ENUMS_H
+#endif // LLDB_SOURCE_REGISTER_ARCH_LLDB_RISCV_REGISTER_ENUMS_H
diff --git a/lldb/source/Plugins/Process/Utility/lldb-s390x-register-enums.h b/lldb/source/Register/Arch/lldb-s390x-register-enums.h
similarity index 90%
rename from lldb/source/Plugins/Process/Utility/lldb-s390x-register-enums.h
rename to lldb/source/Register/Arch/lldb-s390x-register-enums.h
index 23c441e1c8038e..4b2d09ae968e2f 100644
--- a/lldb/source/Plugins/Process/Utility/lldb-s390x-register-enums.h
+++ b/lldb/source/Register/Arch/lldb-s390x-register-enums.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_LLDB_S390X_REGISTER_ENUMS_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_LLDB_S390X_REGISTER_ENUMS_H
+#ifndef LLDB_SOURCE_REGISTER_ARCH_LLDB_S390X_REGISTER_ENUMS_H
+#define LLDB_SOURCE_REGISTER_ARCH_LLDB_S390X_REGISTER_ENUMS_H
namespace lldb_private {
// LLDB register codes (e.g. RegisterKind == eRegisterKindLLDB)
@@ -87,4 +87,4 @@ enum {
};
}
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_LLDB_S390X_REGISTER_ENUMS_H
+#endif // LLDB_SOURCE_REGISTER_ARCH_LLDB_S390X_REGISTER_ENUMS_H
diff --git a/lldb/source/Plugins/Process/Utility/lldb-x86-register-enums.h b/lldb/source/Register/Arch/lldb-x86-register-enums.h
similarity index 98%
rename from lldb/source/Plugins/Process/Utility/lldb-x86-register-enums.h
rename to lldb/source/Register/Arch/lldb-x86-register-enums.h
index 85aa254d662123..211160184ce2b8 100644
--- a/lldb/source/Plugins/Process/Utility/lldb-x86-register-enums.h
+++ b/lldb/source/Register/Arch/lldb-x86-register-enums.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_LLDB_X86_REGISTER_ENUMS_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_LLDB_X86_REGISTER_ENUMS_H
+#ifndef LLDB_SOURCE_REGISTER_ARCH_LLDB_X86_REGISTER_ENUMS_H
+#define LLDB_SOURCE_REGISTER_ARCH_LLDB_X86_REGISTER_ENUMS_H
namespace lldb_private {
// LLDB register codes (e.g. RegisterKind == eRegisterKindLLDB)
@@ -514,4 +514,4 @@ enum {
}
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_LLDB_X86_REGISTER_ENUMS_H
+#endif // LLDB_SOURCE_REGISTER_ARCH_LLDB_X86_REGISTER_ENUMS_H
diff --git a/lldb/source/Register/CMakeLists.txt b/lldb/source/Register/CMakeLists.txt
new file mode 100644
index 00000000000000..f3e26ab75c3824
--- /dev/null
+++ b/lldb/source/Register/CMakeLists.txt
@@ -0,0 +1,33 @@
+add_lldb_library(lldbRegister NO_PLUGIN_DEPENDENCIES
+ Arch/RegisterContext_x86.cpp
+ Arch/RegisterInfos_x86_64_with_base_shared.cpp
+ Common/RegisterInfoCommonDynamic_riscv32.cpp
+ Common/RegisterInfoCommon_arm.cpp
+ Common/RegisterInfoCommon_arm64.cpp
+ Common/RegisterInfoCommon_loongarch64.cpp
+ Common/RegisterInfoCommon_ppc64.cpp
+ Common/RegisterInfoCommon_ppc64le.cpp
+ Common/RegisterInfoCommon_riscv32.cpp
+ Common/RegisterInfoCommon_riscv64.cpp
+ Common/RegisterTypeDetector_arm64.cpp
+ FreeBSD/RegisterInfoFreeBSD_i386.cpp
+ FreeBSD/RegisterInfoFreeBSD_powerpc.cpp
+ FreeBSD/RegisterInfoFreeBSD_x86_64.cpp
+ Linux/RegisterInfoLinux_i386.cpp
+ Linux/RegisterInfoLinux_s390x.cpp
+ Linux/RegisterInfoLinux_x86_64.cpp
+ NetBSD/RegisterInfoNetBSD_i386.cpp
+ NetBSD/RegisterInfoNetBSD_x86_64.cpp
+ OpenBSD/RegisterInfoOpenBSD_i386.cpp
+ OpenBSD/RegisterInfoOpenBSD_x86_64.cpp
+ Windows/RegisterInfoWindows_i386.cpp
+ Windows/RegisterInfoWindows_x86_64.cpp
+
+ LINK_COMPONENTS
+ Support
+ TargetParser
+ LINK_LIBS
+ lldbUtility
+ ALLOWED_INTERNAL_DEPENDENCIES
+ lldbUtility
+ )
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoCommonDynamic_riscv32.cpp b/lldb/source/Register/Common/RegisterInfoCommonDynamic_riscv32.cpp
similarity index 97%
rename from lldb/source/Plugins/Process/Utility/RegisterInfoCommonDynamic_riscv32.cpp
rename to lldb/source/Register/Common/RegisterInfoCommonDynamic_riscv32.cpp
index 0fc22c04d26db8..1c5fbd39f4b7f3 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfoCommonDynamic_riscv32.cpp
+++ b/lldb/source/Register/Common/RegisterInfoCommonDynamic_riscv32.cpp
@@ -6,9 +6,9 @@
//
//===----------------------------------------------------------------------===//
-#include "RegisterInfoCommonDynamic_riscv32.h"
+#include "Register/Common/RegisterInfoCommonDynamic_riscv32.h"
-#include "lldb-riscv-register-enums.h"
+#include "Register/Arch/lldb-riscv-register-enums.h"
#include "lldb/lldb-defines.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/Support/Compiler.h"
@@ -19,7 +19,7 @@
#define FPR_OFFSET(idx) ((idx) * sizeof(uint32_t))
#define DECLARE_REGISTER_INFOS_RISCV32_STRUCT
-#include "Plugins/Process/Utility/RegisterInfos_riscv32.h"
+#include "Register/Arch/RegisterInfos_riscv32.h"
#undef DECLARE_REGISTER_INFOS_RISCV32_STRUCT
RegisterInfoCommonDynamic_riscv32::RegisterInfoCommonDynamic_riscv32(
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoCommonDynamic_riscv32.h b/lldb/source/Register/Common/RegisterInfoCommonDynamic_riscv32.h
similarity index 89%
rename from lldb/source/Plugins/Process/Utility/RegisterInfoCommonDynamic_riscv32.h
rename to lldb/source/Register/Common/RegisterInfoCommonDynamic_riscv32.h
index c02662de68dd2c..7707d8588cdfac 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfoCommonDynamic_riscv32.h
+++ b/lldb/source/Register/Common/RegisterInfoCommonDynamic_riscv32.h
@@ -6,10 +6,10 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOCOMMONDYNAMIC_RISCV32_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOCOMMONDYNAMIC_RISCV32_H
+#ifndef LLDB_SOURCE_REGISTER_COMMON_REGISTERINFOCOMMONDYNAMIC_RISCV32_H
+#define LLDB_SOURCE_REGISTER_COMMON_REGISTERINFOCOMMONDYNAMIC_RISCV32_H
-#include "RegisterInfoAndSetInterface.h"
+#include "Register/RegisterInfoAndSetInterface.h"
#include "lldb/Target/DynamicRegisterInfo.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/lldb-private.h"
@@ -67,4 +67,4 @@ class RegisterInfoCommonDynamic_riscv32
llvm::SmallVectorImpl<lldb_private::RegisterInfo> &cs_reg_infos);
};
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOCOMMONDYNAMIC_RISCV32_H
+#endif // LLDB_SOURCE_REGISTER_COMMON_REGISTERINFOCOMMONDYNAMIC_RISCV32_H
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_arm.cpp b/lldb/source/Register/Common/RegisterInfoCommon_arm.cpp
similarity index 98%
rename from lldb/source/Plugins/Process/Utility/RegisterInfoCommon_arm.cpp
rename to lldb/source/Register/Common/RegisterInfoCommon_arm.cpp
index 5af7bd5dd1ceec..3963362e025223 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_arm.cpp
+++ b/lldb/source/Register/Common/RegisterInfoCommon_arm.cpp
@@ -13,7 +13,7 @@
#include "lldb/lldb-defines.h"
#include "llvm/Support/Compiler.h"
-#include "RegisterInfoCommon_arm.h"
+#include "Register/Common/RegisterInfoCommon_arm.h"
using namespace lldb;
using namespace lldb_private;
@@ -47,7 +47,7 @@ using namespace lldb_private;
// Include RegisterInfos_arm to declare our g_register_infos_arm structure.
#define DECLARE_REGISTER_INFOS_ARM_STRUCT
-#include "RegisterInfos_arm.h"
+#include "Register/Arch/RegisterInfos_arm.h"
#undef DECLARE_REGISTER_INFOS_ARM_STRUCT
static const lldb_private::RegisterInfo *
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_arm.h b/lldb/source/Register/Common/RegisterInfoCommon_arm.h
similarity index 88%
rename from lldb/source/Plugins/Process/Utility/RegisterInfoCommon_arm.h
rename to lldb/source/Register/Common/RegisterInfoCommon_arm.h
index 7045dc56958919..edeec29834bbf2 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_arm.h
+++ b/lldb/source/Register/Common/RegisterInfoCommon_arm.h
@@ -6,10 +6,10 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOCOMMON_ARM_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOCOMMON_ARM_H
+#ifndef LLDB_SOURCE_REGISTER_COMMON_REGISTERINFOCOMMON_ARM_H
+#define LLDB_SOURCE_REGISTER_COMMON_REGISTERINFOCOMMON_ARM_H
-#include "RegisterInfoAndSetInterface.h"
+#include "Register/RegisterInfoAndSetInterface.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/lldb-private.h"
@@ -77,4 +77,4 @@ class RegisterInfoCommon_arm : public lldb_private::RegisterInfoAndSetInterface
bool m_has_tls_reg;
};
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOCOMMON_ARM_H
+#endif // LLDB_SOURCE_REGISTER_COMMON_REGISTERINFOCOMMON_ARM_H
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_arm64.cpp b/lldb/source/Register/Common/RegisterInfoCommon_arm64.cpp
similarity index 99%
rename from lldb/source/Plugins/Process/Utility/RegisterInfoCommon_arm64.cpp
rename to lldb/source/Register/Common/RegisterInfoCommon_arm64.cpp
index e2ba9384c361ba..7a99329654594a 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_arm64.cpp
+++ b/lldb/source/Register/Common/RegisterInfoCommon_arm64.cpp
@@ -13,7 +13,7 @@
#include "lldb/lldb-defines.h"
#include "llvm/Support/Compiler.h"
-#include "RegisterInfoCommon_arm64.h"
+#include "Register/Common/RegisterInfoCommon_arm64.h"
// Based on RegisterContextDarwin_arm64.cpp
#define GPR_OFFSET(idx) ((idx)*8)
@@ -68,8 +68,8 @@
// Include RegisterInfos_arm64 to declare our g_register_infos_arm64 structure.
#define DECLARE_REGISTER_INFOS_ARM64_STRUCT
-#include "RegisterInfos_arm64.h"
-#include "RegisterInfos_arm64_sve.h"
+#include "Register/Arch/RegisterInfos_arm64.h"
+#include "Register/Arch/RegisterInfos_arm64_sve.h"
#undef DECLARE_REGISTER_INFOS_ARM64_STRUCT
static lldb_private::RegisterInfo g_register_infos_pauth[] = {
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_arm64.h b/lldb/source/Register/Common/RegisterInfoCommon_arm64.h
similarity index 97%
rename from lldb/source/Plugins/Process/Utility/RegisterInfoCommon_arm64.h
rename to lldb/source/Register/Common/RegisterInfoCommon_arm64.h
index e80e4c76d5fe86..a3b94be43c7883 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_arm64.h
+++ b/lldb/source/Register/Common/RegisterInfoCommon_arm64.h
@@ -6,10 +6,10 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOCOMMON_ARM64_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOCOMMON_ARM64_H
+#ifndef LLDB_SOURCE_REGISTER_COMMON_REGISTERINFOCOMMON_ARM64_H
+#define LLDB_SOURCE_REGISTER_COMMON_REGISTERINFOCOMMON_ARM64_H
-#include "RegisterInfoAndSetInterface.h"
+#include "Register/RegisterInfoAndSetInterface.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/Utility/Flags.h"
#include "lldb/lldb-private.h"
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_loongarch64.cpp b/lldb/source/Register/Common/RegisterInfoCommon_loongarch64.cpp
similarity index 98%
rename from lldb/source/Plugins/Process/Utility/RegisterInfoCommon_loongarch64.cpp
rename to lldb/source/Register/Common/RegisterInfoCommon_loongarch64.cpp
index 95f491671c1e91..e97ba7f5f11c07 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_loongarch64.cpp
+++ b/lldb/source/Register/Common/RegisterInfoCommon_loongarch64.cpp
@@ -13,7 +13,7 @@
#include "lldb/lldb-defines.h"
#include "llvm/Support/Compiler.h"
-#include "RegisterInfoCommon_loongarch64.h"
+#include "Register/Common/RegisterInfoCommon_loongarch64.h"
#define GPR_OFFSET(idx) ((idx)*8 + 0)
#define FPR_OFFSET(idx) ((idx)*8 + sizeof(RegisterInfoCommon_loongarch64::GPR))
@@ -34,7 +34,7 @@
sizeof(RegisterInfoCommon_loongarch64::LASX))
#define DECLARE_REGISTER_INFOS_LOONGARCH64_STRUCT
-#include "RegisterInfos_loongarch64.h"
+#include "Register/Arch/RegisterInfos_loongarch64.h"
#undef DECLARE_REGISTER_INFOS_LOONGARCH64_STRUCT
const lldb_private::RegisterInfo *
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_loongarch64.h b/lldb/source/Register/Common/RegisterInfoCommon_loongarch64.h
similarity index 90%
rename from lldb/source/Plugins/Process/Utility/RegisterInfoCommon_loongarch64.h
rename to lldb/source/Register/Common/RegisterInfoCommon_loongarch64.h
index 65941db7244fa5..8438a57c8b33f8 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_loongarch64.h
+++ b/lldb/source/Register/Common/RegisterInfoCommon_loongarch64.h
@@ -6,10 +6,10 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOCOMMON_LOONGARCH64_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOCOMMON_LOONGARCH64_H
+#ifndef LLDB_SOURCE_REGISTER_COMMON_REGISTERINFOCOMMON_LOONGARCH64_H
+#define LLDB_SOURCE_REGISTER_COMMON_REGISTERINFOCOMMON_LOONGARCH64_H
-#include "RegisterInfoAndSetInterface.h"
+#include "Register/RegisterInfoAndSetInterface.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/lldb-private.h"
#include <map>
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_ppc64.cpp b/lldb/source/Register/Common/RegisterInfoCommon_ppc64.cpp
similarity index 95%
rename from lldb/source/Plugins/Process/Utility/RegisterInfoCommon_ppc64.cpp
rename to lldb/source/Register/Common/RegisterInfoCommon_ppc64.cpp
index 43a675c4cd4a88..feb6e5d577f661 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_ppc64.cpp
+++ b/lldb/source/Register/Common/RegisterInfoCommon_ppc64.cpp
@@ -13,11 +13,11 @@
#include "lldb/lldb-defines.h"
#include "llvm/Support/Compiler.h"
-#include "RegisterInfoCommon_ppc64.h"
+#include "Register/Common/RegisterInfoCommon_ppc64.h"
// Include RegisterInfoCommon_ppc64 to declare our g_register_infos_ppc64
#define DECLARE_REGISTER_INFOS_PPC64_STRUCT
-#include "RegisterInfos_ppc64.h"
+#include "Register/Arch/RegisterInfos_ppc64.h"
#undef DECLARE_REGISTER_INFOS_PPC64_STRUCT
static const lldb_private::RegisterInfo *
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_ppc64.h b/lldb/source/Register/Common/RegisterInfoCommon_ppc64.h
similarity index 77%
rename from lldb/source/Plugins/Process/Utility/RegisterInfoCommon_ppc64.h
rename to lldb/source/Register/Common/RegisterInfoCommon_ppc64.h
index 64f8c384a87562..51a3cac7188e7a 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_ppc64.h
+++ b/lldb/source/Register/Common/RegisterInfoCommon_ppc64.h
@@ -6,10 +6,10 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOCOMMON_PPC64_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOCOMMON_PPC64_H
+#ifndef LLDB_SOURCE_REGISTER_COMMON_REGISTERINFOCOMMON_PPC64_H
+#define LLDB_SOURCE_REGISTER_COMMON_REGISTERINFOCOMMON_PPC64_H
-#include "RegisterInfoInterface.h"
+#include "Register/RegisterInfoInterface.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/lldb-private.h"
@@ -29,4 +29,4 @@ class RegisterInfoCommon_ppc64 : public lldb_private::RegisterInfoInterface {
size_t m_gpr_size;
};
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOCOMMON_PPC64_H
+#endif // LLDB_SOURCE_REGISTER_COMMON_REGISTERINFOCOMMON_PPC64_H
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_ppc64le.cpp b/lldb/source/Register/Common/RegisterInfoCommon_ppc64le.cpp
similarity index 94%
rename from lldb/source/Plugins/Process/Utility/RegisterInfoCommon_ppc64le.cpp
rename to lldb/source/Register/Common/RegisterInfoCommon_ppc64le.cpp
index 1b558ce5039593..09a28d7bb5a168 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_ppc64le.cpp
+++ b/lldb/source/Register/Common/RegisterInfoCommon_ppc64le.cpp
@@ -13,11 +13,11 @@
#include "lldb/lldb-defines.h"
#include "llvm/Support/Compiler.h"
-#include "RegisterInfoCommon_ppc64le.h"
+#include "Register/Common/RegisterInfoCommon_ppc64le.h"
// Include RegisterInfoCommon_ppc64le to declare our g_register_infos_ppc64le
#define DECLARE_REGISTER_INFOS_PPC64LE_STRUCT
-#include "RegisterInfos_ppc64le.h"
+#include "Register/Arch/RegisterInfos_ppc64le.h"
#undef DECLARE_REGISTER_INFOS_PPC64LE_STRUCT
static const lldb_private::RegisterInfo *
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_ppc64le.h b/lldb/source/Register/Common/RegisterInfoCommon_ppc64le.h
similarity index 82%
rename from lldb/source/Plugins/Process/Utility/RegisterInfoCommon_ppc64le.h
rename to lldb/source/Register/Common/RegisterInfoCommon_ppc64le.h
index aae01666a7951e..62a020c16e7c39 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_ppc64le.h
+++ b/lldb/source/Register/Common/RegisterInfoCommon_ppc64le.h
@@ -6,10 +6,10 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOCOMMON_PPC64LE_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOCOMMON_PPC64LE_H
+#ifndef LLDB_SOURCE_REGISTER_COMMON_REGISTERINFOCOMMON_PPC64LE_H
+#define LLDB_SOURCE_REGISTER_COMMON_REGISTERINFOCOMMON_PPC64LE_H
-#include "RegisterInfoInterface.h"
+#include "Register/RegisterInfoInterface.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/lldb-private.h"
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_riscv32.cpp b/lldb/source/Register/Common/RegisterInfoCommon_riscv32.cpp
similarity index 98%
rename from lldb/source/Plugins/Process/Utility/RegisterInfoCommon_riscv32.cpp
rename to lldb/source/Register/Common/RegisterInfoCommon_riscv32.cpp
index 69e302e87d1001..558acff325af8e 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_riscv32.cpp
+++ b/lldb/source/Register/Common/RegisterInfoCommon_riscv32.cpp
@@ -6,7 +6,7 @@
//
//===---------------------------------------------------------------------===//
-#include "RegisterInfoCommon_riscv32.h"
+#include "Register/Common/RegisterInfoCommon_riscv32.h"
#include "lldb/Utility/Flags.h"
#include "lldb/lldb-defines.h"
#include "llvm/Support/Compiler.h"
@@ -22,7 +22,7 @@
sizeof(RegisterInfoCommon_riscv32::FPR))
#define DECLARE_REGISTER_INFOS_RISCV32_STRUCT
-#include "RegisterInfos_riscv32.h"
+#include "Register/Arch/RegisterInfos_riscv32.h"
#undef DECLARE_REGISTER_INFOS_RISCV32_STRUCT
const lldb_private::RegisterInfo *RegisterInfoCommon_riscv32::GetRegisterInfoPtr(
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_riscv32.h b/lldb/source/Register/Common/RegisterInfoCommon_riscv32.h
similarity index 90%
rename from lldb/source/Plugins/Process/Utility/RegisterInfoCommon_riscv32.h
rename to lldb/source/Register/Common/RegisterInfoCommon_riscv32.h
index bcdec7767ee4d6..74363b169a34f0 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_riscv32.h
+++ b/lldb/source/Register/Common/RegisterInfoCommon_riscv32.h
@@ -6,10 +6,10 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOCOMMON_RISCV32_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOCOMMON_RISCV32_H
+#ifndef LLDB_SOURCE_REGISTER_COMMON_REGISTERINFOCOMMON_RISCV32_H
+#define LLDB_SOURCE_REGISTER_COMMON_REGISTERINFOCOMMON_RISCV32_H
-#include "RegisterInfoAndSetInterface.h"
+#include "Register/RegisterInfoAndSetInterface.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/Utility/Flags.h"
#include "lldb/lldb-private.h"
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_riscv64.cpp b/lldb/source/Register/Common/RegisterInfoCommon_riscv64.cpp
similarity index 98%
rename from lldb/source/Plugins/Process/Utility/RegisterInfoCommon_riscv64.cpp
rename to lldb/source/Register/Common/RegisterInfoCommon_riscv64.cpp
index f2490817e2a1de..8f7e50b93e23ed 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_riscv64.cpp
+++ b/lldb/source/Register/Common/RegisterInfoCommon_riscv64.cpp
@@ -6,7 +6,7 @@
//
//===---------------------------------------------------------------------===//
-#include "RegisterInfoCommon_riscv64.h"
+#include "Register/Common/RegisterInfoCommon_riscv64.h"
#include "lldb/Utility/Flags.h"
#include "lldb/lldb-defines.h"
#include "llvm/Support/Compiler.h"
@@ -18,7 +18,7 @@
#define FPR_OFFSET(idx) ((idx)*8 + sizeof(RegisterInfoCommon_riscv64::GPR))
#define DECLARE_REGISTER_INFOS_RISCV64_STRUCT
-#include "RegisterInfos_riscv64.h"
+#include "Register/Arch/RegisterInfos_riscv64.h"
#undef DECLARE_REGISTER_INFOS_RISCV64_STRUCT
// Number of register sets provided by this context.
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_riscv64.h b/lldb/source/Register/Common/RegisterInfoCommon_riscv64.h
similarity index 92%
rename from lldb/source/Plugins/Process/Utility/RegisterInfoCommon_riscv64.h
rename to lldb/source/Register/Common/RegisterInfoCommon_riscv64.h
index 72d051fee3916a..a46874fa7f42d2 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfoCommon_riscv64.h
+++ b/lldb/source/Register/Common/RegisterInfoCommon_riscv64.h
@@ -6,10 +6,10 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOCOMMON_RISCV64_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOCOMMON_RISCV64_H
+#ifndef LLDB_SOURCE_REGISTER_COMMON_REGISTERINFOCOMMON_RISCV64_H
+#define LLDB_SOURCE_REGISTER_COMMON_REGISTERINFOCOMMON_RISCV64_H
-#include "RegisterInfoAndSetInterface.h"
+#include "Register/RegisterInfoAndSetInterface.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/Utility/Flags.h"
#include "lldb/lldb-private.h"
diff --git a/lldb/source/Plugins/Process/Utility/RegisterTypeDetector_arm64.cpp b/lldb/source/Register/Common/RegisterTypeDetector_arm64.cpp
similarity index 99%
rename from lldb/source/Plugins/Process/Utility/RegisterTypeDetector_arm64.cpp
rename to lldb/source/Register/Common/RegisterTypeDetector_arm64.cpp
index ffeb6e99aabf88..7496ab48e08912 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterTypeDetector_arm64.cpp
+++ b/lldb/source/Register/Common/RegisterTypeDetector_arm64.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "RegisterTypeDetector_arm64.h"
+#include "Register/Common/RegisterTypeDetector_arm64.h"
#include "lldb/Utility/RegisterTypeFlags.h"
#include <functional>
diff --git a/lldb/source/Plugins/Process/Utility/RegisterTypeDetector_arm64.h b/lldb/source/Register/Common/RegisterTypeDetector_arm64.h
similarity index 96%
rename from lldb/source/Plugins/Process/Utility/RegisterTypeDetector_arm64.h
rename to lldb/source/Register/Common/RegisterTypeDetector_arm64.h
index a5b39a78b92f39..3d2dd502b94c32 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterTypeDetector_arm64.h
+++ b/lldb/source/Register/Common/RegisterTypeDetector_arm64.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERTYPEDETECTOR_ARM64_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERTYPEDETECTOR_ARM64_H
+#ifndef LLDB_SOURCE_REGISTER_COMMON_REGISTERTYPEDETECTOR_ARM64_H
+#define LLDB_SOURCE_REGISTER_COMMON_REGISTERTYPEDETECTOR_ARM64_H
#include "lldb/Utility/RegisterInfo.h"
#include "lldb/Utility/RegisterType.h"
@@ -127,4 +127,4 @@ class Arm64RegisterTypeDetector {
} // namespace lldb_private
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERTYPEDETECTOR_ARM64_H
+#endif // LLDB_SOURCE_REGISTER_COMMON_REGISTERTYPEDETECTOR_ARM64_H
diff --git a/lldb/source/Register/FreeBSD/RegisterInfoFreeBSD_i386.cpp b/lldb/source/Register/FreeBSD/RegisterInfoFreeBSD_i386.cpp
new file mode 100644
index 00000000000000..1410a98160c7f3
--- /dev/null
+++ b/lldb/source/Register/FreeBSD/RegisterInfoFreeBSD_i386.cpp
@@ -0,0 +1,85 @@
+//===-- RegisterInfoFreeBSD_i386.cpp -----------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===---------------------------------------------------------------------===//
+
+#include "Register/FreeBSD/RegisterInfoFreeBSD_i386.h"
+#include "Register/Arch/RegisterContext_x86.h"
+#include "Register/Arch/lldb-x86-register-enums.h"
+#include "lldb/lldb-defines.h"
+
+using namespace lldb_private;
+using namespace lldb;
+
+// https://cgit.freebsd.org/src/tree/sys/x86/include/reg.h?h=stable/14
+struct GPR {
+ uint32_t fs;
+ uint32_t es;
+ uint32_t ds;
+ uint32_t edi;
+ uint32_t esi;
+ uint32_t ebp;
+ uint32_t isp;
+ uint32_t ebx;
+ uint32_t edx;
+ uint32_t ecx;
+ uint32_t eax;
+ uint32_t trapno;
+ uint32_t err;
+ uint32_t eip;
+ uint32_t cs;
+ uint32_t eflags;
+ uint32_t esp;
+ uint32_t ss;
+ uint32_t gs;
+};
+
+struct DBG {
+ uint32_t dr[8]; /* debug registers */
+ /* Index 0-3: debug address registers */
+ /* Index 4-5: reserved */
+ /* Index 6: debug status */
+ /* Index 7: debug control */
+};
+
+using FPR_i386 = FXSAVE;
+
+struct UserArea {
+ GPR gpr;
+ FPR_i386 i387;
+ DBG dbg;
+};
+
+#define DR_SIZE sizeof(uint32_t)
+#define DR_OFFSET(reg_index) \
+ (LLVM_EXTENSION offsetof(UserArea, dbg) + \
+ LLVM_EXTENSION offsetof(DBG, dr[reg_index]))
+
+// Include RegisterInfos_i386 to declare our g_register_infos_i386 structure.
+#define DECLARE_REGISTER_INFOS_I386_STRUCT
+#include "Register/Arch/RegisterInfos_i386.h"
+#undef DECLARE_REGISTER_INFOS_I386_STRUCT
+
+RegisterInfoFreeBSD_i386::RegisterInfoFreeBSD_i386(
+ const ArchSpec &target_arch)
+ : RegisterInfoInterface(target_arch) {}
+
+size_t RegisterInfoFreeBSD_i386::GetGPRSize() const { return sizeof(GPR); }
+
+const RegisterInfo *RegisterInfoFreeBSD_i386::GetRegisterInfo() const {
+ switch (GetTargetArchitecture().GetMachine()) {
+ case llvm::Triple::x86:
+ return g_register_infos_i386;
+ default:
+ assert(false && "Unhandled target architecture.");
+ return nullptr;
+ }
+}
+
+uint32_t RegisterInfoFreeBSD_i386::GetRegisterCount() const {
+ return static_cast<uint32_t>(sizeof(g_register_infos_i386) /
+ sizeof(g_register_infos_i386[0]));
+}
diff --git a/lldb/source/Register/FreeBSD/RegisterInfoFreeBSD_i386.h b/lldb/source/Register/FreeBSD/RegisterInfoFreeBSD_i386.h
new file mode 100644
index 00000000000000..8318ea2b2bce76
--- /dev/null
+++ b/lldb/source/Register/FreeBSD/RegisterInfoFreeBSD_i386.h
@@ -0,0 +1,25 @@
+//===-- RegisterInfoFreeBSD_i386.h ---------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_SOURCE_REGISTER_FREEBSD_REGISTERINFOFREEBSD_I386_H
+#define LLDB_SOURCE_REGISTER_FREEBSD_REGISTERINFOFREEBSD_I386_H
+
+#include "Register/RegisterInfoInterface.h"
+
+class RegisterInfoFreeBSD_i386 : public lldb_private::RegisterInfoInterface {
+public:
+ RegisterInfoFreeBSD_i386(const lldb_private::ArchSpec &target_arch);
+
+ size_t GetGPRSize() const override;
+
+ const lldb_private::RegisterInfo *GetRegisterInfo() const override;
+
+ uint32_t GetRegisterCount() const override;
+};
+
+#endif
diff --git a/lldb/source/Register/FreeBSD/RegisterInfoFreeBSD_powerpc.cpp b/lldb/source/Register/FreeBSD/RegisterInfoFreeBSD_powerpc.cpp
new file mode 100644
index 00000000000000..7213723fdfc1c0
--- /dev/null
+++ b/lldb/source/Register/FreeBSD/RegisterInfoFreeBSD_powerpc.cpp
@@ -0,0 +1,233 @@
+//===-- RegisterInfoFreeBSD_powerpc.cpp --------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===---------------------------------------------------------------------===//
+
+#include "Register/FreeBSD/RegisterInfoFreeBSD_powerpc.h"
+#include "Plugins/Process/Utility/RegisterContextPOSIX_powerpc.h"
+#include <vector>
+
+using namespace lldb_private;
+using namespace lldb;
+
+// https://cgit.freebsd.org/src/tree/sys/powerpc/include/reg.h
+typedef struct _GPR64 {
+ uint64_t r0;
+ uint64_t r1;
+ uint64_t r2;
+ uint64_t r3;
+ uint64_t r4;
+ uint64_t r5;
+ uint64_t r6;
+ uint64_t r7;
+ uint64_t r8;
+ uint64_t r9;
+ uint64_t r10;
+ uint64_t r11;
+ uint64_t r12;
+ uint64_t r13;
+ uint64_t r14;
+ uint64_t r15;
+ uint64_t r16;
+ uint64_t r17;
+ uint64_t r18;
+ uint64_t r19;
+ uint64_t r20;
+ uint64_t r21;
+ uint64_t r22;
+ uint64_t r23;
+ uint64_t r24;
+ uint64_t r25;
+ uint64_t r26;
+ uint64_t r27;
+ uint64_t r28;
+ uint64_t r29;
+ uint64_t r30;
+ uint64_t r31;
+ uint64_t lr;
+ uint64_t cr;
+ uint64_t xer;
+ uint64_t ctr;
+ uint64_t pc;
+} GPR64;
+
+typedef struct _GPR32 {
+ uint32_t r0;
+ uint32_t r1;
+ uint32_t r2;
+ uint32_t r3;
+ uint32_t r4;
+ uint32_t r5;
+ uint32_t r6;
+ uint32_t r7;
+ uint32_t r8;
+ uint32_t r9;
+ uint32_t r10;
+ uint32_t r11;
+ uint32_t r12;
+ uint32_t r13;
+ uint32_t r14;
+ uint32_t r15;
+ uint32_t r16;
+ uint32_t r17;
+ uint32_t r18;
+ uint32_t r19;
+ uint32_t r20;
+ uint32_t r21;
+ uint32_t r22;
+ uint32_t r23;
+ uint32_t r24;
+ uint32_t r25;
+ uint32_t r26;
+ uint32_t r27;
+ uint32_t r28;
+ uint32_t r29;
+ uint32_t r30;
+ uint32_t r31;
+ uint32_t lr;
+ uint32_t cr;
+ uint32_t xer;
+ uint32_t ctr;
+ uint32_t pc;
+} GPR32;
+
+typedef struct _FPR {
+ uint64_t f0;
+ uint64_t f1;
+ uint64_t f2;
+ uint64_t f3;
+ uint64_t f4;
+ uint64_t f5;
+ uint64_t f6;
+ uint64_t f7;
+ uint64_t f8;
+ uint64_t f9;
+ uint64_t f10;
+ uint64_t f11;
+ uint64_t f12;
+ uint64_t f13;
+ uint64_t f14;
+ uint64_t f15;
+ uint64_t f16;
+ uint64_t f17;
+ uint64_t f18;
+ uint64_t f19;
+ uint64_t f20;
+ uint64_t f21;
+ uint64_t f22;
+ uint64_t f23;
+ uint64_t f24;
+ uint64_t f25;
+ uint64_t f26;
+ uint64_t f27;
+ uint64_t f28;
+ uint64_t f29;
+ uint64_t f30;
+ uint64_t f31;
+ uint64_t fpscr;
+} FPR;
+
+typedef struct _VMX {
+ uint32_t v0[4];
+ uint32_t v1[4];
+ uint32_t v2[4];
+ uint32_t v3[4];
+ uint32_t v4[4];
+ uint32_t v5[4];
+ uint32_t v6[4];
+ uint32_t v7[4];
+ uint32_t v8[4];
+ uint32_t v9[4];
+ uint32_t v10[4];
+ uint32_t v11[4];
+ uint32_t v12[4];
+ uint32_t v13[4];
+ uint32_t v14[4];
+ uint32_t v15[4];
+ uint32_t v16[4];
+ uint32_t v17[4];
+ uint32_t v18[4];
+ uint32_t v19[4];
+ uint32_t v20[4];
+ uint32_t v21[4];
+ uint32_t v22[4];
+ uint32_t v23[4];
+ uint32_t v24[4];
+ uint32_t v25[4];
+ uint32_t v26[4];
+ uint32_t v27[4];
+ uint32_t v28[4];
+ uint32_t v29[4];
+ uint32_t v30[4];
+ uint32_t v31[4];
+ uint32_t pad[2];
+ uint32_t vrsave;
+ uint32_t vscr;
+} VMX;
+
+// Include RegisterInfos_powerpc to declare our g_register_infos_powerpc
+// structure.
+#define DECLARE_REGISTER_INFOS_POWERPC_STRUCT
+#include "Register/Arch/RegisterInfos_powerpc.h"
+#undef DECLARE_REGISTER_INFOS_POWERPC_STRUCT
+
+RegisterInfoFreeBSD_powerpc::RegisterInfoFreeBSD_powerpc(
+ const ArchSpec &target_arch)
+ : RegisterInfoInterface(target_arch) {}
+
+RegisterInfoFreeBSD_powerpc::~RegisterInfoFreeBSD_powerpc() = default;
+
+size_t RegisterInfoFreeBSD_powerpc::GetGPRSize() const {
+ // This is an 'abstract' base, so no GPR struct.
+ return 0;
+}
+
+const RegisterInfo *RegisterInfoFreeBSD_powerpc::GetRegisterInfo() const {
+ llvm_unreachable("Abstract class!");
+ return nullptr;
+}
+
+uint32_t RegisterInfoFreeBSD_powerpc::GetRegisterCount() const { return 0; }
+
+RegisterInfoFreeBSD_powerpc32::RegisterInfoFreeBSD_powerpc32(
+ const ArchSpec &target_arch)
+ : RegisterInfoFreeBSD_powerpc(target_arch) {}
+
+RegisterInfoFreeBSD_powerpc32::~RegisterInfoFreeBSD_powerpc32() = default;
+
+size_t RegisterInfoFreeBSD_powerpc32::GetGPRSize() const {
+ return sizeof(GPR32);
+}
+
+const RegisterInfo *RegisterInfoFreeBSD_powerpc32::GetRegisterInfo() const {
+ return g_register_infos_powerpc32;
+}
+
+uint32_t RegisterInfoFreeBSD_powerpc32::GetRegisterCount() const {
+ return static_cast<uint32_t>(sizeof(g_register_infos_powerpc32) /
+ sizeof(g_register_infos_powerpc32[0]));
+}
+
+RegisterInfoFreeBSD_powerpc64::RegisterInfoFreeBSD_powerpc64(
+ const ArchSpec &target_arch)
+ : RegisterInfoFreeBSD_powerpc(target_arch) {}
+
+RegisterInfoFreeBSD_powerpc64::~RegisterInfoFreeBSD_powerpc64() = default;
+
+size_t RegisterInfoFreeBSD_powerpc64::GetGPRSize() const {
+ return sizeof(GPR64);
+}
+
+const RegisterInfo *RegisterInfoFreeBSD_powerpc64::GetRegisterInfo() const {
+ if (GetTargetArchitecture().GetMachine() == llvm::Triple::ppc)
+ return g_register_infos_powerpc64_32;
+ return g_register_infos_powerpc64;
+}
+
+uint32_t RegisterInfoFreeBSD_powerpc64::GetRegisterCount() const {
+ return static_cast<uint32_t>(sizeof(g_register_infos_powerpc64) /
+ sizeof(g_register_infos_powerpc64[0]));
+}
diff --git a/lldb/source/Register/FreeBSD/RegisterInfoFreeBSD_powerpc.h b/lldb/source/Register/FreeBSD/RegisterInfoFreeBSD_powerpc.h
new file mode 100644
index 00000000000000..2703b7ab88fbc7
--- /dev/null
+++ b/lldb/source/Register/FreeBSD/RegisterInfoFreeBSD_powerpc.h
@@ -0,0 +1,52 @@
+//===-- RegisterInfoFreeBSD_powerpc.h -------------------------*- C++
+//-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_SOURCE_REGISTER_FREEBSD_REGISTERINFOFREEBSD_POWERPC_H
+#define LLDB_SOURCE_REGISTER_FREEBSD_REGISTERINFOFREEBSD_POWERPC_H
+
+#include "Register/RegisterInfoInterface.h"
+
+class RegisterInfoFreeBSD_powerpc
+ : public lldb_private::RegisterInfoInterface {
+public:
+ RegisterInfoFreeBSD_powerpc(const lldb_private::ArchSpec &target_arch);
+ ~RegisterInfoFreeBSD_powerpc() override;
+
+ size_t GetGPRSize() const override;
+
+ const lldb_private::RegisterInfo *GetRegisterInfo() const override;
+
+ uint32_t GetRegisterCount() const override;
+};
+
+class RegisterInfoFreeBSD_powerpc32 : public RegisterInfoFreeBSD_powerpc {
+public:
+ RegisterInfoFreeBSD_powerpc32(const lldb_private::ArchSpec &target_arch);
+ ~RegisterInfoFreeBSD_powerpc32() override;
+
+ size_t GetGPRSize() const override;
+
+ const lldb_private::RegisterInfo *GetRegisterInfo() const override;
+
+ uint32_t GetRegisterCount() const override;
+};
+
+class RegisterInfoFreeBSD_powerpc64 : public RegisterInfoFreeBSD_powerpc {
+public:
+ RegisterInfoFreeBSD_powerpc64(const lldb_private::ArchSpec &target_arch);
+ ~RegisterInfoFreeBSD_powerpc64() override;
+
+ size_t GetGPRSize() const override;
+
+ const lldb_private::RegisterInfo *GetRegisterInfo() const override;
+
+ uint32_t GetRegisterCount() const override;
+};
+
+#endif // LLDB_SOURCE_REGISTER_FREEBSD_REGISTERINFOFREEBSD_POWERPC_H
diff --git a/lldb/source/Register/FreeBSD/RegisterInfoFreeBSD_x86_64.cpp b/lldb/source/Register/FreeBSD/RegisterInfoFreeBSD_x86_64.cpp
new file mode 100644
index 00000000000000..bf819f89da8d45
--- /dev/null
+++ b/lldb/source/Register/FreeBSD/RegisterInfoFreeBSD_x86_64.cpp
@@ -0,0 +1,143 @@
+//===-- RegisterInfoFreeBSD_x86_64.cpp ---------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===---------------------------------------------------------------------===//
+
+#include "Register/FreeBSD/RegisterInfoFreeBSD_x86_64.h"
+#include "Register/FreeBSD/RegisterInfoFreeBSD_i386.h"
+#include "Register/Arch/RegisterContext_x86.h"
+#include "Register/Arch/lldb-x86-register-enums.h"
+#include "lldb/lldb-defines.h"
+#include "llvm/Support/Threading.h"
+#include <vector>
+
+using namespace lldb_private;
+using namespace lldb;
+
+// https://cgit.freebsd.org/src/tree/sys/x86/include/reg.h
+typedef struct _GPR {
+ uint64_t r15;
+ uint64_t r14;
+ uint64_t r13;
+ uint64_t r12;
+ uint64_t r11;
+ uint64_t r10;
+ uint64_t r9;
+ uint64_t r8;
+ uint64_t rdi;
+ uint64_t rsi;
+ uint64_t rbp;
+ uint64_t rbx;
+ uint64_t rdx;
+ uint64_t rcx;
+ uint64_t rax;
+ uint32_t trapno;
+ uint16_t fs;
+ uint16_t gs;
+ uint32_t err;
+ uint16_t es;
+ uint16_t ds;
+ uint64_t rip;
+ uint64_t cs;
+ uint64_t rflags;
+ uint64_t rsp;
+ uint64_t ss;
+} GPR;
+
+struct DBG {
+ uint64_t dr[16]; /* debug registers */
+ /* Index 0-3: debug address registers */
+ /* Index 4-5: reserved */
+ /* Index 6: debug status */
+ /* Index 7: debug control */
+ /* Index 8-15: reserved */
+};
+
+struct UserArea {
+ GPR gpr;
+ FPR fpr;
+ DBG dbg;
+};
+
+#define DR_OFFSET(reg_index) \
+ (LLVM_EXTENSION offsetof(UserArea, dbg) + \
+ LLVM_EXTENSION offsetof(DBG, dr[reg_index]))
+
+// Include RegisterInfos_x86_64 to declare our g_register_infos_x86_64
+// structure.
+#define DECLARE_REGISTER_INFOS_X86_64_STRUCT
+#include "Register/Arch/RegisterInfos_x86_64.h"
+#undef DECLARE_REGISTER_INFOS_X86_64_STRUCT
+
+static std::vector<lldb_private::RegisterInfo> &
+GetSharedRegisterInfoVector_i386(const lldb_private::ArchSpec &arch) {
+ static std::vector<lldb_private::RegisterInfo> g_register_infos;
+ static llvm::once_flag g_initialized;
+ llvm::call_once(g_initialized, [&]() {
+ if (g_register_infos.empty()) {
+ // Copy the register information from base class
+ std::unique_ptr<RegisterInfoFreeBSD_i386> reg_interface(
+ new RegisterInfoFreeBSD_i386(arch));
+ const RegisterInfo *base_info = reg_interface->GetRegisterInfo();
+ g_register_infos.insert(g_register_infos.end(), &base_info[0],
+ &base_info[k_num_registers_i386]);
+
+// Include RegisterInfos_x86_64 to update the g_register_infos structure
+// with x86_64 offsets.
+#define UPDATE_REGISTER_INFOS_I386_STRUCT_WITH_X86_64_OFFSETS
+#include "Register/Arch/RegisterInfos_x86_64.h"
+#undef UPDATE_REGISTER_INFOS_I386_STRUCT_WITH_X86_64_OFFSETS
+ }
+ });
+ return g_register_infos;
+}
+
+static const RegisterInfo *
+PrivateGetRegisterInfoPtr(const lldb_private::ArchSpec &target_arch) {
+ switch (target_arch.GetMachine()) {
+ case llvm::Triple::x86:
+ return &GetSharedRegisterInfoVector_i386(target_arch)[0];
+ case llvm::Triple::x86_64:
+ return g_register_infos_x86_64;
+ default:
+ assert(false && "Unhandled target architecture.");
+ return nullptr;
+ }
+}
+
+static uint32_t
+PrivateGetRegisterCount(const lldb_private::ArchSpec &target_arch) {
+ switch (target_arch.GetMachine()) {
+ case llvm::Triple::x86:
+ // This vector should have already been filled.
+ assert(!GetSharedRegisterInfoVector_i386(target_arch).empty() &&
+ "i386 register info vector not filled.");
+ return static_cast<uint32_t>(
+ GetSharedRegisterInfoVector_i386(target_arch).size());
+ case llvm::Triple::x86_64:
+ return static_cast<uint32_t>(sizeof(g_register_infos_x86_64) /
+ sizeof(g_register_infos_x86_64[0]));
+ default:
+ assert(false && "Unhandled target architecture.");
+ return 0;
+ }
+}
+
+RegisterInfoFreeBSD_x86_64::RegisterInfoFreeBSD_x86_64(
+ const ArchSpec &target_arch)
+ : lldb_private::RegisterInfoInterface(target_arch),
+ m_register_info_p(PrivateGetRegisterInfoPtr(target_arch)),
+ m_register_count(PrivateGetRegisterCount(target_arch)) {}
+
+size_t RegisterInfoFreeBSD_x86_64::GetGPRSize() const { return sizeof(GPR); }
+
+const RegisterInfo *RegisterInfoFreeBSD_x86_64::GetRegisterInfo() const {
+ return m_register_info_p;
+}
+
+uint32_t RegisterInfoFreeBSD_x86_64::GetRegisterCount() const {
+ return m_register_count;
+}
diff --git a/lldb/source/Register/FreeBSD/RegisterInfoFreeBSD_x86_64.h b/lldb/source/Register/FreeBSD/RegisterInfoFreeBSD_x86_64.h
new file mode 100644
index 00000000000000..bef4595fe97035
--- /dev/null
+++ b/lldb/source/Register/FreeBSD/RegisterInfoFreeBSD_x86_64.h
@@ -0,0 +1,30 @@
+//===-- RegisterInfoFreeBSD_x86_64.h -------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_SOURCE_REGISTER_FREEBSD_REGISTERINFOFREEBSD_X86_64_H
+#define LLDB_SOURCE_REGISTER_FREEBSD_REGISTERINFOFREEBSD_X86_64_H
+
+#include "Register/RegisterInfoInterface.h"
+
+class RegisterInfoFreeBSD_x86_64
+ : public lldb_private::RegisterInfoInterface {
+public:
+ RegisterInfoFreeBSD_x86_64(const lldb_private::ArchSpec &target_arch);
+
+ size_t GetGPRSize() const override;
+
+ const lldb_private::RegisterInfo *GetRegisterInfo() const override;
+
+ uint32_t GetRegisterCount() const override;
+
+private:
+ const lldb_private::RegisterInfo *m_register_info_p;
+ const uint32_t m_register_count;
+};
+
+#endif
diff --git a/lldb/source/Register/Linux/RegisterInfoLinux_i386.cpp b/lldb/source/Register/Linux/RegisterInfoLinux_i386.cpp
new file mode 100644
index 00000000000000..01cf2621fbb680
--- /dev/null
+++ b/lldb/source/Register/Linux/RegisterInfoLinux_i386.cpp
@@ -0,0 +1,127 @@
+//===-- RegisterInfoLinux_i386.cpp -------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===---------------------------------------------------------------------===//
+
+#include "Register/Linux/RegisterInfoLinux_i386.h"
+#include "Register/Arch/RegisterContext_x86.h"
+#include "Register/Arch/lldb-x86-register-enums.h"
+#include "lldb/lldb-defines.h"
+
+using namespace lldb_private;
+using namespace lldb;
+
+struct GPR {
+ uint32_t ebx;
+ uint32_t ecx;
+ uint32_t edx;
+ uint32_t esi;
+ uint32_t edi;
+ uint32_t ebp;
+ uint32_t eax;
+ uint32_t ds;
+ uint32_t es;
+ uint32_t fs;
+ uint32_t gs;
+ uint32_t orig_eax;
+ uint32_t eip;
+ uint32_t cs;
+ uint32_t eflags;
+ uint32_t esp;
+ uint32_t ss;
+};
+
+struct FPR_i386 {
+ uint16_t fctrl; // FPU Control Word (fcw)
+ uint16_t fstat; // FPU Status Word (fsw)
+ uint16_t ftag; // FPU Tag Word (ftw)
+ uint16_t fop; // Last Instruction Opcode (fop)
+ union {
+ struct {
+ uint64_t fip; // Instruction Pointer
+ uint64_t fdp; // Data Pointer
+ } x86_64;
+ struct {
+ uint32_t fioff; // FPU IP Offset (fip)
+ uint32_t fiseg; // FPU IP Selector (fcs)
+ uint32_t fooff; // FPU Operand Pointer Offset (foo)
+ uint32_t foseg; // FPU Operand Pointer Selector (fos)
+ } i386_; // Added _ in the end to avoid error with gcc defining i386 in some
+ // cases
+ } ptr;
+ uint32_t mxcsr; // MXCSR Register State
+ uint32_t mxcsrmask; // MXCSR Mask
+ MMSReg stmm[8]; // 8*16 bytes for each FP-reg = 128 bytes
+ XMMReg xmm[8]; // 8*16 bytes for each XMM-reg = 128 bytes
+ uint32_t padding[56];
+};
+
+struct UserArea {
+ GPR regs; // General purpose registers.
+ int32_t fpvalid; // True if FPU is being used.
+ FPR_i386 i387; // FPU registers.
+ uint32_t tsize; // Text segment size.
+ uint32_t dsize; // Data segment size.
+ uint32_t ssize; // Stack segment size.
+ uint32_t start_code; // VM address of text.
+ uint32_t start_stack; // VM address of stack bottom (top in rsp).
+ int32_t signal; // Signal causing core dump.
+ int32_t reserved; // Unused.
+ uint32_t ar0; // Location of GPR's.
+ uint32_t fpstate; // Location of FPR's. Should be a FXSTATE *, but this
+ // has to be 32-bits even on 64-bit systems.
+ uint32_t magic; // Identifier for core dumps.
+ char u_comm[32]; // Command causing core dump.
+ uint32_t u_debugreg[8]; // Debug registers (DR0 - DR7).
+};
+
+#define DR_SIZE sizeof(((UserArea *)NULL)->u_debugreg[0])
+#define DR_0_OFFSET 0xFC
+#define DR_OFFSET(reg_index) (DR_0_OFFSET + (reg_index * 4))
+#define FPR_SIZE(reg) sizeof(((FPR_i386 *)NULL)->reg)
+
+// Include RegisterInfos_i386 to declare our g_register_infos_i386 structure.
+#define DECLARE_REGISTER_INFOS_I386_STRUCT
+#include "Register/Arch/RegisterInfos_i386.h"
+#undef DECLARE_REGISTER_INFOS_I386_STRUCT
+
+RegisterInfoLinux_i386::RegisterInfoLinux_i386(
+ const ArchSpec &target_arch)
+ : RegisterInfoLinux_x86(
+ target_arch,
+ {"orig_eax",
+ nullptr,
+ sizeof(((GPR *)nullptr)->orig_eax),
+ (LLVM_EXTENSION offsetof(GPR, orig_eax)),
+ eEncodingUint,
+ eFormatHex,
+ {LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM},
+ nullptr,
+ nullptr,
+ nullptr}) {}
+
+size_t RegisterInfoLinux_i386::GetGPRSizeStatic() { return sizeof(GPR); }
+
+const RegisterInfo *RegisterInfoLinux_i386::GetRegisterInfo() const {
+ switch (GetTargetArchitecture().GetMachine()) {
+ case llvm::Triple::x86:
+ case llvm::Triple::x86_64:
+ return g_register_infos_i386;
+ default:
+ assert(false && "Unhandled target architecture.");
+ return nullptr;
+ }
+}
+
+uint32_t RegisterInfoLinux_i386::GetRegisterCount() const {
+ return static_cast<uint32_t>(sizeof(g_register_infos_i386) /
+ sizeof(g_register_infos_i386[0]));
+}
+
+uint32_t RegisterInfoLinux_i386::GetUserRegisterCount() const {
+ return static_cast<uint32_t>(k_num_user_registers_i386);
+}
diff --git a/lldb/source/Register/Linux/RegisterInfoLinux_i386.h b/lldb/source/Register/Linux/RegisterInfoLinux_i386.h
new file mode 100644
index 00000000000000..a6904b48d9277a
--- /dev/null
+++ b/lldb/source/Register/Linux/RegisterInfoLinux_i386.h
@@ -0,0 +1,29 @@
+//===-- RegisterInfoLinux_i386.h -----------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_SOURCE_REGISTER_LINUX_REGISTERINFOLINUX_I386_H
+#define LLDB_SOURCE_REGISTER_LINUX_REGISTERINFOLINUX_I386_H
+
+#include "Register/Linux/RegisterInfoLinux_x86.h"
+
+class RegisterInfoLinux_i386
+ : public lldb_private::RegisterInfoLinux_x86 {
+public:
+ RegisterInfoLinux_i386(const lldb_private::ArchSpec &target_arch);
+
+ static size_t GetGPRSizeStatic();
+ size_t GetGPRSize() const override { return GetGPRSizeStatic(); }
+
+ const lldb_private::RegisterInfo *GetRegisterInfo() const override;
+
+ uint32_t GetRegisterCount() const override;
+
+ uint32_t GetUserRegisterCount() const override;
+};
+
+#endif
diff --git a/lldb/source/Register/Linux/RegisterInfoLinux_s390x.cpp b/lldb/source/Register/Linux/RegisterInfoLinux_s390x.cpp
new file mode 100644
index 00000000000000..682b83f723ade2
--- /dev/null
+++ b/lldb/source/Register/Linux/RegisterInfoLinux_s390x.cpp
@@ -0,0 +1,69 @@
+//===-- RegisterInfoLinux_s390x.cpp ------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "Register/Linux/RegisterInfoLinux_s390x.h"
+#include "Plugins/Process/Utility/RegisterContextPOSIX_s390x.h"
+
+using namespace lldb_private;
+using namespace lldb;
+
+// Include RegisterInfos_s390x to declare our g_register_infos_s390x structure.
+#define DECLARE_REGISTER_INFOS_S390X_STRUCT
+#include "Register/Arch/RegisterInfos_s390x.h"
+#undef DECLARE_REGISTER_INFOS_S390X_STRUCT
+
+static const RegisterInfo *GetRegisterInfoPtr(const ArchSpec &target_arch) {
+ switch (target_arch.GetMachine()) {
+ case llvm::Triple::systemz:
+ return g_register_infos_s390x;
+ default:
+ assert(false && "Unhandled target architecture.");
+ return nullptr;
+ }
+}
+
+static uint32_t GetRegisterInfoCount(const ArchSpec &target_arch) {
+ switch (target_arch.GetMachine()) {
+ case llvm::Triple::systemz:
+ return k_num_registers_s390x;
+ default:
+ assert(false && "Unhandled target architecture.");
+ return 0;
+ }
+}
+
+static uint32_t GetUserRegisterInfoCount(const ArchSpec &target_arch) {
+ switch (target_arch.GetMachine()) {
+ case llvm::Triple::systemz:
+ return k_num_user_registers_s390x + k_num_linux_registers_s390x;
+ default:
+ assert(false && "Unhandled target architecture.");
+ return 0;
+ }
+}
+
+RegisterInfoLinux_s390x::RegisterInfoLinux_s390x(
+ const ArchSpec &target_arch)
+ : lldb_private::RegisterInfoInterface(target_arch),
+ m_register_info_p(GetRegisterInfoPtr(target_arch)),
+ m_register_info_count(GetRegisterInfoCount(target_arch)),
+ m_user_register_count(GetUserRegisterInfoCount(target_arch)) {}
+
+const RegisterInfo *RegisterInfoLinux_s390x::GetRegisterInfo() const {
+ return m_register_info_p;
+}
+
+uint32_t RegisterInfoLinux_s390x::GetRegisterCount() const {
+ return m_register_info_count;
+}
+
+uint32_t RegisterInfoLinux_s390x::GetUserRegisterCount() const {
+ return m_user_register_count;
+}
+
+size_t RegisterInfoLinux_s390x::GetGPRSize() const { return 0; }
diff --git a/lldb/source/Register/Linux/RegisterInfoLinux_s390x.h b/lldb/source/Register/Linux/RegisterInfoLinux_s390x.h
new file mode 100644
index 00000000000000..418eb69e6aa840
--- /dev/null
+++ b/lldb/source/Register/Linux/RegisterInfoLinux_s390x.h
@@ -0,0 +1,32 @@
+//===-- RegisterInfoLinux_s390x.h ----------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_SOURCE_REGISTER_LINUX_REGISTERINFOLINUX_S390X_H
+#define LLDB_SOURCE_REGISTER_LINUX_REGISTERINFOLINUX_S390X_H
+
+#include "Register/RegisterInfoInterface.h"
+
+class RegisterInfoLinux_s390x : public lldb_private::RegisterInfoInterface {
+public:
+ RegisterInfoLinux_s390x(const lldb_private::ArchSpec &target_arch);
+
+ size_t GetGPRSize() const override;
+
+ const lldb_private::RegisterInfo *GetRegisterInfo() const override;
+
+ uint32_t GetRegisterCount() const override;
+
+ uint32_t GetUserRegisterCount() const override;
+
+private:
+ const lldb_private::RegisterInfo *m_register_info_p;
+ uint32_t m_register_info_count;
+ uint32_t m_user_register_count;
+};
+
+#endif
diff --git a/lldb/source/Register/Linux/RegisterInfoLinux_x86.h b/lldb/source/Register/Linux/RegisterInfoLinux_x86.h
new file mode 100644
index 00000000000000..f81605afee5e9a
--- /dev/null
+++ b/lldb/source/Register/Linux/RegisterInfoLinux_x86.h
@@ -0,0 +1,30 @@
+//===-- RegisterInfoLinux_i386.h -----------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_SOURCE_REGISTER_LINUX_REGISTERINFOLINUX_X86_H
+#define LLDB_SOURCE_REGISTER_LINUX_REGISTERINFOLINUX_X86_H
+
+#include "Register/RegisterInfoInterface.h"
+
+namespace lldb_private {
+
+class RegisterInfoLinux_x86 : public RegisterInfoInterface {
+public:
+ RegisterInfoLinux_x86(const ArchSpec &target_arch,
+ RegisterInfo orig_ax_info)
+ : RegisterInfoInterface(target_arch), m_orig_ax_info(orig_ax_info) {}
+
+ const RegisterInfo &GetOrigAxInfo() const { return m_orig_ax_info; }
+
+private:
+ lldb_private::RegisterInfo m_orig_ax_info;
+};
+
+} // namespace lldb_private
+
+#endif
diff --git a/lldb/source/Register/Linux/RegisterInfoLinux_x86_64.cpp b/lldb/source/Register/Linux/RegisterInfoLinux_x86_64.cpp
new file mode 100644
index 00000000000000..4b0c14c921adb9
--- /dev/null
+++ b/lldb/source/Register/Linux/RegisterInfoLinux_x86_64.cpp
@@ -0,0 +1,186 @@
+//===-- RegisterInfoLinux_x86_64.cpp -----------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===---------------------------------------------------------------------===//
+
+#include "Register/Linux/RegisterInfoLinux_x86_64.h"
+#include "Register/Linux/RegisterInfoLinux_i386.h"
+#include "Register/Arch/RegisterContext_x86.h"
+#include "Register/Arch/lldb-x86-register-enums.h"
+#include "lldb/lldb-defines.h"
+#include <vector>
+
+using namespace lldb_private;
+using namespace lldb;
+
+typedef struct _GPR {
+ uint64_t r15;
+ uint64_t r14;
+ uint64_t r13;
+ uint64_t r12;
+ uint64_t rbp;
+ uint64_t rbx;
+ uint64_t r11;
+ uint64_t r10;
+ uint64_t r9;
+ uint64_t r8;
+ uint64_t rax;
+ uint64_t rcx;
+ uint64_t rdx;
+ uint64_t rsi;
+ uint64_t rdi;
+ uint64_t orig_rax;
+ uint64_t rip;
+ uint64_t cs;
+ uint64_t rflags;
+ uint64_t rsp;
+ uint64_t ss;
+ uint64_t fs_base;
+ uint64_t gs_base;
+ uint64_t ds;
+ uint64_t es;
+ uint64_t fs;
+ uint64_t gs;
+} GPR;
+
+struct DBG {
+ uint64_t dr[8];
+};
+
+struct UserArea {
+ GPR gpr; // General purpose registers.
+ int32_t fpvalid; // True if FPU is being used.
+ int32_t pad0;
+ FXSAVE fpr; // General purpose floating point registers (see FPR for extended
+ // register sets).
+ uint64_t tsize; // Text segment size.
+ uint64_t dsize; // Data segment size.
+ uint64_t ssize; // Stack segment size.
+ uint64_t start_code; // VM address of text.
+ uint64_t start_stack; // VM address of stack bottom (top in rsp).
+ int64_t signal; // Signal causing core dump.
+ int32_t reserved; // Unused.
+ int32_t pad1;
+ uint64_t ar0; // Location of GPR's.
+ FXSAVE *fpstate; // Location of FPR's.
+ uint64_t magic; // Identifier for core dumps.
+ char u_comm[32]; // Command causing core dump.
+ DBG dbg; // Debug registers.
+ uint64_t error_code; // CPU error code.
+ uint64_t fault_address; // Control register CR3.
+};
+
+#define DR_OFFSET(reg_index) \
+ (LLVM_EXTENSION offsetof(UserArea, dbg) + \
+ LLVM_EXTENSION offsetof(DBG, dr[reg_index]))
+
+// Include RegisterInfos_x86_64 to declare our g_register_infos_x86_64_with_base
+// structure.
+#define DECLARE_REGISTER_INFOS_X86_64_STRUCT
+#include "Register/Arch/RegisterInfos_x86_64_with_base.h"
+#undef DECLARE_REGISTER_INFOS_X86_64_STRUCT
+
+static std::vector<lldb_private::RegisterInfo> &GetPrivateRegisterInfoVector() {
+ static std::vector<lldb_private::RegisterInfo> g_register_infos;
+ return g_register_infos;
+}
+
+static const RegisterInfo *
+GetRegisterInfo_i386(const lldb_private::ArchSpec &arch) {
+ std::vector<lldb_private::RegisterInfo> &g_register_infos =
+ GetPrivateRegisterInfoVector();
+
+ // Allocate RegisterInfo only once
+ if (g_register_infos.empty()) {
+ // Copy the register information from base class
+ std::unique_ptr<RegisterInfoLinux_i386> reg_interface(
+ new RegisterInfoLinux_i386(arch));
+ const RegisterInfo *base_info = reg_interface->GetRegisterInfo();
+ g_register_infos.insert(g_register_infos.end(), &base_info[0],
+ &base_info[k_num_registers_i386]);
+
+// Include RegisterInfos_x86_64 to update the g_register_infos structure
+// with x86_64 offsets.
+#define UPDATE_REGISTER_INFOS_I386_STRUCT_WITH_X86_64_OFFSETS
+#include "Register/Arch/RegisterInfos_x86_64_with_base.h"
+#undef UPDATE_REGISTER_INFOS_I386_STRUCT_WITH_X86_64_OFFSETS
+ }
+
+ return &g_register_infos[0];
+}
+
+static const RegisterInfo *GetRegisterInfoPtr(const ArchSpec &target_arch) {
+ switch (target_arch.GetMachine()) {
+ case llvm::Triple::x86:
+ return GetRegisterInfo_i386(target_arch);
+ case llvm::Triple::x86_64:
+ return g_register_infos_x86_64_with_base;
+ default:
+ assert(false && "Unhandled target architecture.");
+ return nullptr;
+ }
+}
+
+static uint32_t GetRegisterInfoCount(const ArchSpec &target_arch) {
+ switch (target_arch.GetMachine()) {
+ case llvm::Triple::x86: {
+ assert(!GetPrivateRegisterInfoVector().empty() &&
+ "i386 register info not yet filled.");
+ return static_cast<uint32_t>(GetPrivateRegisterInfoVector().size());
+ }
+ case llvm::Triple::x86_64:
+ return static_cast<uint32_t>(sizeof(g_register_infos_x86_64_with_base) /
+ sizeof(g_register_infos_x86_64_with_base[0]));
+ default:
+ assert(false && "Unhandled target architecture.");
+ return 0;
+ }
+}
+
+static uint32_t GetUserRegisterInfoCount(const ArchSpec &target_arch) {
+ switch (target_arch.GetMachine()) {
+ case llvm::Triple::x86:
+ return static_cast<uint32_t>(k_num_user_registers_i386);
+ case llvm::Triple::x86_64:
+ return static_cast<uint32_t>(x86_64_with_base::k_num_user_registers);
+ default:
+ assert(false && "Unhandled target architecture.");
+ return 0;
+ }
+}
+
+RegisterInfoLinux_x86_64::RegisterInfoLinux_x86_64(
+ const ArchSpec &target_arch)
+ : lldb_private::RegisterInfoLinux_x86(
+ target_arch,
+ {"orig_rax",
+ nullptr,
+ sizeof(((GPR *)nullptr)->orig_rax),
+ (LLVM_EXTENSION offsetof(GPR, orig_rax)),
+ eEncodingUint,
+ eFormatHex,
+ {LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM},
+ nullptr,
+ nullptr,
+ nullptr}),
+ m_register_info_p(GetRegisterInfoPtr(target_arch)),
+ m_register_info_count(GetRegisterInfoCount(target_arch)),
+ m_user_register_count(GetUserRegisterInfoCount(target_arch)) {}
+
+size_t RegisterInfoLinux_x86_64::GetGPRSizeStatic() { return sizeof(GPR); }
+
+const RegisterInfo *RegisterInfoLinux_x86_64::GetRegisterInfo() const {
+ return m_register_info_p;
+}
+
+uint32_t RegisterInfoLinux_x86_64::GetRegisterCount() const {
+ return m_register_info_count;
+}
+
+uint32_t RegisterInfoLinux_x86_64::GetUserRegisterCount() const {
+ return m_user_register_count;
+}
diff --git a/lldb/source/Register/Linux/RegisterInfoLinux_x86_64.h b/lldb/source/Register/Linux/RegisterInfoLinux_x86_64.h
new file mode 100644
index 00000000000000..09ad77263b3b34
--- /dev/null
+++ b/lldb/source/Register/Linux/RegisterInfoLinux_x86_64.h
@@ -0,0 +1,34 @@
+//===-- RegisterInfoLinux_x86_64.h ---------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_SOURCE_REGISTER_LINUX_REGISTERINFOLINUX_X86_64_H
+#define LLDB_SOURCE_REGISTER_LINUX_REGISTERINFOLINUX_X86_64_H
+
+#include "Register/Linux/RegisterInfoLinux_x86.h"
+
+class RegisterInfoLinux_x86_64
+ : public lldb_private::RegisterInfoLinux_x86 {
+public:
+ RegisterInfoLinux_x86_64(const lldb_private::ArchSpec &target_arch);
+
+ static size_t GetGPRSizeStatic();
+ size_t GetGPRSize() const override { return GetGPRSizeStatic(); }
+
+ const lldb_private::RegisterInfo *GetRegisterInfo() const override;
+
+ uint32_t GetRegisterCount() const override;
+
+ uint32_t GetUserRegisterCount() const override;
+
+private:
+ const lldb_private::RegisterInfo *m_register_info_p;
+ uint32_t m_register_info_count;
+ uint32_t m_user_register_count;
+};
+
+#endif
diff --git a/lldb/source/Register/NetBSD/RegisterInfoNetBSD_i386.cpp b/lldb/source/Register/NetBSD/RegisterInfoNetBSD_i386.cpp
new file mode 100644
index 00000000000000..140c46989f5d9b
--- /dev/null
+++ b/lldb/source/Register/NetBSD/RegisterInfoNetBSD_i386.cpp
@@ -0,0 +1,98 @@
+//===-- RegisterInfoNetBSD_i386.cpp --------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "Register/NetBSD/RegisterInfoNetBSD_i386.h"
+#include "Register/Arch/RegisterContext_x86.h"
+#include "Register/Arch/lldb-x86-register-enums.h"
+#include "lldb/lldb-defines.h"
+
+using namespace lldb_private;
+using namespace lldb;
+
+// this needs to match 'struct reg'
+struct GPR {
+ uint32_t eax;
+ uint32_t ecx;
+ uint32_t edx;
+ uint32_t ebx;
+ uint32_t esp;
+ uint32_t ebp;
+ uint32_t esi;
+ uint32_t edi;
+ uint32_t eip;
+ uint32_t eflags;
+ uint32_t cs;
+ uint32_t ss;
+ uint32_t ds;
+ uint32_t es;
+ uint32_t fs;
+ uint32_t gs;
+};
+
+struct FPR_i386 {
+ uint16_t fctrl; // FPU Control Word (fcw)
+ uint16_t fstat; // FPU Status Word (fsw)
+ uint16_t ftag; // FPU Tag Word (ftw)
+ uint16_t fop; // Last Instruction Opcode (fop)
+ union {
+ struct {
+ uint64_t fip; // Instruction Pointer
+ uint64_t fdp; // Data Pointer
+ } x86_64;
+ struct {
+ uint32_t fioff; // FPU IP Offset (fip)
+ uint32_t fiseg; // FPU IP Selector (fcs)
+ uint32_t fooff; // FPU Operand Pointer Offset (foo)
+ uint32_t foseg; // FPU Operand Pointer Selector (fos)
+ } i386_; // Added _ in the end to avoid error with gcc defining i386 in some
+ // cases
+ } ptr;
+ uint32_t mxcsr; // MXCSR Register State
+ uint32_t mxcsrmask; // MXCSR Mask
+ MMSReg stmm[8]; // 8*16 bytes for each FP-reg = 128 bytes
+ XMMReg xmm[8]; // 8*16 bytes for each XMM-reg = 128 bytes
+ uint32_t padding[56];
+};
+
+struct UserArea {
+ GPR gpr;
+ FPR_i386 i387;
+ uint32_t u_debugreg[8]; // Debug registers (DR0 - DR7).
+ uint32_t tlsbase;
+};
+
+#define DR_SIZE sizeof(((UserArea *)NULL)->u_debugreg[0])
+#define DR_OFFSET(reg_index) \
+ (LLVM_EXTENSION offsetof(UserArea, u_debugreg[reg_index]))
+
+// Include RegisterInfos_i386 to declare our g_register_infos_i386 structure.
+#define DECLARE_REGISTER_INFOS_I386_STRUCT
+#include "Register/Arch/RegisterInfos_i386.h"
+#undef DECLARE_REGISTER_INFOS_I386_STRUCT
+
+RegisterInfoNetBSD_i386::RegisterInfoNetBSD_i386(
+ const ArchSpec &target_arch)
+ : RegisterInfoInterface(target_arch) {}
+
+size_t RegisterInfoNetBSD_i386::GetGPRSize() const { return sizeof(GPR); }
+
+const RegisterInfo *RegisterInfoNetBSD_i386::GetRegisterInfo() const {
+ switch (GetTargetArchitecture().GetMachine()) {
+ case llvm::Triple::x86:
+ case llvm::Triple::x86_64:
+ return g_register_infos_i386;
+ default:
+ assert(false && "Unhandled target architecture.");
+ return nullptr;
+ }
+}
+
+uint32_t RegisterInfoNetBSD_i386::GetRegisterCount() const {
+ return static_cast<uint32_t>(sizeof(g_register_infos_i386) /
+ sizeof(g_register_infos_i386[0]));
+}
diff --git a/lldb/source/Register/NetBSD/RegisterInfoNetBSD_i386.h b/lldb/source/Register/NetBSD/RegisterInfoNetBSD_i386.h
new file mode 100644
index 00000000000000..47d1b83620d1f6
--- /dev/null
+++ b/lldb/source/Register/NetBSD/RegisterInfoNetBSD_i386.h
@@ -0,0 +1,25 @@
+//===-- RegisterInfoNetBSD_i386.h ----------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_SOURCE_REGISTER_NETBSD_REGISTERINFONETBSD_I386_H
+#define LLDB_SOURCE_REGISTER_NETBSD_REGISTERINFONETBSD_I386_H
+
+#include "Register/RegisterInfoInterface.h"
+
+class RegisterInfoNetBSD_i386 : public lldb_private::RegisterInfoInterface {
+public:
+ RegisterInfoNetBSD_i386(const lldb_private::ArchSpec &target_arch);
+
+ size_t GetGPRSize() const override;
+
+ const lldb_private::RegisterInfo *GetRegisterInfo() const override;
+
+ uint32_t GetRegisterCount() const override;
+};
+
+#endif
diff --git a/lldb/source/Register/NetBSD/RegisterInfoNetBSD_x86_64.cpp b/lldb/source/Register/NetBSD/RegisterInfoNetBSD_x86_64.cpp
new file mode 100644
index 00000000000000..104e97934c1150
--- /dev/null
+++ b/lldb/source/Register/NetBSD/RegisterInfoNetBSD_x86_64.cpp
@@ -0,0 +1,180 @@
+//===-- RegisterInfoNetBSD_x86_64.cpp ----------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "Register/NetBSD/RegisterInfoNetBSD_x86_64.h"
+#include "Register/NetBSD/RegisterInfoNetBSD_i386.h"
+#include "Register/Arch/RegisterContext_x86.h"
+#include "Register/Arch/lldb-x86-register-enums.h"
+#include "lldb/lldb-defines.h"
+#include "llvm/Support/Compiler.h"
+#include "llvm/TargetParser/Triple.h"
+#include <cassert>
+#include <cstddef>
+
+using namespace lldb_private;
+using namespace lldb;
+
+// src/sys/arch/amd64/include/frame_regs.h
+typedef struct _GPR {
+ uint64_t rdi; /* 0 */
+ uint64_t rsi; /* 1 */
+ uint64_t rdx; /* 2 */
+ uint64_t rcx; /* 3 */
+ uint64_t r8; /* 4 */
+ uint64_t r9; /* 5 */
+ uint64_t r10; /* 6 */
+ uint64_t r11; /* 7 */
+ uint64_t r12; /* 8 */
+ uint64_t r13; /* 9 */
+ uint64_t r14; /* 10 */
+ uint64_t r15; /* 11 */
+ uint64_t rbp; /* 12 */
+ uint64_t rbx; /* 13 */
+ uint64_t rax; /* 14 */
+ uint64_t gs; /* 15 */
+ uint64_t fs; /* 16 */
+ uint64_t es; /* 17 */
+ uint64_t ds; /* 18 */
+ uint64_t trapno; /* 19 */
+ uint64_t err; /* 20 */
+ uint64_t rip; /* 21 */
+ uint64_t cs; /* 22 */
+ uint64_t rflags; /* 23 */
+ uint64_t rsp; /* 24 */
+ uint64_t ss; /* 25 */
+} GPR;
+
+struct DBG {
+ uint64_t dr[16]; /* debug registers */
+ /* Index 0-3: debug address registers */
+ /* Index 4-5: reserved */
+ /* Index 6: debug status */
+ /* Index 7: debug control */
+ /* Index 8-15: reserved */
+};
+
+/*
+ * src/sys/arch/amd64/include/mcontext.h
+ *
+ * typedef struct {
+ * __gregset_t __gregs;
+ * __greg_t _mc_tlsbase;
+ * __fpregset_t __fpregs;
+ * } mcontext_t;
+ */
+
+struct UserArea {
+ GPR gpr;
+ uint64_t mc_tlsbase;
+ FPR fpr;
+ DBG dbg;
+};
+
+#define DR_OFFSET(reg_index) \
+ (LLVM_EXTENSION offsetof(UserArea, dbg) + \
+ LLVM_EXTENSION offsetof(DBG, dr[reg_index]))
+
+
+// Include RegisterInfos_x86_64 to declare our g_register_infos_x86_64
+// structure.
+#define DECLARE_REGISTER_INFOS_X86_64_STRUCT
+#include "Register/Arch/RegisterInfos_x86_64.h"
+#undef DECLARE_REGISTER_INFOS_X86_64_STRUCT
+
+static std::vector<lldb_private::RegisterInfo> &GetPrivateRegisterInfoVector() {
+ static std::vector<lldb_private::RegisterInfo> g_register_infos;
+ return g_register_infos;
+}
+
+static const RegisterInfo *
+GetRegisterInfo_i386(const lldb_private::ArchSpec &arch) {
+ std::vector<lldb_private::RegisterInfo> &g_register_infos =
+ GetPrivateRegisterInfoVector();
+
+ // Allocate RegisterInfo only once
+ if (g_register_infos.empty()) {
+ // Copy the register information from base class
+ std::unique_ptr<RegisterInfoNetBSD_i386> reg_interface(
+ new RegisterInfoNetBSD_i386(arch));
+ const RegisterInfo *base_info = reg_interface->GetRegisterInfo();
+ g_register_infos.insert(g_register_infos.end(), &base_info[0],
+ &base_info[k_num_registers_i386]);
+
+// Include RegisterInfos_x86_64 to update the g_register_infos structure
+// with x86_64 offsets.
+#define UPDATE_REGISTER_INFOS_I386_STRUCT_WITH_X86_64_OFFSETS
+#include "Register/Arch/RegisterInfos_x86_64.h"
+#undef UPDATE_REGISTER_INFOS_I386_STRUCT_WITH_X86_64_OFFSETS
+ }
+
+ return &g_register_infos[0];
+}
+
+static const RegisterInfo *
+PrivateGetRegisterInfoPtr(const lldb_private::ArchSpec &target_arch) {
+ switch (target_arch.GetMachine()) {
+ case llvm::Triple::x86:
+ return GetRegisterInfo_i386(target_arch);
+ case llvm::Triple::x86_64:
+ return g_register_infos_x86_64;
+ default:
+ assert(false && "Unhandled target architecture.");
+ return nullptr;
+ }
+}
+
+static uint32_t
+PrivateGetRegisterCount(const lldb_private::ArchSpec &target_arch) {
+ switch (target_arch.GetMachine()) {
+ case llvm::Triple::x86: {
+ assert(!GetPrivateRegisterInfoVector().empty() &&
+ "i386 register info not yet filled.");
+ return static_cast<uint32_t>(GetPrivateRegisterInfoVector().size());
+ }
+ case llvm::Triple::x86_64:
+ return static_cast<uint32_t>(sizeof(g_register_infos_x86_64) /
+ sizeof(g_register_infos_x86_64[0]));
+ default:
+ assert(false && "Unhandled target architecture.");
+ return 0;
+ }
+}
+
+static uint32_t
+PrivateGetUserRegisterCount(const lldb_private::ArchSpec &target_arch) {
+ switch (target_arch.GetMachine()) {
+ case llvm::Triple::x86:
+ return static_cast<uint32_t>(k_num_user_registers_i386);
+ case llvm::Triple::x86_64:
+ return static_cast<uint32_t>(k_num_user_registers_x86_64);
+ default:
+ assert(false && "Unhandled target architecture.");
+ return 0;
+ }
+}
+
+RegisterInfoNetBSD_x86_64::RegisterInfoNetBSD_x86_64(
+ const ArchSpec &target_arch)
+ : lldb_private::RegisterInfoInterface(target_arch),
+ m_register_info_p(PrivateGetRegisterInfoPtr(target_arch)),
+ m_register_count(PrivateGetRegisterCount(target_arch)),
+ m_user_register_count(PrivateGetUserRegisterCount(target_arch)) {}
+
+size_t RegisterInfoNetBSD_x86_64::GetGPRSize() const { return sizeof(GPR); }
+
+const RegisterInfo *RegisterInfoNetBSD_x86_64::GetRegisterInfo() const {
+ return m_register_info_p;
+}
+
+uint32_t RegisterInfoNetBSD_x86_64::GetRegisterCount() const {
+ return m_register_count;
+}
+
+uint32_t RegisterInfoNetBSD_x86_64::GetUserRegisterCount() const {
+ return m_user_register_count;
+}
diff --git a/lldb/source/Register/NetBSD/RegisterInfoNetBSD_x86_64.h b/lldb/source/Register/NetBSD/RegisterInfoNetBSD_x86_64.h
new file mode 100644
index 00000000000000..1c0323d98a929e
--- /dev/null
+++ b/lldb/source/Register/NetBSD/RegisterInfoNetBSD_x86_64.h
@@ -0,0 +1,33 @@
+//===-- RegisterInfoNetBSD_x86_64.h --------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_SOURCE_REGISTER_NETBSD_REGISTERINFONETBSD_X86_64_H
+#define LLDB_SOURCE_REGISTER_NETBSD_REGISTERINFONETBSD_X86_64_H
+
+#include "Register/RegisterInfoInterface.h"
+
+class RegisterInfoNetBSD_x86_64
+ : public lldb_private::RegisterInfoInterface {
+public:
+ RegisterInfoNetBSD_x86_64(const lldb_private::ArchSpec &target_arch);
+
+ size_t GetGPRSize() const override;
+
+ const lldb_private::RegisterInfo *GetRegisterInfo() const override;
+
+ uint32_t GetRegisterCount() const override;
+
+ uint32_t GetUserRegisterCount() const override;
+
+private:
+ const lldb_private::RegisterInfo *m_register_info_p;
+ const uint32_t m_register_count;
+ const uint32_t m_user_register_count;
+};
+
+#endif
diff --git a/lldb/source/Register/OpenBSD/RegisterInfoOpenBSD_i386.cpp b/lldb/source/Register/OpenBSD/RegisterInfoOpenBSD_i386.cpp
new file mode 100644
index 00000000000000..338f6aa6d47adb
--- /dev/null
+++ b/lldb/source/Register/OpenBSD/RegisterInfoOpenBSD_i386.cpp
@@ -0,0 +1,79 @@
+//===-- RegisterInfoOpenBSD_i386.cpp -----------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===---------------------------------------------------------------------===//
+
+#include "Register/OpenBSD/RegisterInfoOpenBSD_i386.h"
+#include "Register/Arch/RegisterContext_x86.h"
+#include "Register/Arch/lldb-x86-register-enums.h"
+#include "lldb/lldb-defines.h"
+
+using namespace lldb_private;
+using namespace lldb;
+
+// /usr/include/machine/reg.h
+struct GPR {
+ uint32_t eax;
+ uint32_t ecx;
+ uint32_t edx;
+ uint32_t ebx;
+ uint32_t esp;
+ uint32_t ebp;
+ uint32_t esi;
+ uint32_t edi;
+ uint32_t eip;
+ uint32_t eflags;
+ uint32_t cs;
+ uint32_t ss;
+ uint32_t ds;
+ uint32_t es;
+ uint32_t fs;
+ uint32_t gs;
+};
+
+struct dbreg {
+ uint32_t dr[8]; /* debug registers */
+ /* Index 0-3: debug address registers */
+ /* Index 4-5: reserved */
+ /* Index 6: debug status */
+ /* Index 7: debug control */
+};
+
+using FPR_i386 = FXSAVE;
+
+struct UserArea {
+ GPR gpr;
+ FPR_i386 i387;
+};
+
+#define DR_SIZE sizeof(uint32_t)
+#define DR_OFFSET(reg_index) (LLVM_EXTENSION offsetof(dbreg, dr[reg_index]))
+
+// Include RegisterInfos_i386 to declare our g_register_infos_i386 structure.
+#define DECLARE_REGISTER_INFOS_I386_STRUCT
+#include "Register/Arch/RegisterInfos_i386.h"
+#undef DECLARE_REGISTER_INFOS_I386_STRUCT
+
+RegisterInfoOpenBSD_i386::RegisterInfoOpenBSD_i386(
+ const ArchSpec &target_arch)
+ : RegisterInfoInterface(target_arch) {}
+
+size_t RegisterInfoOpenBSD_i386::GetGPRSize() const { return sizeof(GPR); }
+
+const RegisterInfo *RegisterInfoOpenBSD_i386::GetRegisterInfo() const {
+ switch (GetTargetArchitecture().GetMachine()) {
+ case llvm::Triple::x86:
+ return g_register_infos_i386;
+ default:
+ assert(false && "Unhandled target architecture.");
+ return nullptr;
+ }
+}
+
+uint32_t RegisterInfoOpenBSD_i386::GetRegisterCount() const {
+ return static_cast<uint32_t>(sizeof(g_register_infos_i386) /
+ sizeof(g_register_infos_i386[0]));
+}
diff --git a/lldb/source/Register/OpenBSD/RegisterInfoOpenBSD_i386.h b/lldb/source/Register/OpenBSD/RegisterInfoOpenBSD_i386.h
new file mode 100644
index 00000000000000..9e0ba4c9a926fd
--- /dev/null
+++ b/lldb/source/Register/OpenBSD/RegisterInfoOpenBSD_i386.h
@@ -0,0 +1,25 @@
+//===-- RegisterInfoOpenBSD_i386.h ---------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_SOURCE_REGISTER_OPENBSD_REGISTERINFOOPENBSD_I386_H
+#define LLDB_SOURCE_REGISTER_OPENBSD_REGISTERINFOOPENBSD_I386_H
+
+#include "Register/RegisterInfoInterface.h"
+
+class RegisterInfoOpenBSD_i386 : public lldb_private::RegisterInfoInterface {
+public:
+ RegisterInfoOpenBSD_i386(const lldb_private::ArchSpec &target_arch);
+
+ size_t GetGPRSize() const override;
+
+ const lldb_private::RegisterInfo *GetRegisterInfo() const override;
+
+ uint32_t GetRegisterCount() const override;
+};
+
+#endif
diff --git a/lldb/source/Register/OpenBSD/RegisterInfoOpenBSD_x86_64.cpp b/lldb/source/Register/OpenBSD/RegisterInfoOpenBSD_x86_64.cpp
new file mode 100644
index 00000000000000..5173990eefdd9c
--- /dev/null
+++ b/lldb/source/Register/OpenBSD/RegisterInfoOpenBSD_x86_64.cpp
@@ -0,0 +1,106 @@
+//===-- RegisterInfoOpenBSD_x86_64.cpp ---------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===---------------------------------------------------------------------===//
+
+#include "Register/OpenBSD/RegisterInfoOpenBSD_x86_64.h"
+#include "Register/Arch/RegisterContext_x86.h"
+#include "Register/Arch/lldb-x86-register-enums.h"
+#include "lldb/lldb-defines.h"
+#include <vector>
+
+using namespace lldb_private;
+using namespace lldb;
+
+// /usr/include/machine/reg.h
+typedef struct _GPR {
+ uint64_t rdi;
+ uint64_t rsi;
+ uint64_t rdx;
+ uint64_t rcx;
+ uint64_t r8;
+ uint64_t r9;
+ uint64_t r10;
+ uint64_t r11;
+ uint64_t r12;
+ uint64_t r13;
+ uint64_t r14;
+ uint64_t r15;
+ uint64_t rbp;
+ uint64_t rbx;
+ uint64_t rax;
+ uint64_t rsp;
+ uint64_t rip;
+ uint64_t rflags;
+ uint64_t cs;
+ uint64_t ss;
+ uint64_t ds;
+ uint64_t es;
+ uint64_t fs;
+ uint64_t gs;
+} GPR;
+
+struct DBG {
+ uint64_t dr[16]; /* debug registers */
+ /* Index 0-3: debug address registers */
+ /* Index 4-5: reserved */
+ /* Index 6: debug status */
+ /* Index 7: debug control */
+ /* Index 8-15: reserved */
+};
+
+struct UserArea {
+ GPR gpr;
+ FPR fpr;
+ DBG dbg;
+};
+
+#define DR_OFFSET(reg_index) (LLVM_EXTENSION offsetof(DBG, dr[reg_index]))
+
+// Include RegisterInfos_x86_64 to declare our g_register_infos_x86_64
+// structure.
+#define DECLARE_REGISTER_INFOS_X86_64_STRUCT
+#include "Register/Arch/RegisterInfos_x86_64.h"
+#undef DECLARE_REGISTER_INFOS_X86_64_STRUCT
+
+static const RegisterInfo *
+PrivateGetRegisterInfoPtr(const lldb_private::ArchSpec &target_arch) {
+ switch (target_arch.GetMachine()) {
+ case llvm::Triple::x86_64:
+ return g_register_infos_x86_64;
+ default:
+ assert(false && "Unhandled target architecture.");
+ return nullptr;
+ }
+}
+
+static uint32_t
+PrivateGetRegisterCount(const lldb_private::ArchSpec &target_arch) {
+ switch (target_arch.GetMachine()) {
+ case llvm::Triple::x86_64:
+ return static_cast<uint32_t>(sizeof(g_register_infos_x86_64) /
+ sizeof(g_register_infos_x86_64[0]));
+ default:
+ assert(false && "Unhandled target architecture.");
+ return 0;
+ }
+}
+
+RegisterInfoOpenBSD_x86_64::RegisterInfoOpenBSD_x86_64(
+ const ArchSpec &target_arch)
+ : lldb_private::RegisterInfoInterface(target_arch),
+ m_register_info_p(PrivateGetRegisterInfoPtr(target_arch)),
+ m_register_count(PrivateGetRegisterCount(target_arch)) {}
+
+size_t RegisterInfoOpenBSD_x86_64::GetGPRSize() const { return sizeof(GPR); }
+
+const RegisterInfo *RegisterInfoOpenBSD_x86_64::GetRegisterInfo() const {
+ return m_register_info_p;
+}
+
+uint32_t RegisterInfoOpenBSD_x86_64::GetRegisterCount() const {
+ return m_register_count;
+}
diff --git a/lldb/source/Register/OpenBSD/RegisterInfoOpenBSD_x86_64.h b/lldb/source/Register/OpenBSD/RegisterInfoOpenBSD_x86_64.h
new file mode 100644
index 00000000000000..174fee480dd36c
--- /dev/null
+++ b/lldb/source/Register/OpenBSD/RegisterInfoOpenBSD_x86_64.h
@@ -0,0 +1,30 @@
+//===-- RegisterInfoOpenBSD_x86_64.h -------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_SOURCE_REGISTER_OPENBSD_REGISTERINFOOPENBSD_X86_64_H
+#define LLDB_SOURCE_REGISTER_OPENBSD_REGISTERINFOOPENBSD_X86_64_H
+
+#include "Register/RegisterInfoInterface.h"
+
+class RegisterInfoOpenBSD_x86_64
+ : public lldb_private::RegisterInfoInterface {
+public:
+ RegisterInfoOpenBSD_x86_64(const lldb_private::ArchSpec &target_arch);
+
+ size_t GetGPRSize() const override;
+
+ const lldb_private::RegisterInfo *GetRegisterInfo() const override;
+
+ uint32_t GetRegisterCount() const override;
+
+private:
+ const lldb_private::RegisterInfo *m_register_info_p;
+ const uint32_t m_register_count;
+};
+
+#endif
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoAndSetInterface.h b/lldb/source/Register/RegisterInfoAndSetInterface.h
similarity index 84%
rename from lldb/source/Plugins/Process/Utility/RegisterInfoAndSetInterface.h
rename to lldb/source/Register/RegisterInfoAndSetInterface.h
index 7e569dc9ba7844..9f13aa6d751f92 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfoAndSetInterface.h
+++ b/lldb/source/Register/RegisterInfoAndSetInterface.h
@@ -6,10 +6,10 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOANDSETINTERFACE_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOANDSETINTERFACE_H
+#ifndef LLDB_SOURCE_REGISTER_REGISTERINFOANDSETINTERFACE_H
+#define LLDB_SOURCE_REGISTER_REGISTERINFOANDSETINTERFACE_H
-#include "RegisterInfoInterface.h"
+#include "Register/RegisterInfoInterface.h"
#include "lldb/Utility/ArchSpec.h"
#include "lldb/lldb-private-types.h"
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoInterface.h b/lldb/source/Register/RegisterInfoInterface.h
similarity index 91%
rename from lldb/source/Plugins/Process/Utility/RegisterInfoInterface.h
rename to lldb/source/Register/RegisterInfoInterface.h
index 38d086de22bee3..d6adadc0e2051d 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfoInterface.h
+++ b/lldb/source/Register/RegisterInfoInterface.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOINTERFACE_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOINTERFACE_H
+#ifndef LLDB_SOURCE_REGISTER_REGISTERINFOINTERFACE_H
+#define LLDB_SOURCE_REGISTER_REGISTERINFOINTERFACE_H
#include "lldb/Utility/ArchSpec.h"
#include "lldb/Utility/RegisterInfo.h"
diff --git a/lldb/source/Register/Windows/RegisterInfoWindows_i386.cpp b/lldb/source/Register/Windows/RegisterInfoWindows_i386.cpp
new file mode 100644
index 00000000000000..fde74c5f2ea4c7
--- /dev/null
+++ b/lldb/source/Register/Windows/RegisterInfoWindows_i386.cpp
@@ -0,0 +1,90 @@
+//===-- RegisterInfoWindows_i386.cpp -----------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "Register/Windows/RegisterInfoWindows_i386.h"
+#include "Register/Arch/RegisterContext_x86.h"
+#include "Register/Arch/lldb-x86-register-enums.h"
+#include "lldb/lldb-defines.h"
+
+using namespace lldb_private;
+using namespace lldb;
+
+namespace {
+// Declare our g_register_infos structure.
+typedef struct _GPR {
+ uint32_t eax;
+ uint32_t ebx;
+ uint32_t ecx;
+ uint32_t edx;
+ uint32_t edi;
+ uint32_t esi;
+ uint32_t ebp;
+ uint32_t esp;
+ uint32_t eip;
+ uint32_t eflags;
+ uint32_t cs;
+ uint32_t fs;
+ uint32_t gs;
+ uint32_t ss;
+ uint32_t ds;
+ uint32_t es;
+} GPR;
+
+#define GPR_OFFSET(regname) (LLVM_EXTENSION offsetof(GPR, regname))
+
+#define DEFINE_GPR(reg, alt, kind1, kind2, kind3, kind4) \
+ { \
+#reg, alt, sizeof(((GPR *)nullptr)->reg), GPR_OFFSET(reg), eEncodingUint, \
+ eFormatHex, \
+ {kind1, kind2, kind3, kind4, lldb_##reg##_i386 }, nullptr, nullptr, \
+ nullptr, \
+ }
+
+// clang-format off
+static RegisterInfo g_register_infos_i386[] = {
+// General purpose registers EH_Frame DWARF Generic Process Plugin
+// =========================== ================== ================ ========================= ====================
+ DEFINE_GPR(eax, nullptr, ehframe_eax_i386, dwarf_eax_i386, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM),
+ DEFINE_GPR(ebx, nullptr, ehframe_ebx_i386, dwarf_ebx_i386, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM),
+ DEFINE_GPR(ecx, nullptr, ehframe_ecx_i386, dwarf_ecx_i386, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM),
+ DEFINE_GPR(edx, nullptr, ehframe_edx_i386, dwarf_edx_i386, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM),
+ DEFINE_GPR(edi, nullptr, ehframe_edi_i386, dwarf_edi_i386, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM),
+ DEFINE_GPR(esi, nullptr, ehframe_esi_i386, dwarf_esi_i386, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM),
+ DEFINE_GPR(ebp, "fp", ehframe_ebp_i386, dwarf_ebp_i386, LLDB_REGNUM_GENERIC_FP, LLDB_INVALID_REGNUM),
+ DEFINE_GPR(esp, "sp", ehframe_esp_i386, dwarf_esp_i386, LLDB_REGNUM_GENERIC_SP, LLDB_INVALID_REGNUM),
+ DEFINE_GPR(eip, "pc", ehframe_eip_i386, dwarf_eip_i386, LLDB_REGNUM_GENERIC_PC, LLDB_INVALID_REGNUM),
+ DEFINE_GPR(eflags, "flags", ehframe_eflags_i386, dwarf_eflags_i386, LLDB_REGNUM_GENERIC_FLAGS, LLDB_INVALID_REGNUM),
+ DEFINE_GPR(cs, nullptr, LLDB_INVALID_REGNUM, dwarf_cs_i386, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM),
+ DEFINE_GPR(fs, nullptr, LLDB_INVALID_REGNUM, dwarf_fs_i386, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM),
+ DEFINE_GPR(gs, nullptr, LLDB_INVALID_REGNUM, dwarf_gs_i386, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM),
+ DEFINE_GPR(ss, nullptr, LLDB_INVALID_REGNUM, dwarf_ss_i386, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM),
+ DEFINE_GPR(ds, nullptr, LLDB_INVALID_REGNUM, dwarf_ds_i386, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM),
+ DEFINE_GPR(es, nullptr, LLDB_INVALID_REGNUM, dwarf_es_i386, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM),
+};
+// clang-format on
+} // namespace
+
+RegisterInfoWindows_i386::RegisterInfoWindows_i386(
+ const ArchSpec &target_arch)
+ : lldb_private::RegisterInfoInterface(target_arch) {
+ assert(target_arch.GetMachine() == llvm::Triple::x86);
+}
+
+const RegisterInfo *RegisterInfoWindows_i386::GetRegisterInfo() const {
+ return g_register_infos_i386;
+}
+
+uint32_t RegisterInfoWindows_i386::GetRegisterCount() const {
+ return std::size(g_register_infos_i386);
+}
+
+uint32_t RegisterInfoWindows_i386::GetUserRegisterCount() const {
+ return std::size(g_register_infos_i386);
+}
+
+size_t RegisterInfoWindows_i386::GetGPRSize() const { return sizeof(GPR); }
diff --git a/lldb/source/Register/Windows/RegisterInfoWindows_i386.h b/lldb/source/Register/Windows/RegisterInfoWindows_i386.h
new file mode 100644
index 00000000000000..cf6b1f6aceb38f
--- /dev/null
+++ b/lldb/source/Register/Windows/RegisterInfoWindows_i386.h
@@ -0,0 +1,27 @@
+//===-- RegisterInfoWindows_i386.h ---------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_SOURCE_REGISTER_WINDOWS_REGISTERINFOWINDOWS_I386_H
+#define LLDB_SOURCE_REGISTER_WINDOWS_REGISTERINFOWINDOWS_I386_H
+
+#include "Register/RegisterInfoInterface.h"
+
+class RegisterInfoWindows_i386 : public lldb_private::RegisterInfoInterface {
+public:
+ RegisterInfoWindows_i386(const lldb_private::ArchSpec &target_arch);
+
+ size_t GetGPRSize() const override;
+
+ const lldb_private::RegisterInfo *GetRegisterInfo() const override;
+
+ uint32_t GetRegisterCount() const override;
+
+ uint32_t GetUserRegisterCount() const override;
+};
+
+#endif
diff --git a/lldb/source/Register/Windows/RegisterInfoWindows_x86_64.cpp b/lldb/source/Register/Windows/RegisterInfoWindows_x86_64.cpp
new file mode 100644
index 00000000000000..c8b312a77b68e2
--- /dev/null
+++ b/lldb/source/Register/Windows/RegisterInfoWindows_x86_64.cpp
@@ -0,0 +1,153 @@
+//===-- RegisterInfoWindows_x86_64.cpp ---------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "Register/Windows/RegisterInfoWindows_x86_64.h"
+#include "Register/Arch/RegisterContext_x86.h"
+#include "Register/Arch/lldb-x86-register-enums.h"
+#include "lldb/lldb-defines.h"
+
+#include <vector>
+
+using namespace lldb_private;
+using namespace lldb;
+
+namespace {
+typedef struct _GPR {
+ uint64_t rax;
+ uint64_t rcx;
+ uint64_t rdx;
+ uint64_t rbx;
+ uint64_t rsp;
+ uint64_t rbp;
+ uint64_t rsi;
+ uint64_t rdi;
+ uint64_t r8;
+ uint64_t r9;
+ uint64_t r10;
+ uint64_t r11;
+ uint64_t r12;
+ uint64_t r13;
+ uint64_t r14;
+ uint64_t r15;
+ uint64_t rip;
+ uint64_t rflags;
+ uint16_t cs;
+ uint16_t fs;
+ uint16_t gs;
+ uint16_t ss;
+ uint16_t ds;
+ uint16_t es;
+} GPR;
+
+#define GPR_OFFSET(regname) (LLVM_EXTENSION offsetof(GPR, regname))
+#define DEFINE_GPR(reg, alt, kind1, kind2, kind3, kind4) \
+ { \
+#reg, alt, sizeof(((GPR *)nullptr)->reg), GPR_OFFSET(reg), eEncodingUint, \
+ eFormatHex, \
+ {kind1, kind2, kind3, kind4, lldb_##reg##_x86_64 }, nullptr, nullptr, \
+ nullptr, \
+ }
+
+typedef struct _FPReg {
+ XMMReg xmm0;
+ XMMReg xmm1;
+ XMMReg xmm2;
+ XMMReg xmm3;
+ XMMReg xmm4;
+ XMMReg xmm5;
+ XMMReg xmm6;
+ XMMReg xmm7;
+ XMMReg xmm8;
+ XMMReg xmm9;
+ XMMReg xmm10;
+ XMMReg xmm11;
+ XMMReg xmm12;
+ XMMReg xmm13;
+ XMMReg xmm14;
+ XMMReg xmm15;
+} FPReg;
+
+#define FPR_OFFSET(regname) \
+ (sizeof(GPR) + LLVM_EXTENSION offsetof(FPReg, regname))
+
+#define DEFINE_XMM(reg) \
+ { \
+#reg, NULL, sizeof(((FPReg *)nullptr)->reg), FPR_OFFSET(reg), \
+ eEncodingUint, eFormatVectorOfUInt64, \
+ {dwarf_##reg##_x86_64, dwarf_##reg##_x86_64, LLDB_INVALID_REGNUM, \
+ LLDB_INVALID_REGNUM, lldb_##reg##_x86_64 }, \
+ nullptr, nullptr, nullptr, \
+ }
+
+// clang-format off
+static RegisterInfo g_register_infos_x86_64[] = {
+// General purpose registers EH_Frame DWARF Generic Process Plugin
+// =========================== ================== ================ ========================= ====================
+ DEFINE_GPR(rax, nullptr, dwarf_rax_x86_64, dwarf_rax_x86_64, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM),
+ DEFINE_GPR(rbx, nullptr, dwarf_rbx_x86_64, dwarf_rbx_x86_64, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM),
+ DEFINE_GPR(rcx, nullptr, dwarf_rcx_x86_64, dwarf_rcx_x86_64, LLDB_REGNUM_GENERIC_ARG1, LLDB_INVALID_REGNUM),
+ DEFINE_GPR(rdx, nullptr, dwarf_rdx_x86_64, dwarf_rdx_x86_64, LLDB_REGNUM_GENERIC_ARG2, LLDB_INVALID_REGNUM),
+ DEFINE_GPR(rdi, nullptr, dwarf_rdi_x86_64, dwarf_rdi_x86_64, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM),
+ DEFINE_GPR(rsi, nullptr, dwarf_rsi_x86_64, dwarf_rsi_x86_64, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM),
+ DEFINE_GPR(rbp, nullptr, dwarf_rbp_x86_64, dwarf_rbp_x86_64, LLDB_REGNUM_GENERIC_FP, LLDB_INVALID_REGNUM),
+ DEFINE_GPR(rsp, nullptr, dwarf_rsp_x86_64, dwarf_rsp_x86_64, LLDB_REGNUM_GENERIC_SP, LLDB_INVALID_REGNUM),
+ DEFINE_GPR(r8, nullptr, dwarf_r8_x86_64, dwarf_r8_x86_64, LLDB_REGNUM_GENERIC_ARG3, LLDB_INVALID_REGNUM),
+ DEFINE_GPR(r9, nullptr, dwarf_r9_x86_64, dwarf_r9_x86_64, LLDB_REGNUM_GENERIC_ARG4, LLDB_INVALID_REGNUM),
+ DEFINE_GPR(r10, nullptr, dwarf_r10_x86_64, dwarf_r10_x86_64, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM),
+ DEFINE_GPR(r11, nullptr, dwarf_r11_x86_64, dwarf_r11_x86_64, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM),
+ DEFINE_GPR(r12, nullptr, dwarf_r12_x86_64, dwarf_r12_x86_64, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM),
+ DEFINE_GPR(r13, nullptr, dwarf_r13_x86_64, dwarf_r13_x86_64, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM),
+ DEFINE_GPR(r14, nullptr, dwarf_r14_x86_64, dwarf_r14_x86_64, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM),
+ DEFINE_GPR(r15, nullptr, dwarf_r15_x86_64, dwarf_r15_x86_64, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM),
+ DEFINE_GPR(rip, nullptr, dwarf_rip_x86_64, dwarf_rip_x86_64, LLDB_REGNUM_GENERIC_PC, LLDB_INVALID_REGNUM),
+ DEFINE_GPR(rflags, nullptr, dwarf_rflags_x86_64, dwarf_rflags_x86_64, LLDB_REGNUM_GENERIC_FLAGS, LLDB_INVALID_REGNUM),
+ DEFINE_GPR(cs, nullptr, dwarf_cs_x86_64, dwarf_cs_x86_64, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM),
+ DEFINE_GPR(fs, nullptr, dwarf_fs_x86_64, dwarf_fs_x86_64, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM),
+ DEFINE_GPR(gs, nullptr, dwarf_gs_x86_64, dwarf_gs_x86_64, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM),
+ DEFINE_GPR(ss, nullptr, dwarf_ss_x86_64, dwarf_ss_x86_64, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM),
+ DEFINE_GPR(ds, nullptr, dwarf_ds_x86_64, dwarf_ds_x86_64, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM),
+ DEFINE_GPR(es, nullptr, dwarf_es_x86_64, dwarf_es_x86_64, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM),
+ DEFINE_XMM(xmm0),
+ DEFINE_XMM(xmm1),
+ DEFINE_XMM(xmm2),
+ DEFINE_XMM(xmm3),
+ DEFINE_XMM(xmm4),
+ DEFINE_XMM(xmm5),
+ DEFINE_XMM(xmm6),
+ DEFINE_XMM(xmm7),
+ DEFINE_XMM(xmm8),
+ DEFINE_XMM(xmm9),
+ DEFINE_XMM(xmm10),
+ DEFINE_XMM(xmm11),
+ DEFINE_XMM(xmm12),
+ DEFINE_XMM(xmm13),
+ DEFINE_XMM(xmm14),
+ DEFINE_XMM(xmm15)
+};
+// clang-format on
+} // namespace
+
+RegisterInfoWindows_x86_64::RegisterInfoWindows_x86_64(
+ const ArchSpec &target_arch)
+ : lldb_private::RegisterInfoInterface(target_arch) {
+ assert(target_arch.GetMachine() == llvm::Triple::x86_64);
+}
+
+const RegisterInfo *RegisterInfoWindows_x86_64::GetRegisterInfo() const {
+ return g_register_infos_x86_64;
+}
+
+uint32_t RegisterInfoWindows_x86_64::GetRegisterCount() const {
+ return std::size(g_register_infos_x86_64);
+}
+
+uint32_t RegisterInfoWindows_x86_64::GetUserRegisterCount() const {
+ return std::size(g_register_infos_x86_64);
+}
+
+size_t RegisterInfoWindows_x86_64::GetGPRSize() const { return sizeof(GPR); }
diff --git a/lldb/source/Register/Windows/RegisterInfoWindows_x86_64.h b/lldb/source/Register/Windows/RegisterInfoWindows_x86_64.h
new file mode 100644
index 00000000000000..caf3018d823334
--- /dev/null
+++ b/lldb/source/Register/Windows/RegisterInfoWindows_x86_64.h
@@ -0,0 +1,28 @@
+//===-- RegisterInfoWindows_x86_64.h --- ---------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_SOURCE_REGISTER_WINDOWS_REGISTERINFOWINDOWS_X86_64_H
+#define LLDB_SOURCE_REGISTER_WINDOWS_REGISTERINFOWINDOWS_X86_64_H
+
+#include "Register/RegisterInfoInterface.h"
+
+class RegisterInfoWindows_x86_64
+ : public lldb_private::RegisterInfoInterface {
+public:
+ RegisterInfoWindows_x86_64(const lldb_private::ArchSpec &target_arch);
+
+ size_t GetGPRSize() const override;
+
+ const lldb_private::RegisterInfo *GetRegisterInfo() const override;
+
+ uint32_t GetRegisterCount() const override;
+
+ uint32_t GetUserRegisterCount() const override;
+};
+
+#endif
diff --git a/lldb/unittests/Instruction/ARM64/TestAArch64Emulator.cpp b/lldb/unittests/Instruction/ARM64/TestAArch64Emulator.cpp
index 1ad9ec8f88f929..f66c62b38871cc 100644
--- a/lldb/unittests/Instruction/ARM64/TestAArch64Emulator.cpp
+++ b/lldb/unittests/Instruction/ARM64/TestAArch64Emulator.cpp
@@ -16,8 +16,8 @@
#include "lldb/Utility/RegisterValue.h"
#include "Plugins/Instruction/ARM64/EmulateInstructionARM64.h"
-#include "Plugins/Process/Utility/RegisterInfoCommon_arm64.h"
-#include "Plugins/Process/Utility/lldb-arm64-register-enums.h"
+#include "Register/Common/RegisterInfoCommon_arm64.h"
+#include "Register/Arch/lldb-arm64-register-enums.h"
using namespace lldb;
using namespace lldb_private;
diff --git a/lldb/unittests/Instruction/LoongArch/TestLoongArchEmulator.cpp b/lldb/unittests/Instruction/LoongArch/TestLoongArchEmulator.cpp
index c53b0bde52a090..ac6d31687b2691 100644
--- a/lldb/unittests/Instruction/LoongArch/TestLoongArchEmulator.cpp
+++ b/lldb/unittests/Instruction/LoongArch/TestLoongArchEmulator.cpp
@@ -15,8 +15,8 @@
#include "gtest/gtest.h"
#include "Plugins/Instruction/LoongArch/EmulateInstructionLoongArch.h"
-#include "Plugins/Process/Utility/RegisterInfoCommon_loongarch64.h"
-#include "Plugins/Process/Utility/lldb-loongarch-register-enums.h"
+#include "Register/Common/RegisterInfoCommon_loongarch64.h"
+#include "Register/Arch/lldb-loongarch-register-enums.h"
using namespace llvm;
using namespace lldb;
diff --git a/lldb/unittests/Instruction/RISCV/TestRISCVEmulator.cpp b/lldb/unittests/Instruction/RISCV/TestRISCVEmulator.cpp
index ebc80a3dd45d52..4459fe265e6bf5 100644
--- a/lldb/unittests/Instruction/RISCV/TestRISCVEmulator.cpp
+++ b/lldb/unittests/Instruction/RISCV/TestRISCVEmulator.cpp
@@ -16,9 +16,9 @@
#include "lldb/Utility/RegisterValue.h"
#include "Plugins/Instruction/RISCV/EmulateInstructionRISCV.h"
-#include "Plugins/Process/Utility/RegisterInfoCommon_riscv32.h"
-#include "Plugins/Process/Utility/RegisterInfoCommon_riscv64.h"
-#include "Plugins/Process/Utility/lldb-riscv-register-enums.h"
+#include "Register/Common/RegisterInfoCommon_riscv32.h"
+#include "Register/Common/RegisterInfoCommon_riscv64.h"
+#include "Register/Arch/lldb-riscv-register-enums.h"
using namespace llvm;
using namespace lldb;
diff --git a/lldb/unittests/Instruction/RISCV/TestRiscvInstEmulation.cpp b/lldb/unittests/Instruction/RISCV/TestRiscvInstEmulation.cpp
index 009b9cdc79607a..dfa5c2ad4f851d 100644
--- a/lldb/unittests/Instruction/RISCV/TestRiscvInstEmulation.cpp
+++ b/lldb/unittests/Instruction/RISCV/TestRiscvInstEmulation.cpp
@@ -16,7 +16,7 @@
#include "Plugins/Disassembler/LLVMC/DisassemblerLLVMC.h"
#include "Plugins/Instruction/RISCV/EmulateInstructionRISCV.h"
-#include "Plugins/Process/Utility/lldb-riscv-register-enums.h"
+#include "Register/Arch/lldb-riscv-register-enums.h"
#include "llvm/Support/TargetSelect.h"
using namespace lldb;
diff --git a/lldb/unittests/ObjectFile/PECOFF/TestPECallFrameInfo.cpp b/lldb/unittests/ObjectFile/PECOFF/TestPECallFrameInfo.cpp
index 264678e4c4ed32..ab89d5f82df2a6 100644
--- a/lldb/unittests/ObjectFile/PECOFF/TestPECallFrameInfo.cpp
+++ b/lldb/unittests/ObjectFile/PECOFF/TestPECallFrameInfo.cpp
@@ -10,7 +10,7 @@
#include "gtest/gtest.h"
#include "Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h"
-#include "Plugins/Process/Utility/lldb-x86-register-enums.h"
+#include "Register/Arch/lldb-x86-register-enums.h"
#include "TestingSupport/SubsystemRAII.h"
#include "TestingSupport/TestUtilities.h"
diff --git a/lldb/unittests/ObjectFile/PECOFF/TestSectionSize.cpp b/lldb/unittests/ObjectFile/PECOFF/TestSectionSize.cpp
index 1a95a0d0fc4e97..0021169509b4da 100644
--- a/lldb/unittests/ObjectFile/PECOFF/TestSectionSize.cpp
+++ b/lldb/unittests/ObjectFile/PECOFF/TestSectionSize.cpp
@@ -10,7 +10,7 @@
#include "gtest/gtest.h"
#include "Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h"
-#include "Plugins/Process/Utility/lldb-x86-register-enums.h"
+#include "Register/Arch/lldb-x86-register-enums.h"
#include "TestingSupport/SubsystemRAII.h"
#include "TestingSupport/TestUtilities.h"
@@ -75,4 +75,3 @@ symbols: []
// without the zero padding, instead of SizeOfRawData (512).
EXPECT_EQ(section_data.GetByteSize(), (uint64_t)496);
}
-
diff --git a/lldb/unittests/Process/Utility/RegisterInfoFreeBSDTest.cpp b/lldb/unittests/Process/Utility/RegisterInfoFreeBSDTest.cpp
index f8be5f7262aa45..332100f5c9c8fd 100644
--- a/lldb/unittests/Process/Utility/RegisterInfoFreeBSDTest.cpp
+++ b/lldb/unittests/Process/Utility/RegisterInfoFreeBSDTest.cpp
@@ -17,15 +17,15 @@
#include "gmock/gmock.h"
#include "gtest/gtest.h"
-#include "Plugins/Process/Utility/RegisterInfoFreeBSD_i386.h"
-#include "Plugins/Process/Utility/RegisterInfoFreeBSD_powerpc.h"
-#include "Plugins/Process/Utility/RegisterInfoFreeBSD_x86_64.h"
+#include "Register/FreeBSD/RegisterInfoFreeBSD_i386.h"
+#include "Register/FreeBSD/RegisterInfoFreeBSD_powerpc.h"
+#include "Register/FreeBSD/RegisterInfoFreeBSD_x86_64.h"
#include "Plugins/Process/Utility/RegisterContextPOSIX_powerpc.h"
-#include "Plugins/Process/Utility/RegisterInfoCommon_arm.h"
-#include "Plugins/Process/Utility/RegisterInfoCommon_arm64.h"
-#include "Plugins/Process/Utility/lldb-arm-register-enums.h"
-#include "Plugins/Process/Utility/lldb-arm64-register-enums.h"
-#include "Plugins/Process/Utility/lldb-x86-register-enums.h"
+#include "Register/Common/RegisterInfoCommon_arm.h"
+#include "Register/Common/RegisterInfoCommon_arm64.h"
+#include "Register/Arch/lldb-arm-register-enums.h"
+#include "Register/Arch/lldb-arm64-register-enums.h"
+#include "Register/Arch/lldb-x86-register-enums.h"
using namespace lldb;
using namespace lldb_private;
diff --git a/lldb/unittests/Process/Utility/RegisterInfoNetBSDTest_i386.cpp b/lldb/unittests/Process/Utility/RegisterInfoNetBSDTest_i386.cpp
index e0947c7d05b244..784b4e75bb92a2 100644
--- a/lldb/unittests/Process/Utility/RegisterInfoNetBSDTest_i386.cpp
+++ b/lldb/unittests/Process/Utility/RegisterInfoNetBSDTest_i386.cpp
@@ -16,8 +16,8 @@
#include "gmock/gmock.h"
#include "gtest/gtest.h"
-#include "Plugins/Process/Utility/lldb-x86-register-enums.h"
-#include "Plugins/Process/Utility/RegisterInfoNetBSD_i386.h"
+#include "Register/Arch/lldb-x86-register-enums.h"
+#include "Register/NetBSD/RegisterInfoNetBSD_i386.h"
using namespace lldb;
using namespace lldb_private;
diff --git a/lldb/unittests/Process/Utility/RegisterInfoNetBSDTest_x86_64.cpp b/lldb/unittests/Process/Utility/RegisterInfoNetBSDTest_x86_64.cpp
index c0bfc01c6bf219..4c97a13434d29d 100644
--- a/lldb/unittests/Process/Utility/RegisterInfoNetBSDTest_x86_64.cpp
+++ b/lldb/unittests/Process/Utility/RegisterInfoNetBSDTest_x86_64.cpp
@@ -16,9 +16,9 @@
#include "gmock/gmock.h"
#include "gtest/gtest.h"
-#include "Plugins/Process/Utility/lldb-x86-register-enums.h"
-#include "Plugins/Process/Utility/RegisterInfoNetBSD_i386.h"
-#include "Plugins/Process/Utility/RegisterInfoNetBSD_x86_64.h"
+#include "Register/Arch/lldb-x86-register-enums.h"
+#include "Register/NetBSD/RegisterInfoNetBSD_i386.h"
+#include "Register/NetBSD/RegisterInfoNetBSD_x86_64.h"
using namespace lldb;
using namespace lldb_private;
diff --git a/lldb/unittests/Process/Utility/RegisterInfo_x86Test.cpp b/lldb/unittests/Process/Utility/RegisterInfo_x86Test.cpp
index 302fbbcbba9dec..9668e4ac6ed287 100644
--- a/lldb/unittests/Process/Utility/RegisterInfo_x86Test.cpp
+++ b/lldb/unittests/Process/Utility/RegisterInfo_x86Test.cpp
@@ -8,7 +8,7 @@
#include "gtest/gtest.h"
-#include "Plugins/Process/Utility/RegisterContext_x86.h"
+#include "Register/Arch/RegisterContext_x86.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/FormatVariadic.h"
diff --git a/lldb/unittests/Process/minidump/RegisterContextMinidumpTest.cpp b/lldb/unittests/Process/minidump/RegisterContextMinidumpTest.cpp
index 18fb6ed001ff19..2a3ba654982e1e 100644
--- a/lldb/unittests/Process/minidump/RegisterContextMinidumpTest.cpp
+++ b/lldb/unittests/Process/minidump/RegisterContextMinidumpTest.cpp
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#include "Plugins/Process/Utility/RegisterInfoLinux_i386.h"
-#include "Plugins/Process/Utility/RegisterInfoLinux_x86_64.h"
+#include "Register/Linux/RegisterInfoLinux_i386.h"
+#include "Register/Linux/RegisterInfoLinux_x86_64.h"
#include "Plugins/Process/minidump/RegisterContextMinidump_x86_32.h"
#include "Plugins/Process/minidump/RegisterContextMinidump_x86_64.h"
#include "Plugins/Process/minidump/RegisterContextMinidump_ARM.h"
diff --git a/lldb/unittests/Symbol/TestDWARFCallFrameInfo.cpp b/lldb/unittests/Symbol/TestDWARFCallFrameInfo.cpp
index c52e9a7387e14d..d2c258712c1efc 100644
--- a/lldb/unittests/Symbol/TestDWARFCallFrameInfo.cpp
+++ b/lldb/unittests/Symbol/TestDWARFCallFrameInfo.cpp
@@ -11,7 +11,7 @@
#include "gtest/gtest.h"
#include "Plugins/ObjectFile/ELF/ObjectFileELF.h"
-#include "Plugins/Process/Utility/RegisterContext_x86.h"
+#include "Register/Arch/RegisterContext_x86.h"
#include "Plugins/SymbolFile/Symtab/SymbolFileSymtab.h"
#include "TestingSupport/SubsystemRAII.h"
#include "TestingSupport/TestUtilities.h"
diff --git a/lldb/unittests/UnwindAssembly/ARM64/TestArm64InstEmulation.cpp b/lldb/unittests/UnwindAssembly/ARM64/TestArm64InstEmulation.cpp
index 12a1d2d015d508..94485c91f6154b 100644
--- a/lldb/unittests/UnwindAssembly/ARM64/TestArm64InstEmulation.cpp
+++ b/lldb/unittests/UnwindAssembly/ARM64/TestArm64InstEmulation.cpp
@@ -32,6 +32,7 @@
#include "lldb/Symbol/Symbol.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/FormatVariadic.h"
+#include "Register/Arch/lldb-arm64-register-enums.h"
#include "llvm/Support/TargetSelect.h"
using namespace lldb;
diff --git a/lldb/unittests/UnwindAssembly/PPC64/TestPPC64InstEmulation.cpp b/lldb/unittests/UnwindAssembly/PPC64/TestPPC64InstEmulation.cpp
index 1a528da620779c..a8295a7e2edf6c 100644
--- a/lldb/unittests/UnwindAssembly/PPC64/TestPPC64InstEmulation.cpp
+++ b/lldb/unittests/UnwindAssembly/PPC64/TestPPC64InstEmulation.cpp
@@ -20,7 +20,7 @@
#include "Plugins/Disassembler/LLVMC/DisassemblerLLVMC.h"
#include "Plugins/Instruction/PPC64/EmulateInstructionPPC64.h"
-#include "Plugins/Process/Utility/lldb-ppc64le-register-enums.h"
+#include "Register/Arch/lldb-ppc64le-register-enums.h"
#include "llvm/Support/TargetSelect.h"
using namespace lldb;
diff --git a/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Utility/BUILD.gn b/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Utility/BUILD.gn
index 88841256310bf6..59c70635001112 100644
--- a/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Utility/BUILD.gn
+++ b/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Utility/BUILD.gn
@@ -1,46 +1,8 @@
-static_library("Register") {
- output_name = "lldbRegister"
- configs += [ "//llvm/utils/gn/build:lldb_code" ]
- deps = [
- "//lldb/source/Utility",
- "//llvm/lib/Support",
- "//llvm/lib/TargetParser",
- ]
-
- # Uses source-relative includes for own headers.
- include_dirs = [ "//lldb/source" ]
- sources = [
- "RegisterInfoFreeBSD_i386.cpp",
- "RegisterInfoFreeBSD_powerpc.cpp",
- "RegisterInfoFreeBSD_x86_64.cpp",
- "RegisterInfoLinux_i386.cpp",
- "RegisterInfoLinux_s390x.cpp",
- "RegisterInfoLinux_x86_64.cpp",
- "RegisterInfoNetBSD_i386.cpp",
- "RegisterInfoNetBSD_x86_64.cpp",
- "RegisterInfoOpenBSD_i386.cpp",
- "RegisterInfoOpenBSD_x86_64.cpp",
- "RegisterInfoWindows_i386.cpp",
- "RegisterInfoWindows_x86_64.cpp",
- "RegisterContext_x86.cpp",
- "RegisterInfoCommonDynamic_riscv32.cpp",
- "RegisterInfoCommon_arm.cpp",
- "RegisterInfoCommon_arm64.cpp",
- "RegisterInfoCommon_loongarch64.cpp",
- "RegisterInfoCommon_ppc64.cpp",
- "RegisterInfoCommon_ppc64le.cpp",
- "RegisterInfoCommon_riscv32.cpp",
- "RegisterInfoCommon_riscv64.cpp",
- "RegisterInfos_x86_64_with_base_shared.cpp",
- "RegisterTypeDetector_arm64.cpp",
- ]
-}
-
static_library("Utility") {
output_name = "lldbPluginProcessUtility"
configs += [ "//llvm/utils/gn/build:lldb_code" ]
deps = [
- ":Register",
+ "//lldb/source/Register",
#"//lldb/source/Breakpoint", # 3-hop dependency cycle.
"//lldb/source/Core",
"//lldb/source/DataFormatters",
diff --git a/llvm/utils/gn/secondary/lldb/source/Register/BUILD.gn b/llvm/utils/gn/secondary/lldb/source/Register/BUILD.gn
new file mode 100644
index 00000000000000..9d7da52abdff9a
--- /dev/null
+++ b/llvm/utils/gn/secondary/lldb/source/Register/BUILD.gn
@@ -0,0 +1,37 @@
+static_library("Register") {
+ output_name = "lldbRegister"
+ configs += [ "//llvm/utils/gn/build:lldb_code" ]
+ deps = [
+ "//lldb/source/Utility",
+ "//llvm/lib/Support",
+ "//llvm/lib/TargetParser",
+ ]
+
+ # Uses source-relative includes for own headers.
+ include_dirs = [ "//lldb/source" ]
+ sources = [
+ "Arch/RegisterContext_x86.cpp",
+ "Arch/RegisterInfos_x86_64_with_base_shared.cpp",
+ "Common/RegisterInfoCommonDynamic_riscv32.cpp",
+ "Common/RegisterInfoCommon_arm.cpp",
+ "Common/RegisterInfoCommon_arm64.cpp",
+ "Common/RegisterInfoCommon_loongarch64.cpp",
+ "Common/RegisterInfoCommon_ppc64.cpp",
+ "Common/RegisterInfoCommon_ppc64le.cpp",
+ "Common/RegisterInfoCommon_riscv32.cpp",
+ "Common/RegisterInfoCommon_riscv64.cpp",
+ "Common/RegisterTypeDetector_arm64.cpp",
+ "FreeBSD/RegisterInfoFreeBSD_i386.cpp",
+ "FreeBSD/RegisterInfoFreeBSD_powerpc.cpp",
+ "FreeBSD/RegisterInfoFreeBSD_x86_64.cpp",
+ "Linux/RegisterInfoLinux_i386.cpp",
+ "Linux/RegisterInfoLinux_s390x.cpp",
+ "Linux/RegisterInfoLinux_x86_64.cpp",
+ "NetBSD/RegisterInfoNetBSD_i386.cpp",
+ "NetBSD/RegisterInfoNetBSD_x86_64.cpp",
+ "OpenBSD/RegisterInfoOpenBSD_i386.cpp",
+ "OpenBSD/RegisterInfoOpenBSD_x86_64.cpp",
+ "Windows/RegisterInfoWindows_i386.cpp",
+ "Windows/RegisterInfoWindows_x86_64.cpp",
+ ]
+}
>From e796997ebb8d20ef5dcc6a1c007143e2d10ba8ae Mon Sep 17 00:00:00 2001
From: Minsoo Choo <minsoo at minsoo.io>
Date: Sun, 6 Sep 2026 09:59:29 -0400
Subject: [PATCH 4/6] [lldb] Extract native process support
---
.../source/Plugins/Process/AIX/CMakeLists.txt | 1 +
.../Process/AIX/NativeRegisterContextAIX.h | 2 +-
lldb/source/Plugins/Process/CMakeLists.txt | 1 +
.../Plugins/Process/FreeBSD/CMakeLists.txt | 1 +
.../FreeBSD/NativeRegisterContextFreeBSD.h | 2 +-
.../NativeRegisterContextFreeBSD_arm64.h | 2 +-
.../NativeRegisterContextFreeBSD_x86.h | 2 +-
.../Plugins/Process/Linux/CMakeLists.txt | 1 +
.../Linux/NativeRegisterContextLinux.h | 2 +-
.../Linux/NativeRegisterContextLinux_arm.h | 2 +-
.../Linux/NativeRegisterContextLinux_arm64.h | 2 +-
.../NativeRegisterContextLinux_arm64dbreg.h | 2 +-
.../NativeRegisterContextLinux_loongarch64.h | 2 +-
.../Linux/NativeRegisterContextLinux_x86.h | 2 +-
.../Process/NativeCommon/CMakeLists.txt | 21 +
.../NativeRegisterContextDBReg.cpp | 410 ++++++++++++++++++
.../NativeRegisterContextDBReg.h | 8 +-
.../NativeRegisterContextDBReg_arm.cpp | 0
.../NativeRegisterContextDBReg_arm.h | 8 +-
.../NativeRegisterContextDBReg_arm64.cpp | 0
.../NativeRegisterContextDBReg_arm64.h | 8 +-
.../NativeRegisterContextDBReg_loongarch.cpp | 0
.../NativeRegisterContextDBReg_loongarch.h | 8 +-
.../NativeRegisterContextDBReg_x86.cpp | 0
.../NativeRegisterContextDBReg_x86.h | 8 +-
.../NativeRegisterContextRegisterInfo.cpp | 0
.../NativeRegisterContextRegisterInfo.h | 6 +-
.../Plugins/Process/NetBSD/CMakeLists.txt | 1 +
.../NetBSD/NativeRegisterContextNetBSD.h | 2 +-
.../NetBSD/NativeRegisterContextNetBSD_x86.h | 2 +-
.../Plugins/Process/Utility/CMakeLists.txt | 6 -
.../Process/Windows/Common/CMakeLists.txt | 1 +
.../Common/NativeRegisterContextWindows.h | 2 +-
.../NativeRegisterContextWindows_arm64.h | 2 +-
.../RegisterInfos_x86_64_with_base_shared.h | 3 +-
.../source/Plugins/Process/Linux/BUILD.gn | 1 +
.../Plugins/Process/NativeCommon/BUILD.gn | 22 +
.../source/Plugins/Process/Utility/BUILD.gn | 6 -
.../Plugins/Process/Windows/Common/BUILD.gn | 1 +
39 files changed, 499 insertions(+), 51 deletions(-)
create mode 100644 lldb/source/Plugins/Process/NativeCommon/CMakeLists.txt
create mode 100644 lldb/source/Plugins/Process/NativeCommon/NativeRegisterContextDBReg.cpp
rename lldb/source/Plugins/Process/{Utility => NativeCommon}/NativeRegisterContextDBReg.h (91%)
rename lldb/source/Plugins/Process/{Utility => NativeCommon}/NativeRegisterContextDBReg_arm.cpp (100%)
rename lldb/source/Plugins/Process/{Utility => NativeCommon}/NativeRegisterContextDBReg_arm.h (78%)
rename lldb/source/Plugins/Process/{Utility => NativeCommon}/NativeRegisterContextDBReg_arm64.cpp (100%)
rename lldb/source/Plugins/Process/{Utility => NativeCommon}/NativeRegisterContextDBReg_arm64.h (73%)
rename lldb/source/Plugins/Process/{Utility => NativeCommon}/NativeRegisterContextDBReg_loongarch.cpp (100%)
rename lldb/source/Plugins/Process/{Utility => NativeCommon}/NativeRegisterContextDBReg_loongarch.h (73%)
rename lldb/source/Plugins/Process/{Utility => NativeCommon}/NativeRegisterContextDBReg_x86.cpp (100%)
rename lldb/source/Plugins/Process/{Utility => NativeCommon}/NativeRegisterContextDBReg_x86.h (81%)
rename lldb/source/Plugins/Process/{Utility => NativeCommon}/NativeRegisterContextRegisterInfo.cpp (100%)
rename lldb/source/Plugins/Process/{Utility => NativeCommon}/NativeRegisterContextRegisterInfo.h (85%)
create mode 100644 llvm/utils/gn/secondary/lldb/source/Plugins/Process/NativeCommon/BUILD.gn
diff --git a/lldb/source/Plugins/Process/AIX/CMakeLists.txt b/lldb/source/Plugins/Process/AIX/CMakeLists.txt
index f1f91218227363..3ca961eebac26c 100644
--- a/lldb/source/Plugins/Process/AIX/CMakeLists.txt
+++ b/lldb/source/Plugins/Process/AIX/CMakeLists.txt
@@ -7,6 +7,7 @@ add_lldb_library(lldbPluginProcessAIX
LINK_COMPONENTS
Support
LINK_LIBS
+ lldbNativeProcessSupport
lldbCore
lldbHost
lldbSymbol
diff --git a/lldb/source/Plugins/Process/AIX/NativeRegisterContextAIX.h b/lldb/source/Plugins/Process/AIX/NativeRegisterContextAIX.h
index 1f4f79627db413..c4af6f3d5b392a 100644
--- a/lldb/source/Plugins/Process/AIX/NativeRegisterContextAIX.h
+++ b/lldb/source/Plugins/Process/AIX/NativeRegisterContextAIX.h
@@ -9,7 +9,7 @@
#ifndef LLDB_SOURCE_PLUGINS_PROCESS_AIX_NATIVEREGISTERCONTEXTAIX_H
#define LLDB_SOURCE_PLUGINS_PROCESS_AIX_NATIVEREGISTERCONTEXTAIX_H
-#include "Plugins/Process/Utility/NativeRegisterContextRegisterInfo.h"
+#include "Plugins/Process/NativeCommon/NativeRegisterContextRegisterInfo.h"
namespace lldb_private::process_aix {
diff --git a/lldb/source/Plugins/Process/CMakeLists.txt b/lldb/source/Plugins/Process/CMakeLists.txt
index 84cc65e45157e4..1599da896aca08 100644
--- a/lldb/source/Plugins/Process/CMakeLists.txt
+++ b/lldb/source/Plugins/Process/CMakeLists.txt
@@ -23,6 +23,7 @@ endif()
add_subdirectory(FreeBSD-Kernel-Core)
add_subdirectory(MacOSX-Kernel)
+add_subdirectory(NativeCommon)
add_subdirectory(scripted)
add_subdirectory(gdb-remote)
add_subdirectory(Utility)
diff --git a/lldb/source/Plugins/Process/FreeBSD/CMakeLists.txt b/lldb/source/Plugins/Process/FreeBSD/CMakeLists.txt
index 559e6ff0dd570d..0599191d408581 100644
--- a/lldb/source/Plugins/Process/FreeBSD/CMakeLists.txt
+++ b/lldb/source/Plugins/Process/FreeBSD/CMakeLists.txt
@@ -10,6 +10,7 @@ add_lldb_library(lldbPluginProcessFreeBSD
LINK_COMPONENTS
Support
LINK_LIBS
+ lldbNativeProcessSupport
lldbHost
lldbSymbol
lldbTarget
diff --git a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD.h b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD.h
index b7f659ef24de2c..8bec2bc1f447e5 100644
--- a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD.h
+++ b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD.h
@@ -9,7 +9,7 @@
#ifndef lldb_NativeRegisterContextFreeBSD_h
#define lldb_NativeRegisterContextFreeBSD_h
-#include "Plugins/Process/Utility/NativeRegisterContextRegisterInfo.h"
+#include "Plugins/Process/NativeCommon/NativeRegisterContextRegisterInfo.h"
namespace lldb_private {
namespace process_freebsd {
diff --git a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm64.h b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm64.h
index b40507add17f3f..044e90c6a5eb48 100644
--- a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm64.h
+++ b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_arm64.h
@@ -18,7 +18,7 @@
// clang-format on
#include "Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD.h"
-#include "Plugins/Process/Utility/NativeRegisterContextDBReg_arm64.h"
+#include "Plugins/Process/NativeCommon/NativeRegisterContextDBReg_arm64.h"
#include "Register/Common/RegisterInfoCommon_arm64.h"
#include <array>
diff --git a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_x86.h b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_x86.h
index 9d86935d13c32a..ef628c2009eb33 100644
--- a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_x86.h
+++ b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_x86.h
@@ -22,7 +22,7 @@
#include <optional>
#include "Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD.h"
-#include "Plugins/Process/Utility/NativeRegisterContextDBReg_x86.h"
+#include "Plugins/Process/NativeCommon/NativeRegisterContextDBReg_x86.h"
#include "Register/Arch/RegisterContext_x86.h"
#include "Register/Arch/lldb-x86-register-enums.h"
diff --git a/lldb/source/Plugins/Process/Linux/CMakeLists.txt b/lldb/source/Plugins/Process/Linux/CMakeLists.txt
index ce624a5211b056..b77b203fb295c8 100644
--- a/lldb/source/Plugins/Process/Linux/CMakeLists.txt
+++ b/lldb/source/Plugins/Process/Linux/CMakeLists.txt
@@ -23,6 +23,7 @@ add_lldb_library(lldbPluginProcessLinux
Support
TargetParser
LINK_LIBS
+ lldbNativeProcessSupport
lldbCore
lldbHost
lldbSymbol
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux.h b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux.h
index 797eacc3bdd0f0..b18e308ad0b345 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux.h
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux.h
@@ -9,7 +9,7 @@
#ifndef lldb_NativeRegisterContextLinux_h
#define lldb_NativeRegisterContextLinux_h
-#include "Plugins/Process/Utility/NativeRegisterContextRegisterInfo.h"
+#include "Plugins/Process/NativeCommon/NativeRegisterContextRegisterInfo.h"
#include "lldb/Host/common/NativeThreadProtocol.h"
#include "lldb/Target/MemoryTagManager.h"
#include "llvm/Support/Error.h"
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h
index 949a27fc5c139e..d813809a9afb4f 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h
@@ -12,7 +12,7 @@
#define lldb_NativeRegisterContextLinux_arm_h
#include "Plugins/Process/Linux/NativeRegisterContextLinux.h"
-#include "Plugins/Process/Utility/NativeRegisterContextDBReg_arm.h"
+#include "Plugins/Process/NativeCommon/NativeRegisterContextDBReg_arm.h"
#include "Register/Common/RegisterInfoCommon_arm.h"
#include "Register/Arch/lldb-arm-register-enums.h"
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h
index 44d3b191d509a5..117666eea20636 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h
@@ -13,7 +13,7 @@
#include "Plugins/Process/Linux/NativeRegisterContextLinux.h"
#include "Plugins/Process/Utility/LinuxPTraceDefines_arm64sve.h"
-#include "Plugins/Process/Utility/NativeRegisterContextDBReg_arm64.h"
+#include "Plugins/Process/NativeCommon/NativeRegisterContextDBReg_arm64.h"
#include "Register/Common/RegisterInfoCommon_arm64.h"
#include "llvm/ADT/BitmaskEnum.h"
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64dbreg.h b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64dbreg.h
index bca217851858de..2026d6e19eca9f 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64dbreg.h
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64dbreg.h
@@ -12,7 +12,7 @@
// context for 64-bit server.
#include "Plugins/Process/Linux/NativeProcessLinux.h"
-#include "Plugins/Process/Utility/NativeRegisterContextDBReg.h"
+#include "Plugins/Process/NativeCommon/NativeRegisterContextDBReg.h"
#include "lldb/Utility/Status.h"
namespace lldb_private {
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_loongarch64.h b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_loongarch64.h
index 1ee8ffa8681f23..5e081dbbdaae0c 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_loongarch64.h
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_loongarch64.h
@@ -12,7 +12,7 @@
#define lldb_NativeRegisterContextLinux_loongarch64_h
#include "Plugins/Process/Linux/NativeRegisterContextLinux.h"
-#include "Plugins/Process/Utility/NativeRegisterContextDBReg_loongarch.h"
+#include "Plugins/Process/NativeCommon/NativeRegisterContextDBReg_loongarch.h"
#include "Register/Common/RegisterInfoCommon_loongarch64.h"
#include <asm/ptrace.h>
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86.h b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86.h
index b58ae5bebe95fa..60a471fd5d5e7c 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86.h
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86.h
@@ -12,7 +12,7 @@
#define lldb_NativeRegisterContextLinux_x86_h
#include "Plugins/Process/Linux/NativeRegisterContextLinux.h"
-#include "Plugins/Process/Utility/NativeRegisterContextDBReg_x86.h"
+#include "Plugins/Process/NativeCommon/NativeRegisterContextDBReg_x86.h"
#include "Register/Linux/RegisterInfoLinux_x86.h"
#include "Register/Arch/RegisterContext_x86.h"
#include "Register/Arch/lldb-x86-register-enums.h"
diff --git a/lldb/source/Plugins/Process/NativeCommon/CMakeLists.txt b/lldb/source/Plugins/Process/NativeCommon/CMakeLists.txt
new file mode 100644
index 00000000000000..fecf53fad414f5
--- /dev/null
+++ b/lldb/source/Plugins/Process/NativeCommon/CMakeLists.txt
@@ -0,0 +1,21 @@
+add_lldb_library(lldbNativeProcessSupport NO_PLUGIN_DEPENDENCIES
+ NativeRegisterContextDBReg.cpp
+ NativeRegisterContextDBReg_arm.cpp
+ NativeRegisterContextDBReg_arm64.cpp
+ NativeRegisterContextDBReg_loongarch.cpp
+ NativeRegisterContextDBReg_x86.cpp
+ NativeRegisterContextRegisterInfo.cpp
+
+ LINK_COMPONENTS
+ Support
+ LINK_LIBS
+ lldbCore
+ lldbHost
+ lldbRegister
+ lldbUtility
+ ALLOWED_INTERNAL_DEPENDENCIES
+ lldbCore
+ lldbHost
+ lldbRegister
+ lldbUtility
+ )
diff --git a/lldb/source/Plugins/Process/NativeCommon/NativeRegisterContextDBReg.cpp b/lldb/source/Plugins/Process/NativeCommon/NativeRegisterContextDBReg.cpp
new file mode 100644
index 00000000000000..f35027e9351401
--- /dev/null
+++ b/lldb/source/Plugins/Process/NativeCommon/NativeRegisterContextDBReg.cpp
@@ -0,0 +1,410 @@
+//===-- NativeRegisterContextDBReg.cpp ------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "NativeRegisterContextDBReg.h"
+
+#include "lldb/Utility/LLDBLog.h"
+#include "lldb/Utility/Log.h"
+#include "lldb/Utility/RegisterValue.h"
+
+using namespace lldb_private;
+
+uint32_t NativeRegisterContextDBReg::NumSupportedHardwareBreakpoints() {
+ Log *log = GetLog(LLDBLog::Breakpoints);
+
+ // Read hardware breakpoint and watchpoint information.
+ llvm::Error error = ReadHardwareDebugInfo();
+
+ if (error) {
+ LLDB_LOG_ERROR(log, std::move(error),
+ "failed to read debug registers: {0}");
+ return 0;
+ }
+
+ LLDB_LOG(log, "{0}", m_max_hbp_supported);
+ return m_max_hbp_supported;
+}
+
+uint32_t NativeRegisterContextDBReg::SetHardwareBreakpoint(lldb::addr_t addr,
+ size_t size) {
+ Log *log = GetLog(LLDBLog::Breakpoints);
+ LLDB_LOG(log, "addr: {0:x}, size: {1:x}", addr, size);
+
+ // Read hardware breakpoint and watchpoint information.
+ llvm::Error error = ReadHardwareDebugInfo();
+ if (error) {
+ LLDB_LOG_ERROR(
+ log, std::move(error),
+ "unable to set breakpoint: failed to read debug registers: {0}");
+ return LLDB_INVALID_INDEX32;
+ }
+
+ if (!ValidateBreakpoint(size, addr))
+ return LLDB_INVALID_INDEX32;
+
+ uint32_t control_value = MakeBreakControlValue(size);
+ auto details = AdjustBreakpoint({size, addr});
+ size = details.size;
+ addr = details.addr;
+
+ // Iterate over stored breakpoints and find a free bp_index
+ uint32_t bp_index = LLDB_INVALID_INDEX32;
+ for (uint32_t i = 0; i < m_max_hbp_supported; i++) {
+ if (!BreakpointIsEnabled(i))
+ bp_index = i; // Mark last free slot
+ else if (m_hbp_regs[i].address == addr)
+ return LLDB_INVALID_INDEX32; // We do not support duplicate breakpoints.
+ }
+
+ if (bp_index == LLDB_INVALID_INDEX32)
+ return LLDB_INVALID_INDEX32;
+
+ // Update breakpoint in local cache
+ m_hbp_regs[bp_index].real_addr = addr;
+ m_hbp_regs[bp_index].address = addr;
+ m_hbp_regs[bp_index].control = control_value;
+
+ // PTRACE call to set corresponding hardware breakpoint register.
+ error = WriteHardwareDebugRegs(eDREGTypeBREAK);
+
+ if (error) {
+ m_hbp_regs[bp_index].address = 0;
+ m_hbp_regs[bp_index].control &= ~m_hw_dbg_enable_bit;
+
+ LLDB_LOG_ERROR(
+ log, std::move(error),
+ "unable to set breakpoint: failed to write debug registers: {0}");
+ return LLDB_INVALID_INDEX32;
+ }
+
+ return bp_index;
+}
+
+bool NativeRegisterContextDBReg::ClearHardwareBreakpoint(uint32_t hw_idx) {
+ Log *log = GetLog(LLDBLog::Breakpoints);
+ LLDB_LOG(log, "hw_idx: {0}", hw_idx);
+
+ // Read hardware breakpoint and watchpoint information.
+ llvm::Error error = ReadHardwareDebugInfo();
+ if (error) {
+ LLDB_LOG_ERROR(
+ log, std::move(error),
+ "unable to clear breakpoint: failed to read debug registers: {0}");
+ return false;
+ }
+
+ if (hw_idx >= m_max_hbp_supported)
+ return false;
+
+ // Create a backup we can revert to in case of failure.
+ lldb::addr_t tempAddr = m_hbp_regs[hw_idx].address;
+ uint32_t tempControl = m_hbp_regs[hw_idx].control;
+
+ m_hbp_regs[hw_idx].control &= ~m_hw_dbg_enable_bit;
+ m_hbp_regs[hw_idx].address = 0;
+
+ // PTRACE call to clear corresponding hardware breakpoint register.
+ error = WriteHardwareDebugRegs(eDREGTypeBREAK);
+
+ if (error) {
+ m_hbp_regs[hw_idx].control = tempControl;
+ m_hbp_regs[hw_idx].address = tempAddr;
+
+ LLDB_LOG_ERROR(
+ log, std::move(error),
+ "unable to clear breakpoint: failed to write debug registers: {0}");
+ return false;
+ }
+
+ return true;
+}
+
+Status
+NativeRegisterContextDBReg::GetHardwareBreakHitIndex(uint32_t &bp_index,
+ lldb::addr_t trap_addr) {
+ Log *log = GetLog(LLDBLog::Breakpoints);
+
+ LLDB_LOGF(log, "NativeRegisterContextDBReg::%s()", __FUNCTION__);
+
+ lldb::addr_t break_addr;
+
+ for (bp_index = 0; bp_index < m_max_hbp_supported; ++bp_index) {
+ break_addr = m_hbp_regs[bp_index].address;
+
+ if (BreakpointIsEnabled(bp_index) && trap_addr == break_addr) {
+ m_hbp_regs[bp_index].hit_addr = trap_addr;
+ return Status();
+ }
+ }
+
+ bp_index = LLDB_INVALID_INDEX32;
+ return Status();
+}
+
+Status NativeRegisterContextDBReg::ClearAllHardwareBreakpoints() {
+ Log *log = GetLog(LLDBLog::Breakpoints);
+
+ LLDB_LOGF(log, "NativeRegisterContextDBReg::%s()", __FUNCTION__);
+
+ // Read hardware breakpoint and watchpoint information.
+ llvm::Error error = ReadHardwareDebugInfo();
+ if (error)
+ return Status::FromError(std::move(error));
+
+ for (uint32_t i = 0; i < m_max_hbp_supported; i++) {
+ if (!BreakpointIsEnabled(i))
+ continue;
+ // Create a backup we can revert to in case of failure.
+ lldb::addr_t tempAddr = m_hbp_regs[i].address;
+ uint32_t tempControl = m_hbp_regs[i].control;
+
+ // Clear watchpoints in local cache
+ m_hbp_regs[i].control &= ~m_hw_dbg_enable_bit;
+ m_hbp_regs[i].address = 0;
+
+ // Ptrace call to update hardware debug registers
+ error = WriteHardwareDebugRegs(eDREGTypeBREAK);
+
+ if (error) {
+ m_hbp_regs[i].control = tempControl;
+ m_hbp_regs[i].address = tempAddr;
+
+ return Status::FromError(std::move(error));
+ }
+ }
+
+ return Status();
+}
+
+bool NativeRegisterContextDBReg::BreakpointIsEnabled(uint32_t bp_index) {
+ return ((m_hbp_regs[bp_index].control & m_hw_dbg_enable_bit) != 0);
+}
+
+uint32_t NativeRegisterContextDBReg::NumSupportedHardwareWatchpoints() {
+ Log *log = GetLog(LLDBLog::Watchpoints);
+ llvm::Error error = ReadHardwareDebugInfo();
+ if (error) {
+ LLDB_LOG_ERROR(log, std::move(error),
+ "failed to read debug registers: {0}");
+ return 0;
+ }
+
+ return m_max_hwp_supported;
+}
+
+uint32_t NativeRegisterContextDBReg::SetHardwareWatchpoint(
+ lldb::addr_t addr, size_t size, uint32_t watch_flags) {
+ Log *log = GetLog(LLDBLog::Watchpoints);
+ LLDB_LOG(log, "addr: {0:x}, size: {1:x} watch_flags: {2:x}", addr, size,
+ watch_flags);
+
+ // Read hardware breakpoint and watchpoint information.
+ llvm::Error error = ReadHardwareDebugInfo();
+ if (error) {
+ LLDB_LOG_ERROR(
+ log, std::move(error),
+ "unable to set watchpoint: failed to read debug registers: {0}");
+ return LLDB_INVALID_INDEX32;
+ }
+
+ uint32_t control_value = 0, wp_index = 0;
+ lldb::addr_t real_addr = addr;
+ WatchpointDetails details{size, addr};
+
+ auto adjusted = AdjustWatchpoint(details);
+ if (adjusted == std::nullopt)
+ return LLDB_INVALID_INDEX32;
+ size = adjusted->size;
+ addr = adjusted->addr;
+
+ // Check if we are setting watchpoint other than read/write/access Also
+ // update watchpoint flag to match ARM/AArch64/LoongArch write-read bit
+ // configuration.
+ switch (watch_flags) {
+ case lldb::eWatchpointKindWrite:
+ watch_flags = 2;
+ break;
+ case lldb::eWatchpointKindRead:
+ watch_flags = 1;
+ break;
+ case (lldb::eWatchpointKindRead | lldb::eWatchpointKindWrite):
+ break;
+ default:
+ return LLDB_INVALID_INDEX32;
+ }
+
+ control_value = MakeWatchControlValue(size, watch_flags);
+
+ // Iterate over stored watchpoints and find a free wp_index
+ wp_index = LLDB_INVALID_INDEX32;
+ for (uint32_t i = 0; i < m_max_hwp_supported; i++) {
+ if (!WatchpointIsEnabled(i))
+ wp_index = i; // Mark last free slot
+ else if (m_hwp_regs[i].address == addr) {
+ return LLDB_INVALID_INDEX32; // We do not support duplicate watchpoints.
+ }
+ }
+
+ if (wp_index == LLDB_INVALID_INDEX32)
+ return LLDB_INVALID_INDEX32;
+
+ // Update watchpoint in local cache
+ m_hwp_regs[wp_index].real_addr = real_addr;
+ m_hwp_regs[wp_index].address = addr;
+ m_hwp_regs[wp_index].control = control_value;
+
+ // PTRACE call to set corresponding watchpoint register.
+ error = WriteHardwareDebugRegs(eDREGTypeWATCH);
+
+ if (error) {
+ m_hwp_regs[wp_index].address = 0;
+ m_hwp_regs[wp_index].control &= ~m_hw_dbg_enable_bit;
+
+ LLDB_LOG_ERROR(
+ log, std::move(error),
+ "unable to set watchpoint: failed to write debug registers: {0}");
+ return LLDB_INVALID_INDEX32;
+ }
+
+ return wp_index;
+}
+
+bool NativeRegisterContextDBReg::ClearHardwareWatchpoint(uint32_t wp_index) {
+ Log *log = GetLog(LLDBLog::Watchpoints);
+ LLDB_LOG(log, "wp_index: {0}", wp_index);
+
+ // Read hardware breakpoint and watchpoint information.
+ llvm::Error error = ReadHardwareDebugInfo();
+ if (error) {
+ LLDB_LOG_ERROR(
+ log, std::move(error),
+ "unable to set watchpoint: failed to read debug registers: {0}");
+ return false;
+ }
+
+ if (wp_index >= m_max_hwp_supported)
+ return false;
+
+ // Create a backup we can revert to in case of failure.
+ lldb::addr_t tempAddr = m_hwp_regs[wp_index].address;
+ uint32_t tempControl = m_hwp_regs[wp_index].control;
+
+ // Update watchpoint in local cache
+ m_hwp_regs[wp_index].control &= ~m_hw_dbg_enable_bit;
+ m_hwp_regs[wp_index].address = 0;
+
+ // Ptrace call to update hardware debug registers
+ error = WriteHardwareDebugRegs(eDREGTypeWATCH);
+
+ if (error) {
+ m_hwp_regs[wp_index].control = tempControl;
+ m_hwp_regs[wp_index].address = tempAddr;
+
+ LLDB_LOG_ERROR(
+ log, std::move(error),
+ "unable to clear watchpoint: failed to read debug registers: {0}");
+ return false;
+ }
+
+ return true;
+}
+
+Status NativeRegisterContextDBReg::ClearAllHardwareWatchpoints() {
+ // Read hardware breakpoint and watchpoint information.
+ llvm::Error error = ReadHardwareDebugInfo();
+ if (error)
+ return Status::FromError(std::move(error));
+
+ for (uint32_t i = 0; i < m_max_hwp_supported; i++) {
+ if (!WatchpointIsEnabled(i))
+ continue;
+ // Create a backup we can revert to in case of failure.
+ lldb::addr_t tempAddr = m_hwp_regs[i].address;
+ uint32_t tempControl = m_hwp_regs[i].control;
+
+ // Clear watchpoints in local cache
+ m_hwp_regs[i].control = 0;
+ m_hwp_regs[i].address = 0;
+
+ // Ptrace call to update hardware debug registers
+ error = WriteHardwareDebugRegs(eDREGTypeWATCH);
+
+ if (error) {
+ m_hwp_regs[i].control = tempControl;
+ m_hwp_regs[i].address = tempAddr;
+
+ return Status::FromError(std::move(error));
+ }
+ }
+
+ return Status();
+}
+
+Status
+NativeRegisterContextDBReg::GetWatchpointHitIndex(uint32_t &wp_index,
+ lldb::addr_t trap_addr) {
+ Log *log = GetLog(LLDBLog::Watchpoints);
+ LLDB_LOG(log, "wp_index: {0}, trap_addr: {1:x}", wp_index, trap_addr);
+
+ // Read hardware breakpoint and watchpoint information.
+ llvm::Error error = ReadHardwareDebugInfo();
+ if (error)
+ return Status::FromError(std::move(error));
+
+ // AArch64 need mask off ignored bits from watchpoint trap address.
+ trap_addr = FixWatchpointHitAddress(trap_addr);
+
+ uint32_t watch_size;
+ lldb::addr_t watch_addr;
+
+ for (wp_index = 0; wp_index < m_max_hwp_supported; ++wp_index) {
+ watch_size = GetWatchpointSize(wp_index);
+ watch_addr = m_hwp_regs[wp_index].address;
+
+ if (WatchpointIsEnabled(wp_index) && trap_addr >= watch_addr &&
+ trap_addr < watch_addr + watch_size) {
+ m_hwp_regs[wp_index].hit_addr = trap_addr;
+ return Status();
+ }
+ }
+
+ wp_index = LLDB_INVALID_INDEX32;
+ return Status();
+}
+
+bool NativeRegisterContextDBReg::WatchpointIsEnabled(uint32_t wp_index) {
+ Log *log = GetLog(LLDBLog::Watchpoints);
+ LLDB_LOG(log, "wp_index: {0}", wp_index);
+ return ((m_hwp_regs[wp_index].control & m_hw_dbg_enable_bit) != 0);
+}
+
+lldb::addr_t
+NativeRegisterContextDBReg::GetWatchpointAddress(uint32_t wp_index) {
+ Log *log = GetLog(LLDBLog::Watchpoints);
+ LLDB_LOG(log, "wp_index: {0}", wp_index);
+
+ if (wp_index >= m_max_hwp_supported)
+ return LLDB_INVALID_ADDRESS;
+
+ if (WatchpointIsEnabled(wp_index))
+ return m_hwp_regs[wp_index].real_addr;
+ return LLDB_INVALID_ADDRESS;
+}
+
+lldb::addr_t
+NativeRegisterContextDBReg::GetWatchpointHitAddress(uint32_t wp_index) {
+ Log *log = GetLog(LLDBLog::Watchpoints);
+ LLDB_LOG(log, "wp_index: {0}", wp_index);
+
+ if (wp_index >= m_max_hwp_supported)
+ return LLDB_INVALID_ADDRESS;
+
+ if (WatchpointIsEnabled(wp_index))
+ return m_hwp_regs[wp_index].hit_addr;
+ return LLDB_INVALID_ADDRESS;
+}
diff --git a/lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg.h b/lldb/source/Plugins/Process/NativeCommon/NativeRegisterContextDBReg.h
similarity index 91%
rename from lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg.h
rename to lldb/source/Plugins/Process/NativeCommon/NativeRegisterContextDBReg.h
index 60d1bfa38dd016..7599ca460d1573 100644
--- a/lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg.h
+++ b/lldb/source/Plugins/Process/NativeCommon/NativeRegisterContextDBReg.h
@@ -6,10 +6,10 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_NATIVEREGISTERCONTEXTDBREG_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_NATIVEREGISTERCONTEXTDBREG_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_NATIVECOMMON_NATIVEREGISTERCONTEXTDBREG_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_NATIVECOMMON_NATIVEREGISTERCONTEXTDBREG_H
-#include "Plugins/Process/Utility/NativeRegisterContextRegisterInfo.h"
+#include "Plugins/Process/NativeCommon/NativeRegisterContextRegisterInfo.h"
#include <array>
#include <optional>
@@ -105,4 +105,4 @@ class NativeRegisterContextDBReg
} // namespace lldb_private
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_NATIVEREGISTERCONTEXTDBREG_H
+#endif // LLDB_SOURCE_PLUGINS_PROCESS_NATIVECOMMON_NATIVEREGISTERCONTEXTDBREG_H
diff --git a/lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_arm.cpp b/lldb/source/Plugins/Process/NativeCommon/NativeRegisterContextDBReg_arm.cpp
similarity index 100%
rename from lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_arm.cpp
rename to lldb/source/Plugins/Process/NativeCommon/NativeRegisterContextDBReg_arm.cpp
diff --git a/lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_arm.h b/lldb/source/Plugins/Process/NativeCommon/NativeRegisterContextDBReg_arm.h
similarity index 78%
rename from lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_arm.h
rename to lldb/source/Plugins/Process/NativeCommon/NativeRegisterContextDBReg_arm.h
index 0d1de2ae2d89b8..38fcf6034e1d76 100644
--- a/lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_arm.h
+++ b/lldb/source/Plugins/Process/NativeCommon/NativeRegisterContextDBReg_arm.h
@@ -6,10 +6,10 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_NATIVEREGISTERCONTEXTDBREG_ARM_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_NATIVEREGISTERCONTEXTDBREG_ARM_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_NATIVECOMMON_NATIVEREGISTERCONTEXTDBREG_ARM_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_NATIVECOMMON_NATIVEREGISTERCONTEXTDBREG_ARM_H
-#include "Plugins/Process/Utility/NativeRegisterContextDBReg.h"
+#include "Plugins/Process/NativeCommon/NativeRegisterContextDBReg.h"
namespace lldb_private {
@@ -39,4 +39,4 @@ class NativeRegisterContextDBReg_arm : public NativeRegisterContextDBReg {
} // namespace lldb_private
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_NATIVEREGISTERCONTEXTDBREG_ARM_H
+#endif // LLDB_SOURCE_PLUGINS_PROCESS_NATIVECOMMON_NATIVEREGISTERCONTEXTDBREG_ARM_H
diff --git a/lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_arm64.cpp b/lldb/source/Plugins/Process/NativeCommon/NativeRegisterContextDBReg_arm64.cpp
similarity index 100%
rename from lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_arm64.cpp
rename to lldb/source/Plugins/Process/NativeCommon/NativeRegisterContextDBReg_arm64.cpp
diff --git a/lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_arm64.h b/lldb/source/Plugins/Process/NativeCommon/NativeRegisterContextDBReg_arm64.h
similarity index 73%
rename from lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_arm64.h
rename to lldb/source/Plugins/Process/NativeCommon/NativeRegisterContextDBReg_arm64.h
index 0dfa5e03fc27b9..8870570c15e306 100644
--- a/lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_arm64.h
+++ b/lldb/source/Plugins/Process/NativeCommon/NativeRegisterContextDBReg_arm64.h
@@ -6,10 +6,10 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_NATIVEREGISTERCONTEXTDBREG_ARM64_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_NATIVEREGISTERCONTEXTDBREG_ARM64_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_NATIVECOMMON_NATIVEREGISTERCONTEXTDBREG_ARM64_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_NATIVECOMMON_NATIVEREGISTERCONTEXTDBREG_ARM64_H
-#include "Plugins/Process/Utility/NativeRegisterContextDBReg.h"
+#include "Plugins/Process/NativeCommon/NativeRegisterContextDBReg.h"
namespace lldb_private {
@@ -31,4 +31,4 @@ class NativeRegisterContextDBReg_arm64 : public NativeRegisterContextDBReg {
} // namespace lldb_private
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_NATIVEREGISTERCONTEXTDBREG_ARM64_H
+#endif // LLDB_SOURCE_PLUGINS_PROCESS_NATIVECOMMON_NATIVEREGISTERCONTEXTDBREG_ARM64_H
diff --git a/lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_loongarch.cpp b/lldb/source/Plugins/Process/NativeCommon/NativeRegisterContextDBReg_loongarch.cpp
similarity index 100%
rename from lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_loongarch.cpp
rename to lldb/source/Plugins/Process/NativeCommon/NativeRegisterContextDBReg_loongarch.cpp
diff --git a/lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_loongarch.h b/lldb/source/Plugins/Process/NativeCommon/NativeRegisterContextDBReg_loongarch.h
similarity index 73%
rename from lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_loongarch.h
rename to lldb/source/Plugins/Process/NativeCommon/NativeRegisterContextDBReg_loongarch.h
index 703f41f3c298b0..bdedb6696e2b61 100644
--- a/lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_loongarch.h
+++ b/lldb/source/Plugins/Process/NativeCommon/NativeRegisterContextDBReg_loongarch.h
@@ -6,10 +6,10 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_NATIVEREGISTERCONTEXTDBREG_LOONGARCH_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_NATIVEREGISTERCONTEXTDBREG_LOONGARCH_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_NATIVECOMMON_NATIVEREGISTERCONTEXTDBREG_LOONGARCH_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_NATIVECOMMON_NATIVEREGISTERCONTEXTDBREG_LOONGARCH_H
-#include "Plugins/Process/Utility/NativeRegisterContextDBReg.h"
+#include "Plugins/Process/NativeCommon/NativeRegisterContextDBReg.h"
namespace lldb_private {
@@ -31,4 +31,4 @@ class NativeRegisterContextDBReg_loongarch : public NativeRegisterContextDBReg {
} // namespace lldb_private
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_NATIVEREGISTERCONTEXTDBREG_LOONGARCH_H
+#endif // LLDB_SOURCE_PLUGINS_PROCESS_NATIVECOMMON_NATIVEREGISTERCONTEXTDBREG_LOONGARCH_H
diff --git a/lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_x86.cpp b/lldb/source/Plugins/Process/NativeCommon/NativeRegisterContextDBReg_x86.cpp
similarity index 100%
rename from lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_x86.cpp
rename to lldb/source/Plugins/Process/NativeCommon/NativeRegisterContextDBReg_x86.cpp
diff --git a/lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_x86.h b/lldb/source/Plugins/Process/NativeCommon/NativeRegisterContextDBReg_x86.h
similarity index 81%
rename from lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_x86.h
rename to lldb/source/Plugins/Process/NativeCommon/NativeRegisterContextDBReg_x86.h
index 8a2c1a1dbcbe13..2f0d08513e6042 100644
--- a/lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_x86.h
+++ b/lldb/source/Plugins/Process/NativeCommon/NativeRegisterContextDBReg_x86.h
@@ -6,10 +6,10 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_NATIVEREGISTERCONTEXTDBREG_X86_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_NATIVEREGISTERCONTEXTDBREG_X86_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_NATIVECOMMON_NATIVEREGISTERCONTEXTDBREG_X86_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_NATIVECOMMON_NATIVEREGISTERCONTEXTDBREG_X86_H
-#include "Plugins/Process/Utility/NativeRegisterContextRegisterInfo.h"
+#include "Plugins/Process/NativeCommon/NativeRegisterContextRegisterInfo.h"
namespace lldb_private {
@@ -45,4 +45,4 @@ class NativeRegisterContextDBReg_x86
} // namespace lldb_private
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_NATIVEREGISTERCONTEXTDBREG_X86_H
+#endif // LLDB_SOURCE_PLUGINS_PROCESS_NATIVECOMMON_NATIVEREGISTERCONTEXTDBREG_X86_H
diff --git a/lldb/source/Plugins/Process/Utility/NativeRegisterContextRegisterInfo.cpp b/lldb/source/Plugins/Process/NativeCommon/NativeRegisterContextRegisterInfo.cpp
similarity index 100%
rename from lldb/source/Plugins/Process/Utility/NativeRegisterContextRegisterInfo.cpp
rename to lldb/source/Plugins/Process/NativeCommon/NativeRegisterContextRegisterInfo.cpp
diff --git a/lldb/source/Plugins/Process/Utility/NativeRegisterContextRegisterInfo.h b/lldb/source/Plugins/Process/NativeCommon/NativeRegisterContextRegisterInfo.h
similarity index 85%
rename from lldb/source/Plugins/Process/Utility/NativeRegisterContextRegisterInfo.h
rename to lldb/source/Plugins/Process/NativeCommon/NativeRegisterContextRegisterInfo.h
index 58a2a4843e4ec7..c66e3e1ed88676 100644
--- a/lldb/source/Plugins/Process/Utility/NativeRegisterContextRegisterInfo.h
+++ b/lldb/source/Plugins/Process/NativeCommon/NativeRegisterContextRegisterInfo.h
@@ -6,12 +6,12 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_NATIVEREGISTERCONTEXTREGISTERINFO_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_NATIVEREGISTERCONTEXTREGISTERINFO_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_NATIVECOMMON_NATIVEREGISTERCONTEXTREGISTERINFO_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_NATIVECOMMON_NATIVEREGISTERCONTEXTREGISTERINFO_H
#include <memory>
-#include "RegisterInfoInterface.h"
+#include "Register/RegisterInfoInterface.h"
#include "lldb/Host/common/NativeRegisterContext.h"
namespace lldb_private {
diff --git a/lldb/source/Plugins/Process/NetBSD/CMakeLists.txt b/lldb/source/Plugins/Process/NetBSD/CMakeLists.txt
index 438e6b6c2a3c7c..df09a2c6e19320 100644
--- a/lldb/source/Plugins/Process/NetBSD/CMakeLists.txt
+++ b/lldb/source/Plugins/Process/NetBSD/CMakeLists.txt
@@ -7,6 +7,7 @@ add_lldb_library(lldbPluginProcessNetBSD
LINK_COMPONENTS
Support
LINK_LIBS
+ lldbNativeProcessSupport
lldbHost
lldbSymbol
lldbTarget
diff --git a/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD.h b/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD.h
index 08490aad9e0ba1..35c0e12ea77e64 100644
--- a/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD.h
+++ b/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD.h
@@ -11,7 +11,7 @@
#include "lldb/Host/common/NativeThreadProtocol.h"
-#include "Plugins/Process/Utility/NativeRegisterContextRegisterInfo.h"
+#include "Plugins/Process/NativeCommon/NativeRegisterContextRegisterInfo.h"
namespace lldb_private {
namespace process_netbsd {
diff --git a/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86.h b/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86.h
index dba5ac78f67d39..e4bf9ac5b691ab 100644
--- a/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86.h
+++ b/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86.h
@@ -23,7 +23,7 @@
#include "Plugins/Process/NetBSD/NativeRegisterContextNetBSD.h"
#include "Register/Arch/RegisterContext_x86.h"
-#include "Plugins/Process/Utility/NativeRegisterContextDBReg_x86.h"
+#include "Plugins/Process/NativeCommon/NativeRegisterContextDBReg_x86.h"
#include "Register/Arch/lldb-x86-register-enums.h"
namespace lldb_private {
diff --git a/lldb/source/Plugins/Process/Utility/CMakeLists.txt b/lldb/source/Plugins/Process/Utility/CMakeLists.txt
index 19a65bfa4fde1f..e74e17971d0356 100644
--- a/lldb/source/Plugins/Process/Utility/CMakeLists.txt
+++ b/lldb/source/Plugins/Process/Utility/CMakeLists.txt
@@ -12,12 +12,6 @@ add_lldb_library(lldbPluginProcessUtility
LinuxSignals.cpp
MemoryTagManagerAArch64MTE.cpp
NativeProcessSoftwareSingleStep.cpp
- NativeRegisterContextDBReg.cpp
- NativeRegisterContextDBReg_arm.cpp
- NativeRegisterContextDBReg_arm64.cpp
- NativeRegisterContextDBReg_loongarch.cpp
- NativeRegisterContextDBReg_x86.cpp
- NativeRegisterContextRegisterInfo.cpp
NetBSDSignals.cpp
OpenBSDSignals.cpp
RegisterContextDarwin_arm.cpp
diff --git a/lldb/source/Plugins/Process/Windows/Common/CMakeLists.txt b/lldb/source/Plugins/Process/Windows/Common/CMakeLists.txt
index c6d8713a831599..913f5dec8e4830 100644
--- a/lldb/source/Plugins/Process/Windows/Common/CMakeLists.txt
+++ b/lldb/source/Plugins/Process/Windows/Common/CMakeLists.txt
@@ -24,6 +24,7 @@ add_lldb_library(lldbPluginProcessWindowsCommon PLUGIN
LINK_COMPONENTS
Support
LINK_LIBS
+ lldbNativeProcessSupport
lldbCore
lldbHost
lldbInterpreter
diff --git a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows.h b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows.h
index 2b71f639d562e9..051e685c52c999 100644
--- a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows.h
+++ b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows.h
@@ -9,7 +9,7 @@
#ifndef liblldb_NativeRegisterContextWindows_h_
#define liblldb_NativeRegisterContextWindows_h_
-#include "Plugins/Process/Utility/NativeRegisterContextRegisterInfo.h"
+#include "Plugins/Process/NativeCommon/NativeRegisterContextRegisterInfo.h"
#include "lldb/Host/common/NativeThreadProtocol.h"
#include "lldb/Utility/DataBufferHeap.h"
diff --git a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm64.h b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm64.h
index 970d4ce26c61f4..091d1946111a24 100644
--- a/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm64.h
+++ b/lldb/source/Plugins/Process/Windows/Common/NativeRegisterContextWindows_arm64.h
@@ -12,7 +12,7 @@
#include "NativeRegisterContextWindows.h"
-#include "Plugins/Process/Utility/NativeRegisterContextDBReg_arm64.h"
+#include "Plugins/Process/NativeCommon/NativeRegisterContextDBReg_arm64.h"
#include "Register/Common/RegisterInfoCommon_arm64.h"
#include "Register/Arch/lldb-arm64-register-enums.h"
diff --git a/lldb/source/Register/Arch/RegisterInfos_x86_64_with_base_shared.h b/lldb/source/Register/Arch/RegisterInfos_x86_64_with_base_shared.h
index 8486e1fe1eb5c1..e93c90e9c880cd 100644
--- a/lldb/source/Register/Arch/RegisterInfos_x86_64_with_base_shared.h
+++ b/lldb/source/Register/Arch/RegisterInfos_x86_64_with_base_shared.h
@@ -7,13 +7,12 @@
//===----------------------------------------------------------------------===//
#include "Register/Arch/lldb-x86-register-enums.h"
+#include "llvm/TargetParser/Triple.h"
#include <stdint.h>
#ifndef lldb_RegisterInfos_x86_64_with_base_shared_h
#define lldb_RegisterInfos_x86_64_with_base_shared_h
-#include "Plugins/Process/Utility/NativeRegisterContextRegisterInfo.h"
-
namespace lldb_private {
struct RegisterInfos_x86_64_with_base_shared {
diff --git a/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Linux/BUILD.gn b/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Linux/BUILD.gn
index 90fd39410939b6..c0383a005d7056 100644
--- a/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Linux/BUILD.gn
+++ b/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Linux/BUILD.gn
@@ -4,6 +4,7 @@ static_library("Linux") {
deps = [
"//lldb/source/Core",
"//lldb/source/Host",
+ "//lldb/source/Plugins/Process/NativeCommon",
"//lldb/source/Plugins/Process/POSIX",
"//lldb/source/Plugins/Process/Utility",
"//lldb/source/Symbol",
diff --git a/llvm/utils/gn/secondary/lldb/source/Plugins/Process/NativeCommon/BUILD.gn b/llvm/utils/gn/secondary/lldb/source/Plugins/Process/NativeCommon/BUILD.gn
new file mode 100644
index 00000000000000..00e851d003b407
--- /dev/null
+++ b/llvm/utils/gn/secondary/lldb/source/Plugins/Process/NativeCommon/BUILD.gn
@@ -0,0 +1,22 @@
+static_library("NativeCommon") {
+ output_name = "lldbNativeProcessSupport"
+ configs += [ "//llvm/utils/gn/build:lldb_code" ]
+ deps = [
+ "//lldb/source/Core",
+ "//lldb/source/Host",
+ "//lldb/source/Register",
+ "//lldb/source/Utility",
+ "//llvm/lib/Support",
+ ]
+
+ # Uses source-relative includes for own headers.
+ include_dirs = [ "//lldb/source" ]
+ sources = [
+ "NativeRegisterContextDBReg.cpp",
+ "NativeRegisterContextDBReg_arm.cpp",
+ "NativeRegisterContextDBReg_arm64.cpp",
+ "NativeRegisterContextDBReg_loongarch.cpp",
+ "NativeRegisterContextDBReg_x86.cpp",
+ "NativeRegisterContextRegisterInfo.cpp",
+ ]
+}
diff --git a/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Utility/BUILD.gn b/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Utility/BUILD.gn
index 59c70635001112..175599f39f62ec 100644
--- a/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Utility/BUILD.gn
+++ b/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Utility/BUILD.gn
@@ -30,12 +30,6 @@ static_library("Utility") {
"LinuxSignals.cpp",
"MemoryTagManagerAArch64MTE.cpp",
"NativeProcessSoftwareSingleStep.cpp",
- "NativeRegisterContextDBReg.cpp",
- "NativeRegisterContextDBReg_arm.cpp",
- "NativeRegisterContextDBReg_arm64.cpp",
- "NativeRegisterContextDBReg_loongarch.cpp",
- "NativeRegisterContextDBReg_x86.cpp",
- "NativeRegisterContextRegisterInfo.cpp",
"NetBSDSignals.cpp",
"OpenBSDSignals.cpp",
"RegisterContextDarwin_arm.cpp",
diff --git a/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Windows/Common/BUILD.gn b/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Windows/Common/BUILD.gn
index 0fec9ee7eddd23..1b6275b27055f0 100644
--- a/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Windows/Common/BUILD.gn
+++ b/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Windows/Common/BUILD.gn
@@ -6,6 +6,7 @@ static_library("Common") {
"//lldb/source/Host",
"//lldb/source/Interpreter",
"//lldb/source/Plugins/DynamicLoader/Windows-DYLD",
+ "//lldb/source/Plugins/Process/NativeCommon",
"//lldb/source/Symbol",
"//lldb/source/Target",
"//llvm/lib/Support",
>From ffee0a02083a61c18de8cff5c217ef4ecd9e6e4b Mon Sep 17 00:00:00 2001
From: Minsoo Choo <minsoo at minsoo.io>
Date: Sun, 6 Sep 2026 10:12:43 -0400
Subject: [PATCH 5/6] [lldb] Extract reusable POSIX register contexts
---
lldb/source/Plugins/Process/CMakeLists.txt | 1 +
.../Plugins/Process/Common/CMakeLists.txt | 22 ++
.../POSIX}/RegisterContextPOSIX_arm.cpp | 0
.../POSIX}/RegisterContextPOSIX_arm.h | 10 +-
.../POSIX}/RegisterContextPOSIX_arm64.cpp | 0
.../POSIX}/RegisterContextPOSIX_arm64.h | 10 +-
.../RegisterContextPOSIX_loongarch64.cpp | 0
.../POSIX}/RegisterContextPOSIX_loongarch64.h | 12 +-
.../POSIX}/RegisterContextPOSIX_powerpc.cpp | 0
.../POSIX/RegisterContextPOSIX_powerpc.h | 74 +++++++
.../POSIX}/RegisterContextPOSIX_ppc64le.cpp | 0
.../POSIX}/RegisterContextPOSIX_ppc64le.h | 8 +-
.../POSIX}/RegisterContextPOSIX_riscv32.cpp | 0
.../POSIX}/RegisterContextPOSIX_riscv32.h | 12 +-
.../POSIX}/RegisterContextPOSIX_riscv64.cpp | 0
.../POSIX}/RegisterContextPOSIX_riscv64.h | 12 +-
.../POSIX}/RegisterContextPOSIX_s390x.cpp | 2 +-
.../POSIX}/RegisterContextPOSIX_s390x.h | 12 +-
.../POSIX}/RegisterContextPOSIX_x86.cpp | 2 +-
.../POSIX}/RegisterContextPOSIX_x86.h | 14 +-
.../FreeBSD-Kernel-Core/CMakeLists.txt | 1 +
.../RegisterContextFreeBSDKernelCore_arm.h | 2 +-
.../RegisterContextFreeBSDKernelCore_arm64.h | 2 +-
.../RegisterContextFreeBSDKernelCore_i386.h | 2 +-
...RegisterContextFreeBSDKernelCore_ppc64le.h | 2 +-
...RegisterContextFreeBSDKernelCore_riscv64.h | 2 +-
.../RegisterContextFreeBSDKernelCore_x86_64.h | 2 +-
.../Plugins/Process/FreeBSD/CMakeLists.txt | 1 +
.../NativeRegisterContextFreeBSD_powerpc.cpp | 2 +-
.../Plugins/Process/Utility/CMakeLists.txt | 9 -
.../Utility/RegisterContextPOSIX_powerpc.h | 195 ------------------
.../Plugins/Process/elf-core/CMakeLists.txt | 1 +
.../elf-core/RegisterContextPOSIXCore_arm.h | 2 +-
.../elf-core/RegisterContextPOSIXCore_arm64.h | 2 +-
.../RegisterContextPOSIXCore_loongarch64.h | 2 +-
.../RegisterContextPOSIXCore_powerpc.h | 2 +-
.../RegisterContextPOSIXCore_ppc64le.h | 2 +-
.../RegisterContextPOSIXCore_riscv64.h | 2 +-
.../elf-core/RegisterContextPOSIXCore_s390x.h | 2 +-
.../elf-core/RegisterContextPOSIXCore_x86.h | 2 +-
.../Register/Arch/RegisterContext_powerpc.h | 121 +++++++++++
.../FreeBSD/RegisterInfoFreeBSD_powerpc.cpp | 3 +-
.../Linux/RegisterInfoLinux_s390x.cpp | 4 +-
lldb/unittests/Process/Utility/CMakeLists.txt | 3 +-
.../Utility/RegisterInfoFreeBSDTest.cpp | 2 +-
.../source/Plugins/Process/Common/BUILD.gn | 23 +++
.../source/Plugins/Process/Utility/BUILD.gn | 9 -
.../source/Plugins/Process/elf-core/BUILD.gn | 1 +
48 files changed, 315 insertions(+), 279 deletions(-)
create mode 100644 lldb/source/Plugins/Process/Common/CMakeLists.txt
rename lldb/source/Plugins/Process/{Utility => Common/RegisterContext/POSIX}/RegisterContextPOSIX_arm.cpp (100%)
rename lldb/source/Plugins/Process/{Utility => Common/RegisterContext/POSIX}/RegisterContextPOSIX_arm.h (80%)
rename lldb/source/Plugins/Process/{Utility => Common/RegisterContext/POSIX}/RegisterContextPOSIX_arm64.cpp (100%)
rename lldb/source/Plugins/Process/{Utility => Common/RegisterContext/POSIX}/RegisterContextPOSIX_arm64.h (86%)
rename lldb/source/Plugins/Process/{Utility => Common/RegisterContext/POSIX}/RegisterContextPOSIX_loongarch64.cpp (100%)
rename lldb/source/Plugins/Process/{Utility => Common/RegisterContext/POSIX}/RegisterContextPOSIX_loongarch64.h (80%)
rename lldb/source/Plugins/Process/{Utility => Common/RegisterContext/POSIX}/RegisterContextPOSIX_powerpc.cpp (100%)
create mode 100644 lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_powerpc.h
rename lldb/source/Plugins/Process/{Utility => Common/RegisterContext/POSIX}/RegisterContextPOSIX_ppc64le.cpp (100%)
rename lldb/source/Plugins/Process/{Utility => Common/RegisterContext/POSIX}/RegisterContextPOSIX_ppc64le.h (86%)
rename lldb/source/Plugins/Process/{Utility => Common/RegisterContext/POSIX}/RegisterContextPOSIX_riscv32.cpp (100%)
rename lldb/source/Plugins/Process/{Utility => Common/RegisterContext/POSIX}/RegisterContextPOSIX_riscv32.h (78%)
rename lldb/source/Plugins/Process/{Utility => Common/RegisterContext/POSIX}/RegisterContextPOSIX_riscv64.cpp (100%)
rename lldb/source/Plugins/Process/{Utility => Common/RegisterContext/POSIX}/RegisterContextPOSIX_riscv64.h (78%)
rename lldb/source/Plugins/Process/{Utility => Common/RegisterContext/POSIX}/RegisterContextPOSIX_s390x.cpp (99%)
rename lldb/source/Plugins/Process/{Utility => Common/RegisterContext/POSIX}/RegisterContextPOSIX_s390x.h (80%)
rename lldb/source/Plugins/Process/{Utility => Common/RegisterContext/POSIX}/RegisterContextPOSIX_x86.cpp (99%)
rename lldb/source/Plugins/Process/{Utility => Common/RegisterContext/POSIX}/RegisterContextPOSIX_x86.h (84%)
delete mode 100644 lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.h
create mode 100644 llvm/utils/gn/secondary/lldb/source/Plugins/Process/Common/BUILD.gn
diff --git a/lldb/source/Plugins/Process/CMakeLists.txt b/lldb/source/Plugins/Process/CMakeLists.txt
index 1599da896aca08..98a82be2fc332b 100644
--- a/lldb/source/Plugins/Process/CMakeLists.txt
+++ b/lldb/source/Plugins/Process/CMakeLists.txt
@@ -23,6 +23,7 @@ endif()
add_subdirectory(FreeBSD-Kernel-Core)
add_subdirectory(MacOSX-Kernel)
+add_subdirectory(Common)
add_subdirectory(NativeCommon)
add_subdirectory(scripted)
add_subdirectory(gdb-remote)
diff --git a/lldb/source/Plugins/Process/Common/CMakeLists.txt b/lldb/source/Plugins/Process/Common/CMakeLists.txt
new file mode 100644
index 00000000000000..f9f7289f9c1276
--- /dev/null
+++ b/lldb/source/Plugins/Process/Common/CMakeLists.txt
@@ -0,0 +1,22 @@
+add_lldb_library(lldbProcessContextSupport NO_PLUGIN_DEPENDENCIES
+ RegisterContext/POSIX/RegisterContextPOSIX_arm.cpp
+ RegisterContext/POSIX/RegisterContextPOSIX_arm64.cpp
+ RegisterContext/POSIX/RegisterContextPOSIX_loongarch64.cpp
+ RegisterContext/POSIX/RegisterContextPOSIX_powerpc.cpp
+ RegisterContext/POSIX/RegisterContextPOSIX_ppc64le.cpp
+ RegisterContext/POSIX/RegisterContextPOSIX_riscv32.cpp
+ RegisterContext/POSIX/RegisterContextPOSIX_riscv64.cpp
+ RegisterContext/POSIX/RegisterContextPOSIX_s390x.cpp
+ RegisterContext/POSIX/RegisterContextPOSIX_x86.cpp
+
+ LINK_COMPONENTS
+ Support
+ LINK_LIBS
+ lldbRegister
+ lldbTarget
+ lldbUtility
+ ALLOWED_INTERNAL_DEPENDENCIES
+ lldbRegister
+ lldbTarget
+ lldbUtility
+ )
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm.cpp b/lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_arm.cpp
similarity index 100%
rename from lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm.cpp
rename to lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_arm.cpp
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm.h b/lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_arm.h
similarity index 80%
rename from lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm.h
rename to lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_arm.h
index 4b21cfbb93d904..35db27ea67af48 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm.h
+++ b/lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_arm.h
@@ -6,11 +6,11 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_ARM_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_ARM_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_POSIX_REGISTERCONTEXTPOSIX_ARM_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_POSIX_REGISTERCONTEXTPOSIX_ARM_H
-#include "RegisterInfoInterface.h"
-#include "RegisterInfoCommon_arm.h"
+#include "Register/RegisterInfoInterface.h"
+#include "Register/Common/RegisterInfoCommon_arm.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/Utility/Log.h"
@@ -59,4 +59,4 @@ class RegisterContextPOSIX_arm : public lldb_private::RegisterContext {
virtual bool WriteFPR() = 0;
};
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_ARM_H
+#endif // LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_POSIX_REGISTERCONTEXTPOSIX_ARM_H
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.cpp b/lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_arm64.cpp
similarity index 100%
rename from lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.cpp
rename to lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_arm64.cpp
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.h b/lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_arm64.h
similarity index 86%
rename from lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.h
rename to lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_arm64.h
index 6137030a577116..6b90d63144268e 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.h
+++ b/lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_arm64.h
@@ -6,11 +6,11 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_ARM64_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_ARM64_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_POSIX_REGISTERCONTEXTPOSIX_ARM64_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_POSIX_REGISTERCONTEXTPOSIX_ARM64_H
-#include "RegisterInfoInterface.h"
-#include "RegisterInfoCommon_arm64.h"
+#include "Register/RegisterInfoInterface.h"
+#include "Register/Common/RegisterInfoCommon_arm64.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/Utility/Log.h"
@@ -86,4 +86,4 @@ class RegisterContextPOSIX_arm64 : public lldb_private::RegisterContext {
virtual bool WriteFPR() = 0;
};
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_ARM64_H
+#endif // LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_POSIX_REGISTERCONTEXTPOSIX_ARM64_H
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_loongarch64.cpp b/lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_loongarch64.cpp
similarity index 100%
rename from lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_loongarch64.cpp
rename to lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_loongarch64.cpp
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_loongarch64.h b/lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_loongarch64.h
similarity index 80%
rename from lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_loongarch64.h
rename to lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_loongarch64.h
index 7f63a6e95d9ab4..ff1fb1fd0d20ed 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_loongarch64.h
+++ b/lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_loongarch64.h
@@ -6,12 +6,12 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_LOONGARCH64_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_LOONGARCH64_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_POSIX_REGISTERCONTEXTPOSIX_LOONGARCH64_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_POSIX_REGISTERCONTEXTPOSIX_LOONGARCH64_H
-#include "RegisterInfoInterface.h"
-#include "RegisterInfoCommon_loongarch64.h"
-#include "lldb-loongarch-register-enums.h"
+#include "Register/RegisterInfoInterface.h"
+#include "Register/Common/RegisterInfoCommon_loongarch64.h"
+#include "Register/Arch/lldb-loongarch-register-enums.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/Utility/Log.h"
@@ -68,4 +68,4 @@ class RegisterContextPOSIX_loongarch64 : public lldb_private::RegisterContext {
virtual bool WriteLASX() { return false; }
};
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_LOONGARCH64_H
+#endif // LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_POSIX_REGISTERCONTEXTPOSIX_LOONGARCH64_H
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.cpp b/lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_powerpc.cpp
similarity index 100%
rename from lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.cpp
rename to lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_powerpc.cpp
diff --git a/lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_powerpc.h b/lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_powerpc.h
new file mode 100644
index 00000000000000..301360c1e902eb
--- /dev/null
+++ b/lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_powerpc.h
@@ -0,0 +1,74 @@
+//===-- RegisterContextPOSIX_powerpc.h --------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_POSIX_REGISTERCONTEXTPOSIX_POWERPC_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_POSIX_REGISTERCONTEXTPOSIX_POWERPC_H
+
+#include "Register/RegisterInfoInterface.h"
+#include "Register/Arch/RegisterContext_powerpc.h"
+#include "lldb/Target/RegisterContext.h"
+#include "lldb/Utility/Log.h"
+
+class RegisterContextPOSIX_powerpc : public lldb_private::RegisterContext {
+public:
+ RegisterContextPOSIX_powerpc(
+ lldb_private::Thread &thread, uint32_t concrete_frame_idx,
+ lldb_private::RegisterInfoInterface *register_info);
+
+ ~RegisterContextPOSIX_powerpc() override;
+
+ void Invalidate();
+
+ void InvalidateAllRegisters() override;
+
+ size_t GetRegisterCount() override;
+
+ virtual size_t GetGPRSize();
+
+ virtual unsigned GetRegisterSize(unsigned reg);
+
+ virtual unsigned GetRegisterOffset(unsigned reg);
+
+ const lldb_private::RegisterInfo *GetRegisterInfoAtIndex(size_t reg) override;
+
+ size_t GetRegisterSetCount() override;
+
+ const lldb_private::RegisterSet *GetRegisterSet(size_t set) override;
+
+ const char *GetRegisterName(unsigned reg);
+
+protected:
+ uint64_t
+ m_gpr_powerpc[k_num_gpr_registers_powerpc]; // general purpose registers.
+ uint64_t
+ m_fpr_powerpc[k_num_fpr_registers_powerpc]; // floating point registers.
+ uint32_t m_vmx_powerpc[k_num_vmx_registers_powerpc][4];
+ std::unique_ptr<lldb_private::RegisterInfoInterface>
+ m_register_info_up; // Register Info Interface (FreeBSD or Linux)
+
+ // Determines if an extended register set is supported on the processor
+ // running the inferior process.
+ virtual bool IsRegisterSetAvailable(size_t set_index);
+
+ virtual const lldb_private::RegisterInfo *GetRegisterInfo();
+
+ bool IsGPR(unsigned reg);
+
+ bool IsFPR(unsigned reg);
+
+ bool IsVMX(unsigned reg);
+
+ virtual bool ReadGPR() = 0;
+ virtual bool ReadFPR() = 0;
+ virtual bool ReadVMX() = 0;
+ virtual bool WriteGPR() = 0;
+ virtual bool WriteFPR() = 0;
+ virtual bool WriteVMX() = 0;
+};
+
+#endif // LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_POSIX_REGISTERCONTEXTPOSIX_POWERPC_H
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_ppc64le.cpp b/lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_ppc64le.cpp
similarity index 100%
rename from lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_ppc64le.cpp
rename to lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_ppc64le.cpp
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_ppc64le.h b/lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_ppc64le.h
similarity index 86%
rename from lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_ppc64le.h
rename to lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_ppc64le.h
index 65209179596295..3689527b12d041 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_ppc64le.h
+++ b/lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_ppc64le.h
@@ -6,11 +6,11 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_PPC64LE_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_PPC64LE_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_POSIX_REGISTERCONTEXTPOSIX_PPC64LE_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_POSIX_REGISTERCONTEXTPOSIX_PPC64LE_H
#include "Register/Arch/lldb-ppc64le-register-enums.h"
-#include "RegisterInfoInterface.h"
+#include "Register/RegisterInfoInterface.h"
#include "Utility/PPC64LE_DWARF_Registers.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/Utility/Log.h"
@@ -70,4 +70,4 @@ class RegisterContextPOSIX_ppc64le : public lldb_private::RegisterContext {
};
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_PPC64LE_H
+#endif // LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_POSIX_REGISTERCONTEXTPOSIX_PPC64LE_H
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_riscv32.cpp b/lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_riscv32.cpp
similarity index 100%
rename from lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_riscv32.cpp
rename to lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_riscv32.cpp
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_riscv32.h b/lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_riscv32.h
similarity index 78%
rename from lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_riscv32.h
rename to lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_riscv32.h
index 3fa948f0f82212..fd5310ec69c263 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_riscv32.h
+++ b/lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_riscv32.h
@@ -6,12 +6,12 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_RISCV32_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_RISCV32_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_POSIX_REGISTERCONTEXTPOSIX_RISCV32_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_POSIX_REGISTERCONTEXTPOSIX_RISCV32_H
-#include "RegisterInfoInterface.h"
-#include "RegisterInfoCommon_riscv32.h"
-#include "lldb-riscv-register-enums.h"
+#include "Register/RegisterInfoInterface.h"
+#include "Register/Common/RegisterInfoCommon_riscv32.h"
+#include "Register/Arch/lldb-riscv-register-enums.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/Utility/Log.h"
@@ -60,4 +60,4 @@ class RegisterContextPOSIX_riscv32 : public lldb_private::RegisterContext {
virtual bool WriteFPR() = 0;
};
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_RISCV32_H
+#endif // LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_POSIX_REGISTERCONTEXTPOSIX_RISCV32_H
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_riscv64.cpp b/lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_riscv64.cpp
similarity index 100%
rename from lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_riscv64.cpp
rename to lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_riscv64.cpp
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_riscv64.h b/lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_riscv64.h
similarity index 78%
rename from lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_riscv64.h
rename to lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_riscv64.h
index 417bb4f808f035..f954dd9199ff66 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_riscv64.h
+++ b/lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_riscv64.h
@@ -6,12 +6,12 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_RISCV64_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_RISCV64_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_POSIX_REGISTERCONTEXTPOSIX_RISCV64_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_POSIX_REGISTERCONTEXTPOSIX_RISCV64_H
-#include "RegisterInfoInterface.h"
-#include "RegisterInfoCommon_riscv64.h"
-#include "lldb-riscv-register-enums.h"
+#include "Register/RegisterInfoInterface.h"
+#include "Register/Common/RegisterInfoCommon_riscv64.h"
+#include "Register/Arch/lldb-riscv-register-enums.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/Utility/Log.h"
@@ -60,4 +60,4 @@ class RegisterContextPOSIX_riscv64 : public lldb_private::RegisterContext {
virtual bool WriteFPR() = 0;
};
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_RISCV64_H
+#endif // LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_POSIX_REGISTERCONTEXTPOSIX_RISCV64_H
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_s390x.cpp b/lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_s390x.cpp
similarity index 99%
rename from lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_s390x.cpp
rename to lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_s390x.cpp
index b85da39b4c45c7..c3cbea2b5be647 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_s390x.cpp
+++ b/lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_s390x.cpp
@@ -21,7 +21,7 @@
#include "llvm/Support/Compiler.h"
#include "RegisterContextPOSIX_s390x.h"
-#include "RegisterContext_s390x.h"
+#include "Register/Arch/RegisterContext_s390x.h"
using namespace lldb_private;
using namespace lldb;
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_s390x.h b/lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_s390x.h
similarity index 80%
rename from lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_s390x.h
rename to lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_s390x.h
index 7027af04f0bb2d..54a18cca066067 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_s390x.h
+++ b/lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_s390x.h
@@ -6,12 +6,12 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_S390X_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_S390X_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_POSIX_REGISTERCONTEXTPOSIX_S390X_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_POSIX_REGISTERCONTEXTPOSIX_S390X_H
-#include "RegisterContext_s390x.h"
-#include "RegisterInfoInterface.h"
-#include "lldb-s390x-register-enums.h"
+#include "Register/Arch/RegisterContext_s390x.h"
+#include "Register/RegisterInfoInterface.h"
+#include "Register/Arch/lldb-s390x-register-enums.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/Utility/Log.h"
@@ -69,4 +69,4 @@ class RegisterContextPOSIX_s390x : public lldb_private::RegisterContext {
virtual bool WriteFPR() = 0;
};
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_S390X_H
+#endif // LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_POSIX_REGISTERCONTEXTPOSIX_S390X_H
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp b/lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_x86.cpp
similarity index 99%
rename from lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp
rename to lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_x86.cpp
index 96640bceaea622..96abe5cc0eb72a 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp
+++ b/lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_x86.cpp
@@ -21,7 +21,7 @@
#include "llvm/Support/Compiler.h"
#include "RegisterContextPOSIX_x86.h"
-#include "RegisterContext_x86.h"
+#include "Register/Arch/RegisterContext_x86.h"
using namespace lldb_private;
using namespace lldb;
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.h b/lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_x86.h
similarity index 84%
rename from lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.h
rename to lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_x86.h
index 2bee8f638c2daf..5fdde75f866dd2 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.h
+++ b/lldb/source/Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_x86.h
@@ -6,13 +6,13 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_X86_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_X86_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_POSIX_REGISTERCONTEXTPOSIX_X86_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_POSIX_REGISTERCONTEXTPOSIX_X86_H
-#include "RegisterContext_x86.h"
-#include "RegisterInfoInterface.h"
-#include "RegisterInfos_x86_64_with_base_shared.h"
-#include "lldb-x86-register-enums.h"
+#include "Register/Arch/RegisterContext_x86.h"
+#include "Register/RegisterInfoInterface.h"
+#include "Register/Arch/RegisterInfos_x86_64_with_base_shared.h"
+#include "Register/Arch/lldb-x86-register-enums.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/Utility/Log.h"
@@ -88,4 +88,4 @@ class RegisterContextPOSIX_x86 : public lldb_private::RegisterContext {
virtual lldb_private::RegInfo &GetRegInfo();
};
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_X86_H
+#endif // LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_POSIX_REGISTERCONTEXTPOSIX_X86_H
diff --git a/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/CMakeLists.txt b/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/CMakeLists.txt
index b9487abe105e0e..b7f27d1d97a919 100644
--- a/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/CMakeLists.txt
+++ b/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/CMakeLists.txt
@@ -24,6 +24,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
LINK_COMPONENTS
Support
LINK_LIBS
+ lldbProcessContextSupport
lldbCore
lldbHost
lldbTarget
diff --git a/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_arm.h b/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_arm.h
index 8af593e9cbe5de..93c18082833e9b 100644
--- a/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_arm.h
+++ b/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_arm.h
@@ -9,7 +9,7 @@
#ifndef LLDB_SOURCE_PLUGINS_PROCESS_FREEBSDKERNEL_REGISTERCONTEXTFREEBSDKERNELCORE_ARM_H
#define LLDB_SOURCE_PLUGINS_PROCESS_FREEBSDKERNEL_REGISTERCONTEXTFREEBSDKERNELCORE_ARM_H
-#include "Plugins/Process/Utility/RegisterContextPOSIX_arm.h"
+#include "Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_arm.h"
#include "Plugins/Process/elf-core/RegisterUtilities.h"
class RegisterContextFreeBSDKernelCore_arm : public RegisterContextPOSIX_arm {
diff --git a/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_arm64.h b/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_arm64.h
index 3ad5ae7b88bae6..a008980161f6fa 100644
--- a/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_arm64.h
+++ b/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_arm64.h
@@ -9,7 +9,7 @@
#ifndef LLDB_SOURCE_PLUGINS_PROCESS_FREEBSDKERNEL_REGISTERCONTEXTFREEBSDKERNELCORE_ARM64_H
#define LLDB_SOURCE_PLUGINS_PROCESS_FREEBSDKERNEL_REGISTERCONTEXTFREEBSDKERNELCORE_ARM64_H
-#include "Plugins/Process/Utility/RegisterContextPOSIX_arm64.h"
+#include "Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_arm64.h"
#include "Plugins/Process/elf-core/RegisterUtilities.h"
#include <optional>
diff --git a/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_i386.h b/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_i386.h
index 26576734040f2a..74428bf6024566 100644
--- a/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_i386.h
+++ b/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_i386.h
@@ -9,7 +9,7 @@
#ifndef LLDB_SOURCE_PLUGINS_PROCESS_FREEBSDKERNEL_REGISTERCONTEXTFREEBSDKERNELCORE_I386_H
#define LLDB_SOURCE_PLUGINS_PROCESS_FREEBSDKERNEL_REGISTERCONTEXTFREEBSDKERNELCORE_I386_H
-#include "Plugins/Process/Utility/RegisterContextPOSIX_x86.h"
+#include "Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_x86.h"
#include "Plugins/Process/elf-core/RegisterUtilities.h"
class RegisterContextFreeBSDKernelCore_i386 : public RegisterContextPOSIX_x86 {
diff --git a/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_ppc64le.h b/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_ppc64le.h
index 5895744e6fa3dc..86169965b37a72 100644
--- a/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_ppc64le.h
+++ b/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_ppc64le.h
@@ -9,7 +9,7 @@
#ifndef LLDB_SOURCE_PLUGINS_PROCESS_FREEBSDKERNEL_REGISTERCONTEXTFREEBSDKERNELCORE_PPC64LE_H
#define LLDB_SOURCE_PLUGINS_PROCESS_FREEBSDKERNEL_REGISTERCONTEXTFREEBSDKERNELCORE_PPC64LE_H
-#include "Plugins/Process/Utility/RegisterContextPOSIX_ppc64le.h"
+#include "Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_ppc64le.h"
#include "Plugins/Process/elf-core/RegisterUtilities.h"
class RegisterContextFreeBSDKernelCore_ppc64le
diff --git a/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_riscv64.h b/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_riscv64.h
index cb96c5c989f2c1..ff641ecc88cf82 100644
--- a/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_riscv64.h
+++ b/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_riscv64.h
@@ -9,7 +9,7 @@
#ifndef LLDB_SOURCE_PLUGINS_PROCESS_FREEBSDKERNEL_REGISTERCONTEXTFREEBSDKERNELCORE_RISCV64_H
#define LLDB_SOURCE_PLUGINS_PROCESS_FREEBSDKERNEL_REGISTERCONTEXTFREEBSDKERNELCORE_RISCV64_H
-#include "Plugins/Process/Utility/RegisterContextPOSIX_riscv64.h"
+#include "Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_riscv64.h"
#include "Plugins/Process/elf-core/RegisterUtilities.h"
class RegisterContextFreeBSDKernelCore_riscv64
diff --git a/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_x86_64.h b/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_x86_64.h
index 5e2877ca55b9db..56170f7d5ca73e 100644
--- a/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_x86_64.h
+++ b/lldb/source/Plugins/Process/FreeBSD-Kernel-Core/RegisterContextFreeBSDKernelCore_x86_64.h
@@ -9,7 +9,7 @@
#ifndef LLDB_SOURCE_PLUGINS_PROCESS_FREEBSDKERNEL_REGISTERCONTEXTFREEBSDKERNELCORE_X86_64_H
#define LLDB_SOURCE_PLUGINS_PROCESS_FREEBSDKERNEL_REGISTERCONTEXTFREEBSDKERNELCORE_X86_64_H
-#include "Plugins/Process/Utility/RegisterContextPOSIX_x86.h"
+#include "Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_x86.h"
#include "Plugins/Process/elf-core/RegisterUtilities.h"
class RegisterContextFreeBSDKernelCore_x86_64
diff --git a/lldb/source/Plugins/Process/FreeBSD/CMakeLists.txt b/lldb/source/Plugins/Process/FreeBSD/CMakeLists.txt
index 0599191d408581..4c763044e364b4 100644
--- a/lldb/source/Plugins/Process/FreeBSD/CMakeLists.txt
+++ b/lldb/source/Plugins/Process/FreeBSD/CMakeLists.txt
@@ -11,6 +11,7 @@ add_lldb_library(lldbPluginProcessFreeBSD
Support
LINK_LIBS
lldbNativeProcessSupport
+ lldbProcessContextSupport
lldbHost
lldbSymbol
lldbTarget
diff --git a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_powerpc.cpp b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_powerpc.cpp
index 560c3e567702c8..eee4cabc1e7b2e 100644
--- a/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_powerpc.cpp
+++ b/lldb/source/Plugins/Process/FreeBSD/NativeRegisterContextFreeBSD_powerpc.cpp
@@ -17,7 +17,7 @@
#include "Plugins/Process/FreeBSD/NativeProcessFreeBSD.h"
// for register enum definitions
-#include "Plugins/Process/Utility/RegisterContextPOSIX_powerpc.h"
+#include "Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_powerpc.h"
// clang-format off
#include <sys/param.h>
diff --git a/lldb/source/Plugins/Process/Utility/CMakeLists.txt b/lldb/source/Plugins/Process/Utility/CMakeLists.txt
index e74e17971d0356..6dbd6a5279e9cc 100644
--- a/lldb/source/Plugins/Process/Utility/CMakeLists.txt
+++ b/lldb/source/Plugins/Process/Utility/CMakeLists.txt
@@ -23,15 +23,6 @@ add_lldb_library(lldbPluginProcessUtility
RegisterContextMach_arm.cpp
RegisterContextMach_x86_64.cpp
RegisterContextMemory.cpp
- RegisterContextPOSIX_arm.cpp
- RegisterContextPOSIX_arm64.cpp
- RegisterContextPOSIX_loongarch64.cpp
- RegisterContextPOSIX_riscv32.cpp
- RegisterContextPOSIX_powerpc.cpp
- RegisterContextPOSIX_ppc64le.cpp
- RegisterContextPOSIX_riscv64.cpp
- RegisterContextPOSIX_s390x.cpp
- RegisterContextPOSIX_x86.cpp
RegisterContextThreadMemory.cpp
StopInfoMachException.cpp
ThreadMemory.cpp
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.h b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.h
deleted file mode 100644
index 5dd8c890da6ede..00000000000000
--- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.h
+++ /dev/null
@@ -1,195 +0,0 @@
-//===-- RegisterContextPOSIX_powerpc.h --------------------------*- C++ -*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_POWERPC_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_POWERPC_H
-
-#include "RegisterContext_powerpc.h"
-#include "RegisterInfoInterface.h"
-#include "lldb/Target/RegisterContext.h"
-#include "lldb/Utility/Log.h"
-
-// Internal codes for all powerpc registers.
-enum {
- k_first_gpr_powerpc,
- gpr_r0_powerpc = k_first_gpr_powerpc,
- gpr_r1_powerpc,
- gpr_r2_powerpc,
- gpr_r3_powerpc,
- gpr_r4_powerpc,
- gpr_r5_powerpc,
- gpr_r6_powerpc,
- gpr_r7_powerpc,
- gpr_r8_powerpc,
- gpr_r9_powerpc,
- gpr_r10_powerpc,
- gpr_r11_powerpc,
- gpr_r12_powerpc,
- gpr_r13_powerpc,
- gpr_r14_powerpc,
- gpr_r15_powerpc,
- gpr_r16_powerpc,
- gpr_r17_powerpc,
- gpr_r18_powerpc,
- gpr_r19_powerpc,
- gpr_r20_powerpc,
- gpr_r21_powerpc,
- gpr_r22_powerpc,
- gpr_r23_powerpc,
- gpr_r24_powerpc,
- gpr_r25_powerpc,
- gpr_r26_powerpc,
- gpr_r27_powerpc,
- gpr_r28_powerpc,
- gpr_r29_powerpc,
- gpr_r30_powerpc,
- gpr_r31_powerpc,
- gpr_lr_powerpc,
- gpr_cr_powerpc,
- gpr_xer_powerpc,
- gpr_ctr_powerpc,
- gpr_pc_powerpc,
- k_last_gpr_powerpc = gpr_pc_powerpc,
-
- k_first_fpr,
- fpr_f0_powerpc = k_first_fpr,
- fpr_f1_powerpc,
- fpr_f2_powerpc,
- fpr_f3_powerpc,
- fpr_f4_powerpc,
- fpr_f5_powerpc,
- fpr_f6_powerpc,
- fpr_f7_powerpc,
- fpr_f8_powerpc,
- fpr_f9_powerpc,
- fpr_f10_powerpc,
- fpr_f11_powerpc,
- fpr_f12_powerpc,
- fpr_f13_powerpc,
- fpr_f14_powerpc,
- fpr_f15_powerpc,
- fpr_f16_powerpc,
- fpr_f17_powerpc,
- fpr_f18_powerpc,
- fpr_f19_powerpc,
- fpr_f20_powerpc,
- fpr_f21_powerpc,
- fpr_f22_powerpc,
- fpr_f23_powerpc,
- fpr_f24_powerpc,
- fpr_f25_powerpc,
- fpr_f26_powerpc,
- fpr_f27_powerpc,
- fpr_f28_powerpc,
- fpr_f29_powerpc,
- fpr_f30_powerpc,
- fpr_f31_powerpc,
- fpr_fpscr_powerpc,
- k_last_fpr = fpr_fpscr_powerpc,
-
- k_first_vmx,
- vmx_v0_powerpc = k_first_vmx,
- vmx_v1_powerpc,
- vmx_v2_powerpc,
- vmx_v3_powerpc,
- vmx_v4_powerpc,
- vmx_v5_powerpc,
- vmx_v6_powerpc,
- vmx_v7_powerpc,
- vmx_v8_powerpc,
- vmx_v9_powerpc,
- vmx_v10_powerpc,
- vmx_v11_powerpc,
- vmx_v12_powerpc,
- vmx_v13_powerpc,
- vmx_v14_powerpc,
- vmx_v15_powerpc,
- vmx_v16_powerpc,
- vmx_v17_powerpc,
- vmx_v18_powerpc,
- vmx_v19_powerpc,
- vmx_v20_powerpc,
- vmx_v21_powerpc,
- vmx_v22_powerpc,
- vmx_v23_powerpc,
- vmx_v24_powerpc,
- vmx_v25_powerpc,
- vmx_v26_powerpc,
- vmx_v27_powerpc,
- vmx_v28_powerpc,
- vmx_v29_powerpc,
- vmx_v30_powerpc,
- vmx_v31_powerpc,
- vmx_vrsave_powerpc,
- vmx_vscr_powerpc,
- k_last_vmx = vmx_vscr_powerpc,
-
- k_num_registers_powerpc,
- k_num_gpr_registers_powerpc = k_last_gpr_powerpc - k_first_gpr_powerpc + 1,
- k_num_fpr_registers_powerpc = k_last_fpr - k_first_fpr + 1,
- k_num_vmx_registers_powerpc = k_last_vmx - k_first_vmx + 1,
-};
-
-class RegisterContextPOSIX_powerpc : public lldb_private::RegisterContext {
-public:
- RegisterContextPOSIX_powerpc(
- lldb_private::Thread &thread, uint32_t concrete_frame_idx,
- lldb_private::RegisterInfoInterface *register_info);
-
- ~RegisterContextPOSIX_powerpc() override;
-
- void Invalidate();
-
- void InvalidateAllRegisters() override;
-
- size_t GetRegisterCount() override;
-
- virtual size_t GetGPRSize();
-
- virtual unsigned GetRegisterSize(unsigned reg);
-
- virtual unsigned GetRegisterOffset(unsigned reg);
-
- const lldb_private::RegisterInfo *GetRegisterInfoAtIndex(size_t reg) override;
-
- size_t GetRegisterSetCount() override;
-
- const lldb_private::RegisterSet *GetRegisterSet(size_t set) override;
-
- const char *GetRegisterName(unsigned reg);
-
-protected:
- uint64_t
- m_gpr_powerpc[k_num_gpr_registers_powerpc]; // general purpose registers.
- uint64_t
- m_fpr_powerpc[k_num_fpr_registers_powerpc]; // floating point registers.
- uint32_t m_vmx_powerpc[k_num_vmx_registers_powerpc][4];
- std::unique_ptr<lldb_private::RegisterInfoInterface>
- m_register_info_up; // Register Info Interface (FreeBSD or Linux)
-
- // Determines if an extended register set is supported on the processor
- // running the inferior process.
- virtual bool IsRegisterSetAvailable(size_t set_index);
-
- virtual const lldb_private::RegisterInfo *GetRegisterInfo();
-
- bool IsGPR(unsigned reg);
-
- bool IsFPR(unsigned reg);
-
- bool IsVMX(unsigned reg);
-
- virtual bool ReadGPR() = 0;
- virtual bool ReadFPR() = 0;
- virtual bool ReadVMX() = 0;
- virtual bool WriteGPR() = 0;
- virtual bool WriteFPR() = 0;
- virtual bool WriteVMX() = 0;
-};
-
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTPOSIX_POWERPC_H
diff --git a/lldb/source/Plugins/Process/elf-core/CMakeLists.txt b/lldb/source/Plugins/Process/elf-core/CMakeLists.txt
index d1addf2f36be39..7b7383b8074440 100644
--- a/lldb/source/Plugins/Process/elf-core/CMakeLists.txt
+++ b/lldb/source/Plugins/Process/elf-core/CMakeLists.txt
@@ -17,6 +17,7 @@ add_lldb_library(lldbPluginProcessElfCore PLUGIN
BinaryFormat
Support
LINK_LIBS
+ lldbProcessContextSupport
lldbCore
lldbTarget
lldbPluginDynamicLoaderPosixDYLD
diff --git a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm.h b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm.h
index 3b41cbc24d5547..7761e27eefcf03 100644
--- a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm.h
+++ b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm.h
@@ -9,7 +9,7 @@
#ifndef LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTPOSIXCORE_ARM_H
#define LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTPOSIXCORE_ARM_H
-#include "Plugins/Process/Utility/RegisterContextPOSIX_arm.h"
+#include "Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_arm.h"
#include "Plugins/Process/elf-core/RegisterUtilities.h"
#include "lldb/Utility/DataBufferHeap.h"
#include "lldb/Utility/DataExtractor.h"
diff --git a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.h b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.h
index c9314b6b7ea1d2..c241a27309bc01 100644
--- a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.h
+++ b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.h
@@ -10,7 +10,7 @@
#define LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTPOSIXCORE_ARM64_H
#include "Plugins/Process/Utility/LinuxPTraceDefines_arm64sve.h"
-#include "Plugins/Process/Utility/RegisterContextPOSIX_arm64.h"
+#include "Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_arm64.h"
#include "Register/Common/RegisterTypeDetector_arm64.h"
#include "Plugins/Process/elf-core/RegisterUtilities.h"
diff --git a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_loongarch64.h b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_loongarch64.h
index a12a23adf89dd0..b8e7b71930c965 100644
--- a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_loongarch64.h
+++ b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_loongarch64.h
@@ -9,7 +9,7 @@
#ifndef LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTPOSIXCORE_LOONGARCH64_H
#define LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTPOSIXCORE_LOONGARCH64_H
-#include "Plugins/Process/Utility/RegisterContextPOSIX_loongarch64.h"
+#include "Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_loongarch64.h"
#include "Register/Common/RegisterInfoCommon_loongarch64.h"
#include "Plugins/Process/elf-core/RegisterUtilities.h"
diff --git a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_powerpc.h b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_powerpc.h
index 5364c5589238a1..5b47bcae28fe8f 100644
--- a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_powerpc.h
+++ b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_powerpc.h
@@ -9,7 +9,7 @@
#ifndef LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTPOSIXCORE_POWERPC_H
#define LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTPOSIXCORE_POWERPC_H
-#include "Plugins/Process/Utility/RegisterContextPOSIX_powerpc.h"
+#include "Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_powerpc.h"
#include "Plugins/Process/elf-core/RegisterUtilities.h"
#include "lldb/Utility/DataExtractor.h"
diff --git a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_ppc64le.h b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_ppc64le.h
index 8de77a7e25bff0..4c7068485cc09d 100644
--- a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_ppc64le.h
+++ b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_ppc64le.h
@@ -9,7 +9,7 @@
#ifndef LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTPOSIXCORE_PPC64LE_H
#define LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTPOSIXCORE_PPC64LE_H
-#include "Plugins/Process/Utility/RegisterContextPOSIX_ppc64le.h"
+#include "Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_ppc64le.h"
#include "Plugins/Process/elf-core/RegisterUtilities.h"
#include "lldb/Utility/DataExtractor.h"
diff --git a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_riscv64.h b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_riscv64.h
index 22a67654bbc790..0ac278711f7fe7 100644
--- a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_riscv64.h
+++ b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_riscv64.h
@@ -9,7 +9,7 @@
#ifndef LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTPOSIXCORE_RISCV64_H
#define LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTPOSIXCORE_RISCV64_H
-#include "Plugins/Process/Utility/RegisterContextPOSIX_riscv64.h"
+#include "Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_riscv64.h"
#include "Register/Common/RegisterInfoCommon_riscv64.h"
#include "Plugins/Process/elf-core/RegisterUtilities.h"
diff --git a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_s390x.h b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_s390x.h
index edb7cbc9462f6a..d92a3740430ff2 100644
--- a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_s390x.h
+++ b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_s390x.h
@@ -9,7 +9,7 @@
#ifndef LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTPOSIXCORE_S390X_H
#define LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTPOSIXCORE_S390X_H
-#include "Plugins/Process/Utility/RegisterContextPOSIX_s390x.h"
+#include "Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_s390x.h"
#include "Plugins/Process/elf-core/RegisterUtilities.h"
#include "lldb/Utility/DataExtractor.h"
diff --git a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_x86.h b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_x86.h
index 56f910b18683ae..5e45f17b2a19e8 100644
--- a/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_x86.h
+++ b/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_x86.h
@@ -9,7 +9,7 @@
#ifndef LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTPOSIXCORE_X86_H
#define LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTPOSIXCORE_X86_H
-#include "Plugins/Process/Utility/RegisterContextPOSIX_x86.h"
+#include "Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_x86.h"
#include "Plugins/Process/elf-core/RegisterUtilities.h"
class RegisterContextCorePOSIX_x86 : public RegisterContextPOSIX_x86 {
diff --git a/lldb/source/Register/Arch/RegisterContext_powerpc.h b/lldb/source/Register/Arch/RegisterContext_powerpc.h
index 1ca6ac4685720f..070e5e1f10ccde 100644
--- a/lldb/source/Register/Arch/RegisterContext_powerpc.h
+++ b/lldb/source/Register/Arch/RegisterContext_powerpc.h
@@ -120,4 +120,125 @@ enum {
dwarf_v31_powerpc,
};
+// Internal codes for all powerpc registers.
+enum {
+ k_first_gpr_powerpc,
+ gpr_r0_powerpc = k_first_gpr_powerpc,
+ gpr_r1_powerpc,
+ gpr_r2_powerpc,
+ gpr_r3_powerpc,
+ gpr_r4_powerpc,
+ gpr_r5_powerpc,
+ gpr_r6_powerpc,
+ gpr_r7_powerpc,
+ gpr_r8_powerpc,
+ gpr_r9_powerpc,
+ gpr_r10_powerpc,
+ gpr_r11_powerpc,
+ gpr_r12_powerpc,
+ gpr_r13_powerpc,
+ gpr_r14_powerpc,
+ gpr_r15_powerpc,
+ gpr_r16_powerpc,
+ gpr_r17_powerpc,
+ gpr_r18_powerpc,
+ gpr_r19_powerpc,
+ gpr_r20_powerpc,
+ gpr_r21_powerpc,
+ gpr_r22_powerpc,
+ gpr_r23_powerpc,
+ gpr_r24_powerpc,
+ gpr_r25_powerpc,
+ gpr_r26_powerpc,
+ gpr_r27_powerpc,
+ gpr_r28_powerpc,
+ gpr_r29_powerpc,
+ gpr_r30_powerpc,
+ gpr_r31_powerpc,
+ gpr_lr_powerpc,
+ gpr_cr_powerpc,
+ gpr_xer_powerpc,
+ gpr_ctr_powerpc,
+ gpr_pc_powerpc,
+ k_last_gpr_powerpc = gpr_pc_powerpc,
+
+ k_first_fpr,
+ fpr_f0_powerpc = k_first_fpr,
+ fpr_f1_powerpc,
+ fpr_f2_powerpc,
+ fpr_f3_powerpc,
+ fpr_f4_powerpc,
+ fpr_f5_powerpc,
+ fpr_f6_powerpc,
+ fpr_f7_powerpc,
+ fpr_f8_powerpc,
+ fpr_f9_powerpc,
+ fpr_f10_powerpc,
+ fpr_f11_powerpc,
+ fpr_f12_powerpc,
+ fpr_f13_powerpc,
+ fpr_f14_powerpc,
+ fpr_f15_powerpc,
+ fpr_f16_powerpc,
+ fpr_f17_powerpc,
+ fpr_f18_powerpc,
+ fpr_f19_powerpc,
+ fpr_f20_powerpc,
+ fpr_f21_powerpc,
+ fpr_f22_powerpc,
+ fpr_f23_powerpc,
+ fpr_f24_powerpc,
+ fpr_f25_powerpc,
+ fpr_f26_powerpc,
+ fpr_f27_powerpc,
+ fpr_f28_powerpc,
+ fpr_f29_powerpc,
+ fpr_f30_powerpc,
+ fpr_f31_powerpc,
+ fpr_fpscr_powerpc,
+ k_last_fpr = fpr_fpscr_powerpc,
+
+ k_first_vmx,
+ vmx_v0_powerpc = k_first_vmx,
+ vmx_v1_powerpc,
+ vmx_v2_powerpc,
+ vmx_v3_powerpc,
+ vmx_v4_powerpc,
+ vmx_v5_powerpc,
+ vmx_v6_powerpc,
+ vmx_v7_powerpc,
+ vmx_v8_powerpc,
+ vmx_v9_powerpc,
+ vmx_v10_powerpc,
+ vmx_v11_powerpc,
+ vmx_v12_powerpc,
+ vmx_v13_powerpc,
+ vmx_v14_powerpc,
+ vmx_v15_powerpc,
+ vmx_v16_powerpc,
+ vmx_v17_powerpc,
+ vmx_v18_powerpc,
+ vmx_v19_powerpc,
+ vmx_v20_powerpc,
+ vmx_v21_powerpc,
+ vmx_v22_powerpc,
+ vmx_v23_powerpc,
+ vmx_v24_powerpc,
+ vmx_v25_powerpc,
+ vmx_v26_powerpc,
+ vmx_v27_powerpc,
+ vmx_v28_powerpc,
+ vmx_v29_powerpc,
+ vmx_v30_powerpc,
+ vmx_v31_powerpc,
+ vmx_vrsave_powerpc,
+ vmx_vscr_powerpc,
+ k_last_vmx = vmx_vscr_powerpc,
+
+ k_num_registers_powerpc,
+ k_num_gpr_registers_powerpc = k_last_gpr_powerpc - k_first_gpr_powerpc + 1,
+ k_num_fpr_registers_powerpc = k_last_fpr - k_first_fpr + 1,
+ k_num_vmx_registers_powerpc = k_last_vmx - k_first_vmx + 1,
+};
+
#endif // LLDB_SOURCE_REGISTER_ARCH_REGISTERCONTEXT_POWERPC_H
diff --git a/lldb/source/Register/FreeBSD/RegisterInfoFreeBSD_powerpc.cpp b/lldb/source/Register/FreeBSD/RegisterInfoFreeBSD_powerpc.cpp
index 7213723fdfc1c0..4a5ee015c9192f 100644
--- a/lldb/source/Register/FreeBSD/RegisterInfoFreeBSD_powerpc.cpp
+++ b/lldb/source/Register/FreeBSD/RegisterInfoFreeBSD_powerpc.cpp
@@ -7,7 +7,8 @@
//===---------------------------------------------------------------------===//
#include "Register/FreeBSD/RegisterInfoFreeBSD_powerpc.h"
-#include "Plugins/Process/Utility/RegisterContextPOSIX_powerpc.h"
+#include "Register/Arch/RegisterContext_powerpc.h"
+#include "lldb/lldb-defines.h"
#include <vector>
using namespace lldb_private;
diff --git a/lldb/source/Register/Linux/RegisterInfoLinux_s390x.cpp b/lldb/source/Register/Linux/RegisterInfoLinux_s390x.cpp
index 682b83f723ade2..b2abed1d3ed9c4 100644
--- a/lldb/source/Register/Linux/RegisterInfoLinux_s390x.cpp
+++ b/lldb/source/Register/Linux/RegisterInfoLinux_s390x.cpp
@@ -7,7 +7,9 @@
//===----------------------------------------------------------------------===//
#include "Register/Linux/RegisterInfoLinux_s390x.h"
-#include "Plugins/Process/Utility/RegisterContextPOSIX_s390x.h"
+#include "Register/Arch/RegisterContext_s390x.h"
+#include "Register/Arch/lldb-s390x-register-enums.h"
+#include "lldb/lldb-defines.h"
using namespace lldb_private;
using namespace lldb;
diff --git a/lldb/unittests/Process/Utility/CMakeLists.txt b/lldb/unittests/Process/Utility/CMakeLists.txt
index c7dc4e969bd6f4..8b5118b9f36b96 100644
--- a/lldb/unittests/Process/Utility/CMakeLists.txt
+++ b/lldb/unittests/Process/Utility/CMakeLists.txt
@@ -30,4 +30,5 @@ add_lldb_unittest(RegisterSupportTests
${PLATFORM_SOURCES}
LINK_LIBS
- lldbRegister)
+ lldbRegister
+ lldbProcessContextSupport)
diff --git a/lldb/unittests/Process/Utility/RegisterInfoFreeBSDTest.cpp b/lldb/unittests/Process/Utility/RegisterInfoFreeBSDTest.cpp
index 332100f5c9c8fd..327071cb682c66 100644
--- a/lldb/unittests/Process/Utility/RegisterInfoFreeBSDTest.cpp
+++ b/lldb/unittests/Process/Utility/RegisterInfoFreeBSDTest.cpp
@@ -20,7 +20,7 @@
#include "Register/FreeBSD/RegisterInfoFreeBSD_i386.h"
#include "Register/FreeBSD/RegisterInfoFreeBSD_powerpc.h"
#include "Register/FreeBSD/RegisterInfoFreeBSD_x86_64.h"
-#include "Plugins/Process/Utility/RegisterContextPOSIX_powerpc.h"
+#include "Plugins/Process/Common/RegisterContext/POSIX/RegisterContextPOSIX_powerpc.h"
#include "Register/Common/RegisterInfoCommon_arm.h"
#include "Register/Common/RegisterInfoCommon_arm64.h"
#include "Register/Arch/lldb-arm-register-enums.h"
diff --git a/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Common/BUILD.gn b/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Common/BUILD.gn
new file mode 100644
index 00000000000000..f566b4336cafff
--- /dev/null
+++ b/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Common/BUILD.gn
@@ -0,0 +1,23 @@
+static_library("Common") {
+ output_name = "lldbProcessContextSupport"
+ configs += [ "//llvm/utils/gn/build:lldb_code" ]
+ deps = [
+ "//lldb/source/Register",
+ "//lldb/source/Target",
+ "//lldb/source/Utility",
+ "//llvm/lib/Support",
+ ]
+
+ include_dirs = [ "//lldb/source" ]
+ sources = [
+ "RegisterContext/POSIX/RegisterContextPOSIX_arm.cpp",
+ "RegisterContext/POSIX/RegisterContextPOSIX_arm64.cpp",
+ "RegisterContext/POSIX/RegisterContextPOSIX_loongarch64.cpp",
+ "RegisterContext/POSIX/RegisterContextPOSIX_powerpc.cpp",
+ "RegisterContext/POSIX/RegisterContextPOSIX_ppc64le.cpp",
+ "RegisterContext/POSIX/RegisterContextPOSIX_riscv32.cpp",
+ "RegisterContext/POSIX/RegisterContextPOSIX_riscv64.cpp",
+ "RegisterContext/POSIX/RegisterContextPOSIX_s390x.cpp",
+ "RegisterContext/POSIX/RegisterContextPOSIX_x86.cpp",
+ ]
+}
diff --git a/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Utility/BUILD.gn b/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Utility/BUILD.gn
index 175599f39f62ec..a2ffee0f15f19b 100644
--- a/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Utility/BUILD.gn
+++ b/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Utility/BUILD.gn
@@ -41,15 +41,6 @@ static_library("Utility") {
"RegisterContextMach_arm.cpp",
"RegisterContextMach_x86_64.cpp",
"RegisterContextMemory.cpp",
- "RegisterContextPOSIX_arm.cpp",
- "RegisterContextPOSIX_arm64.cpp",
- "RegisterContextPOSIX_loongarch64.cpp",
- "RegisterContextPOSIX_powerpc.cpp",
- "RegisterContextPOSIX_ppc64le.cpp",
- "RegisterContextPOSIX_riscv32.cpp",
- "RegisterContextPOSIX_riscv64.cpp",
- "RegisterContextPOSIX_s390x.cpp",
- "RegisterContextPOSIX_x86.cpp",
"RegisterContextThreadMemory.cpp",
"StopInfoMachException.cpp",
"ThreadMemory.cpp",
diff --git a/llvm/utils/gn/secondary/lldb/source/Plugins/Process/elf-core/BUILD.gn b/llvm/utils/gn/secondary/lldb/source/Plugins/Process/elf-core/BUILD.gn
index c102b6abce9658..2475f2f46069ee 100644
--- a/llvm/utils/gn/secondary/lldb/source/Plugins/Process/elf-core/BUILD.gn
+++ b/llvm/utils/gn/secondary/lldb/source/Plugins/Process/elf-core/BUILD.gn
@@ -5,6 +5,7 @@ static_library("elf-core") {
"//lldb/source/Core",
"//lldb/source/Plugins/DynamicLoader/POSIX-DYLD",
"//lldb/source/Plugins/ObjectFile/ELF",
+ "//lldb/source/Plugins/Process/Common",
"//lldb/source/Plugins/Process/Utility",
"//lldb/source/Target",
"//llvm/lib/BinaryFormat",
>From 309f16f2ea79b23ac59c537e4169469e6f6d4282 Mon Sep 17 00:00:00 2001
From: Minsoo Choo <minsoo at minsoo.io>
Date: Sun, 6 Sep 2026 10:14:33 -0400
Subject: [PATCH 6/6] [lldb] Isolate reusable Darwin register contexts
---
lldb/source/Plugins/ObjectFile/Mach-O/CMakeLists.txt | 2 +-
lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp | 8 ++++----
lldb/source/Plugins/Process/Common/CMakeLists.txt | 6 ++++++
.../Darwin}/RegisterContextDarwinConstants.h | 6 +++---
.../RegisterContext/Darwin}/RegisterContextDarwin_arm.cpp | 0
.../RegisterContext/Darwin}/RegisterContextDarwin_arm.h | 6 +++---
.../Darwin}/RegisterContextDarwin_arm64.cpp | 2 +-
.../RegisterContext/Darwin}/RegisterContextDarwin_arm64.h | 6 +++---
.../Darwin}/RegisterContextDarwin_riscv32.cpp | 0
.../Darwin}/RegisterContextDarwin_riscv32.h | 6 +++---
.../Darwin}/RegisterContextDarwin_x86_64.cpp | 0
.../Darwin}/RegisterContextDarwin_x86_64.h | 6 +++---
.../RegisterContext/Darwin}/RegisterContextMach_arm.cpp | 0
.../RegisterContext/Darwin}/RegisterContextMach_arm.h | 6 +++---
.../Darwin}/RegisterContextMach_x86_64.cpp | 0
.../RegisterContext/Darwin}/RegisterContextMach_x86_64.h | 6 +++---
lldb/source/Plugins/Process/MacOSX-Kernel/CMakeLists.txt | 2 +-
.../Process/MacOSX-Kernel/RegisterContextKDP_arm.h | 2 +-
.../Process/MacOSX-Kernel/RegisterContextKDP_arm64.h | 2 +-
.../Process/MacOSX-Kernel/RegisterContextKDP_x86_64.h | 2 +-
lldb/source/Plugins/Process/Utility/CMakeLists.txt | 6 ------
.../lldb/source/Plugins/ObjectFile/Mach-O/BUILD.gn | 2 +-
.../secondary/lldb/source/Plugins/Process/Common/BUILD.gn | 6 ++++++
.../lldb/source/Plugins/Process/Utility/BUILD.gn | 6 ------
24 files changed, 44 insertions(+), 44 deletions(-)
rename lldb/source/Plugins/Process/{Utility => Common/RegisterContext/Darwin}/RegisterContextDarwinConstants.h (67%)
rename lldb/source/Plugins/Process/{Utility => Common/RegisterContext/Darwin}/RegisterContextDarwin_arm.cpp (100%)
rename lldb/source/Plugins/Process/{Utility => Common/RegisterContext/Darwin}/RegisterContextDarwin_arm.h (96%)
rename lldb/source/Plugins/Process/{Utility => Common/RegisterContext/Darwin}/RegisterContextDarwin_arm64.cpp (99%)
rename lldb/source/Plugins/Process/{Utility => Common/RegisterContext/Darwin}/RegisterContextDarwin_arm64.h (95%)
rename lldb/source/Plugins/Process/{Utility => Common/RegisterContext/Darwin}/RegisterContextDarwin_riscv32.cpp (100%)
rename lldb/source/Plugins/Process/{Utility => Common/RegisterContext/Darwin}/RegisterContextDarwin_riscv32.h (95%)
rename lldb/source/Plugins/Process/{Utility => Common/RegisterContext/Darwin}/RegisterContextDarwin_x86_64.cpp (100%)
rename lldb/source/Plugins/Process/{Utility => Common/RegisterContext/Darwin}/RegisterContextDarwin_x86_64.h (94%)
rename lldb/source/Plugins/Process/{Utility => Common/RegisterContext/Darwin}/RegisterContextMach_arm.cpp (100%)
rename lldb/source/Plugins/Process/{Utility => Common/RegisterContext/Darwin}/RegisterContextMach_arm.h (81%)
rename lldb/source/Plugins/Process/{Utility => Common/RegisterContext/Darwin}/RegisterContextMach_x86_64.cpp (100%)
rename lldb/source/Plugins/Process/{Utility => Common/RegisterContext/Darwin}/RegisterContextMach_x86_64.h (79%)
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/CMakeLists.txt b/lldb/source/Plugins/ObjectFile/Mach-O/CMakeLists.txt
index 6bd4ab32e28ce2..566252aa312351 100644
--- a/lldb/source/Plugins/ObjectFile/Mach-O/CMakeLists.txt
+++ b/lldb/source/Plugins/ObjectFile/Mach-O/CMakeLists.txt
@@ -5,10 +5,10 @@ add_lldb_library(lldbPluginObjectFileMachO PLUGIN
LINK_COMPONENTS
Support
LINK_LIBS
+ lldbProcessContextSupport
lldbCore
lldbHost
lldbSymbol
lldbTarget
lldbUtility
- lldbPluginProcessUtility
)
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
index 4570df57c42cb3..a6a756b9ac123a 100644
--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -11,10 +11,10 @@
#include <algorithm>
-#include "Plugins/Process/Utility/RegisterContextDarwin_arm.h"
-#include "Plugins/Process/Utility/RegisterContextDarwin_arm64.h"
-#include "Plugins/Process/Utility/RegisterContextDarwin_riscv32.h"
-#include "Plugins/Process/Utility/RegisterContextDarwin_x86_64.h"
+#include "Plugins/Process/Common/RegisterContext/Darwin/RegisterContextDarwin_arm.h"
+#include "Plugins/Process/Common/RegisterContext/Darwin/RegisterContextDarwin_arm64.h"
+#include "Plugins/Process/Common/RegisterContext/Darwin/RegisterContextDarwin_riscv32.h"
+#include "Plugins/Process/Common/RegisterContext/Darwin/RegisterContextDarwin_x86_64.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/ModuleSpec.h"
diff --git a/lldb/source/Plugins/Process/Common/CMakeLists.txt b/lldb/source/Plugins/Process/Common/CMakeLists.txt
index f9f7289f9c1276..519569fc22e16a 100644
--- a/lldb/source/Plugins/Process/Common/CMakeLists.txt
+++ b/lldb/source/Plugins/Process/Common/CMakeLists.txt
@@ -1,4 +1,10 @@
add_lldb_library(lldbProcessContextSupport NO_PLUGIN_DEPENDENCIES
+ RegisterContext/Darwin/RegisterContextDarwin_arm.cpp
+ RegisterContext/Darwin/RegisterContextDarwin_arm64.cpp
+ RegisterContext/Darwin/RegisterContextDarwin_riscv32.cpp
+ RegisterContext/Darwin/RegisterContextDarwin_x86_64.cpp
+ RegisterContext/Darwin/RegisterContextMach_arm.cpp
+ RegisterContext/Darwin/RegisterContextMach_x86_64.cpp
RegisterContext/POSIX/RegisterContextPOSIX_arm.cpp
RegisterContext/POSIX/RegisterContextPOSIX_arm64.cpp
RegisterContext/POSIX/RegisterContextPOSIX_loongarch64.cpp
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwinConstants.h b/lldb/source/Plugins/Process/Common/RegisterContext/Darwin/RegisterContextDarwinConstants.h
similarity index 67%
rename from lldb/source/Plugins/Process/Utility/RegisterContextDarwinConstants.h
rename to lldb/source/Plugins/Process/Common/RegisterContext/Darwin/RegisterContextDarwinConstants.h
index 21582df91fb039..e06eaaf5c166ce 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwinConstants.h
+++ b/lldb/source/Plugins/Process/Common/RegisterContext/Darwin/RegisterContextDarwinConstants.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTDARWINCONSTANTS_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTDARWINCONSTANTS_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_DARWIN_REGISTERCONTEXTDARWINCONSTANTS_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_DARWIN_REGISTERCONTEXTDARWINCONSTANTS_H
namespace lldb_private {
@@ -22,4 +22,4 @@ namespace lldb_private {
} // namespace lldb_private
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTDARWINCONSTANTS_H
+#endif // LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_DARWIN_REGISTERCONTEXTDARWINCONSTANTS_H
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp b/lldb/source/Plugins/Process/Common/RegisterContext/Darwin/RegisterContextDarwin_arm.cpp
similarity index 100%
rename from lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
rename to lldb/source/Plugins/Process/Common/RegisterContext/Darwin/RegisterContextDarwin_arm.cpp
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.h b/lldb/source/Plugins/Process/Common/RegisterContext/Darwin/RegisterContextDarwin_arm.h
similarity index 96%
rename from lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.h
rename to lldb/source/Plugins/Process/Common/RegisterContext/Darwin/RegisterContextDarwin_arm.h
index 7ff1bded81f4b7..5521caa38cf6b6 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.h
+++ b/lldb/source/Plugins/Process/Common/RegisterContext/Darwin/RegisterContextDarwin_arm.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTDARWIN_ARM_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTDARWIN_ARM_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_DARWIN_REGISTERCONTEXTDARWIN_ARM_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_DARWIN_REGISTERCONTEXTDARWIN_ARM_H
#include "lldb/Target/RegisterContext.h"
#include "lldb/lldb-private.h"
@@ -261,4 +261,4 @@ class RegisterContextDarwin_arm : public lldb_private::RegisterContext {
static const lldb_private::RegisterInfo *GetRegisterInfos();
};
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTDARWIN_ARM_H
+#endif // LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_DARWIN_REGISTERCONTEXTDARWIN_ARM_H
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp b/lldb/source/Plugins/Process/Common/RegisterContext/Darwin/RegisterContextDarwin_arm64.cpp
similarity index 99%
rename from lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp
rename to lldb/source/Plugins/Process/Common/RegisterContext/Darwin/RegisterContextDarwin_arm64.cpp
index 43338c8cbc792f..0b30d3f3fa8172 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp
+++ b/lldb/source/Plugins/Process/Common/RegisterContext/Darwin/RegisterContextDarwin_arm64.cpp
@@ -67,7 +67,7 @@ using namespace lldb_private;
// Include RegisterInfos_arm64 to declare our g_register_infos_arm64 structure.
#define DECLARE_REGISTER_INFOS_ARM64_STRUCT
-#include "RegisterInfos_arm64.h"
+#include "Register/Arch/RegisterInfos_arm64.h"
#undef DECLARE_REGISTER_INFOS_ARM64_STRUCT
// General purpose registers
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.h b/lldb/source/Plugins/Process/Common/RegisterContext/Darwin/RegisterContextDarwin_arm64.h
similarity index 95%
rename from lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.h
rename to lldb/source/Plugins/Process/Common/RegisterContext/Darwin/RegisterContextDarwin_arm64.h
index a0d7821ae9e8b5..bfc70243af5760 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.h
+++ b/lldb/source/Plugins/Process/Common/RegisterContext/Darwin/RegisterContextDarwin_arm64.h
@@ -7,8 +7,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTDARWIN_ARM64_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTDARWIN_ARM64_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_DARWIN_REGISTERCONTEXTDARWIN_ARM64_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_DARWIN_REGISTERCONTEXTDARWIN_ARM64_H
#include "lldb/Target/RegisterContext.h"
#include "lldb/lldb-private.h"
@@ -228,4 +228,4 @@ class RegisterContextDarwin_arm64 : public lldb_private::RegisterContext {
static const lldb_private::RegisterInfo *GetRegisterInfos();
};
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTDARWIN_ARM64_H
+#endif // LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_DARWIN_REGISTERCONTEXTDARWIN_ARM64_H
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_riscv32.cpp b/lldb/source/Plugins/Process/Common/RegisterContext/Darwin/RegisterContextDarwin_riscv32.cpp
similarity index 100%
rename from lldb/source/Plugins/Process/Utility/RegisterContextDarwin_riscv32.cpp
rename to lldb/source/Plugins/Process/Common/RegisterContext/Darwin/RegisterContextDarwin_riscv32.cpp
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_riscv32.h b/lldb/source/Plugins/Process/Common/RegisterContext/Darwin/RegisterContextDarwin_riscv32.h
similarity index 95%
rename from lldb/source/Plugins/Process/Utility/RegisterContextDarwin_riscv32.h
rename to lldb/source/Plugins/Process/Common/RegisterContext/Darwin/RegisterContextDarwin_riscv32.h
index 22d61aef712a60..9655a87e07d040 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_riscv32.h
+++ b/lldb/source/Plugins/Process/Common/RegisterContext/Darwin/RegisterContextDarwin_riscv32.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTDARWIN_RISCV32_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTDARWIN_RISCV32_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_DARWIN_REGISTERCONTEXTDARWIN_RISCV32_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_DARWIN_REGISTERCONTEXTDARWIN_RISCV32_H
#include "lldb/Target/RegisterContext.h"
#include "lldb/lldb-private.h"
@@ -257,4 +257,4 @@ class RegisterContextDarwin_riscv32 : public lldb_private::RegisterContext {
static const lldb_private::RegisterInfo *GetRegisterInfos();
};
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTDARWIN_RISCV32_H
+#endif // LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_DARWIN_REGISTERCONTEXTDARWIN_RISCV32_H
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp b/lldb/source/Plugins/Process/Common/RegisterContext/Darwin/RegisterContextDarwin_x86_64.cpp
similarity index 100%
rename from lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp
rename to lldb/source/Plugins/Process/Common/RegisterContext/Darwin/RegisterContextDarwin_x86_64.cpp
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.h b/lldb/source/Plugins/Process/Common/RegisterContext/Darwin/RegisterContextDarwin_x86_64.h
similarity index 94%
rename from lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.h
rename to lldb/source/Plugins/Process/Common/RegisterContext/Darwin/RegisterContextDarwin_x86_64.h
index a132f92d4d497b..27ee7e8f0b155d 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.h
+++ b/lldb/source/Plugins/Process/Common/RegisterContext/Darwin/RegisterContextDarwin_x86_64.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTDARWIN_X86_64_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTDARWIN_X86_64_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_DARWIN_REGISTERCONTEXTDARWIN_X86_64_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_DARWIN_REGISTERCONTEXTDARWIN_X86_64_H
#include "lldb/Target/RegisterContext.h"
#include "lldb/lldb-private.h"
@@ -210,4 +210,4 @@ class RegisterContextDarwin_x86_64 : public lldb_private::RegisterContext {
static const lldb_private::RegisterInfo *GetRegisterInfos();
};
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTDARWIN_X86_64_H
+#endif // LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_DARWIN_REGISTERCONTEXTDARWIN_X86_64_H
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextMach_arm.cpp b/lldb/source/Plugins/Process/Common/RegisterContext/Darwin/RegisterContextMach_arm.cpp
similarity index 100%
rename from lldb/source/Plugins/Process/Utility/RegisterContextMach_arm.cpp
rename to lldb/source/Plugins/Process/Common/RegisterContext/Darwin/RegisterContextMach_arm.cpp
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextMach_arm.h b/lldb/source/Plugins/Process/Common/RegisterContext/Darwin/RegisterContextMach_arm.h
similarity index 81%
rename from lldb/source/Plugins/Process/Utility/RegisterContextMach_arm.h
rename to lldb/source/Plugins/Process/Common/RegisterContext/Darwin/RegisterContextMach_arm.h
index fedd0062c99c7d..d56271a1a19e25 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextMach_arm.h
+++ b/lldb/source/Plugins/Process/Common/RegisterContext/Darwin/RegisterContextMach_arm.h
@@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTMACH_ARM_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTMACH_ARM_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_DARWIN_REGISTERCONTEXTMACH_ARM_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_DARWIN_REGISTERCONTEXTMACH_ARM_H
#include "RegisterContextDarwin_arm.h"
@@ -36,4 +36,4 @@ class RegisterContextMach_arm : public RegisterContextDarwin_arm {
int DoWriteDBG(lldb::tid_t tid, int flavor, const DBG &dbg) override;
};
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTMACH_ARM_H
+#endif // LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_DARWIN_REGISTERCONTEXTMACH_ARM_H
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextMach_x86_64.cpp b/lldb/source/Plugins/Process/Common/RegisterContext/Darwin/RegisterContextMach_x86_64.cpp
similarity index 100%
rename from lldb/source/Plugins/Process/Utility/RegisterContextMach_x86_64.cpp
rename to lldb/source/Plugins/Process/Common/RegisterContext/Darwin/RegisterContextMach_x86_64.cpp
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextMach_x86_64.h b/lldb/source/Plugins/Process/Common/RegisterContext/Darwin/RegisterContextMach_x86_64.h
similarity index 79%
rename from lldb/source/Plugins/Process/Utility/RegisterContextMach_x86_64.h
rename to lldb/source/Plugins/Process/Common/RegisterContext/Darwin/RegisterContextMach_x86_64.h
index 99841a8e9a8d2d..ac4e31050de4cd 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextMach_x86_64.h
+++ b/lldb/source/Plugins/Process/Common/RegisterContext/Darwin/RegisterContextMach_x86_64.h
@@ -7,8 +7,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTMACH_X86_64_H
-#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTMACH_X86_64_H
+#ifndef LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_DARWIN_REGISTERCONTEXTMACH_X86_64_H
+#define LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_DARWIN_REGISTERCONTEXTMACH_X86_64_H
#include "RegisterContextDarwin_x86_64.h"
@@ -33,4 +33,4 @@ class RegisterContextMach_x86_64 : public RegisterContextDarwin_x86_64 {
int DoWriteEXC(lldb::tid_t tid, int flavor, const EXC &exc) override;
};
-#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERCONTEXTMACH_X86_64_H
+#endif // LLDB_SOURCE_PLUGINS_PROCESS_COMMON_REGISTERCONTEXT_DARWIN_REGISTERCONTEXTMACH_X86_64_H
diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/CMakeLists.txt b/lldb/source/Plugins/Process/MacOSX-Kernel/CMakeLists.txt
index f84d468bea5537..87b18ea0c6871c 100644
--- a/lldb/source/Plugins/Process/MacOSX-Kernel/CMakeLists.txt
+++ b/lldb/source/Plugins/Process/MacOSX-Kernel/CMakeLists.txt
@@ -21,6 +21,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
ThreadKDP.cpp
LINK_LIBS
+ lldbProcessContextSupport
lldbBreakpoint
lldbCore
lldbHost
@@ -30,7 +31,6 @@ if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
lldbUtility
lldbPluginDynamicLoaderDarwinKernel
lldbPluginDynamicLoaderStatic
- lldbPluginProcessUtility
)
add_dependencies(lldbPluginProcessMacOSXKernel
diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_arm.h b/lldb/source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_arm.h
index 5e8f5fad133e29..aa667e4d3e9081 100644
--- a/lldb/source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_arm.h
+++ b/lldb/source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_arm.h
@@ -9,7 +9,7 @@
#ifndef LLDB_SOURCE_PLUGINS_PROCESS_MACOSX_KERNEL_REGISTERCONTEXTKDP_ARM_H
#define LLDB_SOURCE_PLUGINS_PROCESS_MACOSX_KERNEL_REGISTERCONTEXTKDP_ARM_H
-#include "Plugins/Process/Utility/RegisterContextDarwin_arm.h"
+#include "Plugins/Process/Common/RegisterContext/Darwin/RegisterContextDarwin_arm.h"
class ThreadKDP;
diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_arm64.h b/lldb/source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_arm64.h
index d88d03e273fe3c..5c1007deeffcf6 100644
--- a/lldb/source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_arm64.h
+++ b/lldb/source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_arm64.h
@@ -10,7 +10,7 @@
#ifndef LLDB_SOURCE_PLUGINS_PROCESS_MACOSX_KERNEL_REGISTERCONTEXTKDP_ARM64_H
#define LLDB_SOURCE_PLUGINS_PROCESS_MACOSX_KERNEL_REGISTERCONTEXTKDP_ARM64_H
-#include "Plugins/Process/Utility/RegisterContextDarwin_arm64.h"
+#include "Plugins/Process/Common/RegisterContext/Darwin/RegisterContextDarwin_arm64.h"
class ThreadKDP;
diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_x86_64.h b/lldb/source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_x86_64.h
index 8e837c0630ab00..9a332aea237a9f 100644
--- a/lldb/source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_x86_64.h
+++ b/lldb/source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_x86_64.h
@@ -9,7 +9,7 @@
#ifndef LLDB_SOURCE_PLUGINS_PROCESS_MACOSX_KERNEL_REGISTERCONTEXTKDP_X86_64_H
#define LLDB_SOURCE_PLUGINS_PROCESS_MACOSX_KERNEL_REGISTERCONTEXTKDP_X86_64_H
-#include "Plugins/Process/Utility/RegisterContextDarwin_x86_64.h"
+#include "Plugins/Process/Common/RegisterContext/Darwin/RegisterContextDarwin_x86_64.h"
class ThreadKDP;
diff --git a/lldb/source/Plugins/Process/Utility/CMakeLists.txt b/lldb/source/Plugins/Process/Utility/CMakeLists.txt
index 6dbd6a5279e9cc..78bcd3b52d23e7 100644
--- a/lldb/source/Plugins/Process/Utility/CMakeLists.txt
+++ b/lldb/source/Plugins/Process/Utility/CMakeLists.txt
@@ -14,14 +14,8 @@ add_lldb_library(lldbPluginProcessUtility
NativeProcessSoftwareSingleStep.cpp
NetBSDSignals.cpp
OpenBSDSignals.cpp
- RegisterContextDarwin_arm.cpp
- RegisterContextDarwin_arm64.cpp
- RegisterContextDarwin_riscv32.cpp
- RegisterContextDarwin_x86_64.cpp
RegisterContextDummy.cpp
RegisterContextHistory.cpp
- RegisterContextMach_arm.cpp
- RegisterContextMach_x86_64.cpp
RegisterContextMemory.cpp
RegisterContextThreadMemory.cpp
StopInfoMachException.cpp
diff --git a/llvm/utils/gn/secondary/lldb/source/Plugins/ObjectFile/Mach-O/BUILD.gn b/llvm/utils/gn/secondary/lldb/source/Plugins/ObjectFile/Mach-O/BUILD.gn
index c321d989a7ed64..3c72603b995bc7 100644
--- a/llvm/utils/gn/secondary/lldb/source/Plugins/ObjectFile/Mach-O/BUILD.gn
+++ b/llvm/utils/gn/secondary/lldb/source/Plugins/ObjectFile/Mach-O/BUILD.gn
@@ -4,7 +4,7 @@ static_library("Mach-O") {
deps = [
"//lldb/source/Core",
"//lldb/source/Host",
- "//lldb/source/Plugins/Process/Utility",
+ "//lldb/source/Plugins/Process/Common",
"//lldb/source/Symbol",
"//lldb/source/Target",
"//lldb/source/Utility",
diff --git a/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Common/BUILD.gn b/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Common/BUILD.gn
index f566b4336cafff..f2dde58504d37d 100644
--- a/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Common/BUILD.gn
+++ b/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Common/BUILD.gn
@@ -10,6 +10,12 @@ static_library("Common") {
include_dirs = [ "//lldb/source" ]
sources = [
+ "RegisterContext/Darwin/RegisterContextDarwin_arm.cpp",
+ "RegisterContext/Darwin/RegisterContextDarwin_arm64.cpp",
+ "RegisterContext/Darwin/RegisterContextDarwin_riscv32.cpp",
+ "RegisterContext/Darwin/RegisterContextDarwin_x86_64.cpp",
+ "RegisterContext/Darwin/RegisterContextMach_arm.cpp",
+ "RegisterContext/Darwin/RegisterContextMach_x86_64.cpp",
"RegisterContext/POSIX/RegisterContextPOSIX_arm.cpp",
"RegisterContext/POSIX/RegisterContextPOSIX_arm64.cpp",
"RegisterContext/POSIX/RegisterContextPOSIX_loongarch64.cpp",
diff --git a/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Utility/BUILD.gn b/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Utility/BUILD.gn
index a2ffee0f15f19b..2252e0e72f0c00 100644
--- a/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Utility/BUILD.gn
+++ b/llvm/utils/gn/secondary/lldb/source/Plugins/Process/Utility/BUILD.gn
@@ -32,14 +32,8 @@ static_library("Utility") {
"NativeProcessSoftwareSingleStep.cpp",
"NetBSDSignals.cpp",
"OpenBSDSignals.cpp",
- "RegisterContextDarwin_arm.cpp",
- "RegisterContextDarwin_arm64.cpp",
- "RegisterContextDarwin_riscv32.cpp",
- "RegisterContextDarwin_x86_64.cpp",
"RegisterContextDummy.cpp",
"RegisterContextHistory.cpp",
- "RegisterContextMach_arm.cpp",
- "RegisterContextMach_x86_64.cpp",
"RegisterContextMemory.cpp",
"RegisterContextThreadMemory.cpp",
"StopInfoMachException.cpp",
More information about the lldb-commits
mailing list