[Lldb-commits] [lldb] c01b76e - [lldb] Support "eflags" register name in generic reg fallback
Michał Górny via lldb-commits
lldb-commits at lists.llvm.org
Wed Sep 8 02:33:39 PDT 2021
Author: Michał Górny
Date: 2021-09-08T11:33:29+02:00
New Revision: c01b76e733d6e5e2d21e4277dceaa1f319794c6a
URL: https://github.com/llvm/llvm-project/commit/c01b76e733d6e5e2d21e4277dceaa1f319794c6a
DIFF: https://github.com/llvm/llvm-project/commit/c01b76e733d6e5e2d21e4277dceaa1f319794c6a.diff
LOG: [lldb] Support "eflags" register name in generic reg fallback
Enhance the generic register fallback code to support "eflags" register
name in addition to "rflags", as the former is used by gdbserver. This
permits lldb-server to recognize the generic flags register when
interfacing with gdbserver-style target.xml (i.e. without generic=""
attributes), and therefore aligns ABI plugins' AugmentRegisterInfo()
between lldb-server and gdbserver.
Differential Revision: https://reviews.llvm.org/D108548
Added:
Modified:
lldb/source/Plugins/ABI/X86/ABISysV_x86_64.cpp
lldb/source/Plugins/ABI/X86/ABIWindows_x86_64.cpp
lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
Removed:
################################################################################
diff --git a/lldb/source/Plugins/ABI/X86/ABISysV_x86_64.cpp b/lldb/source/Plugins/ABI/X86/ABISysV_x86_64.cpp
index 196b45b3b6da4..9af8aace9f12c 100644
--- a/lldb/source/Plugins/ABI/X86/ABISysV_x86_64.cpp
+++ b/lldb/source/Plugins/ABI/X86/ABISysV_x86_64.cpp
@@ -933,6 +933,8 @@ uint32_t ABISysV_x86_64::GetGenericNum(llvm::StringRef name) {
.Case("rsp", LLDB_REGNUM_GENERIC_SP)
.Case("rbp", LLDB_REGNUM_GENERIC_FP)
.Case("rflags", LLDB_REGNUM_GENERIC_FLAGS)
+ // gdbserver uses eflags
+ .Case("eflags", LLDB_REGNUM_GENERIC_FLAGS)
.Case("rdi", LLDB_REGNUM_GENERIC_ARG1)
.Case("rsi", LLDB_REGNUM_GENERIC_ARG2)
.Case("rdx", LLDB_REGNUM_GENERIC_ARG3)
diff --git a/lldb/source/Plugins/ABI/X86/ABIWindows_x86_64.cpp b/lldb/source/Plugins/ABI/X86/ABIWindows_x86_64.cpp
index 6c473c652c5f8..dc8789820e3d0 100644
--- a/lldb/source/Plugins/ABI/X86/ABIWindows_x86_64.cpp
+++ b/lldb/source/Plugins/ABI/X86/ABIWindows_x86_64.cpp
@@ -806,6 +806,8 @@ uint32_t ABIWindows_x86_64::GetGenericNum(llvm::StringRef reg) {
.Case("rsp", LLDB_REGNUM_GENERIC_SP)
.Case("rbp", LLDB_REGNUM_GENERIC_FP)
.Case("rflags", LLDB_REGNUM_GENERIC_FLAGS)
+ // gdbserver uses eflags
+ .Case("eflags", LLDB_REGNUM_GENERIC_FLAGS)
.Case("rcx", LLDB_REGNUM_GENERIC_ARG1)
.Case("rdx", LLDB_REGNUM_GENERIC_ARG2)
.Case("r8", LLDB_REGNUM_GENERIC_ARG3)
diff --git a/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp b/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
index a85d7bd6f525a..f3dfa5d57fc85 100644
--- a/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
+++ b/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
@@ -603,6 +603,7 @@ void DynamicRegisterInfo::Finalize(const ArchSpec &arch) {
(strcmp(reg.name, "fp") == 0))
reg.kinds[eRegisterKindGeneric] = LLDB_REGNUM_GENERIC_FP;
else if ((strcmp(reg.name, "rflags") == 0) ||
+ (strcmp(reg.name, "eflags") == 0) ||
(strcmp(reg.name, "flags") == 0))
reg.kinds[eRegisterKindGeneric] = LLDB_REGNUM_GENERIC_FLAGS;
}
More information about the lldb-commits
mailing list