[Lldb-commits] [PATCH] D108548: [lldb] Support "eflags" register name in generic reg fallback
Michał Górny via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Mon Aug 23 05:22:22 PDT 2021
mgorny created this revision.
mgorny added reviewers: labath, krytarowski, jasonmolenda, JDevlieghere, emaste.
mgorny requested review of this revision.
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.
https://reviews.llvm.org/D108548
Files:
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
Index: lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
===================================================================
--- lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
+++ lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
@@ -603,6 +603,7 @@
(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;
}
Index: lldb/source/Plugins/ABI/X86/ABIWindows_x86_64.cpp
===================================================================
--- lldb/source/Plugins/ABI/X86/ABIWindows_x86_64.cpp
+++ lldb/source/Plugins/ABI/X86/ABIWindows_x86_64.cpp
@@ -806,6 +806,8 @@
.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)
Index: lldb/source/Plugins/ABI/X86/ABISysV_x86_64.cpp
===================================================================
--- lldb/source/Plugins/ABI/X86/ABISysV_x86_64.cpp
+++ lldb/source/Plugins/ABI/X86/ABISysV_x86_64.cpp
@@ -933,6 +933,8 @@
.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)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108548.368072.patch
Type: text/x-patch
Size: 1856 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210823/c50801dc/attachment.bin>
More information about the lldb-commits
mailing list