[Lldb-commits] [PATCH] D91076: [lldb] [Process/FreeBSDRemote] Correct DS/ES/FS/GS register sizes
Michał Górny via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Mon Nov 9 06:45:22 PST 2020
mgorny created this revision.
mgorny added reviewers: emaste, krytarowski, labath.
Herald added a subscriber: arichardson.
mgorny requested review of this revision.
Fix DS/ES/FS/GS register sizes in getter/setter for FreeBSD. Apparently
only CS and SS registers are specified as 64/32-bit in LLDB, while
the others are specified as 16-bit. This fixes the failing
StandardStartupTest.TestStopReplyContainsThreadPcs lldb-server unittest.
https://reviews.llvm.org/D91076
Files:
lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
Index: lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
===================================================================
--- lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
+++ lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
@@ -595,19 +595,19 @@
reg_value = (uint64_t)m_gpr.r_cs;
break;
case lldb_fs_x86_64:
- reg_value = (uint64_t)m_gpr.r_fs;
+ reg_value = (uint16_t)m_gpr.r_fs;
break;
case lldb_gs_x86_64:
- reg_value = (uint64_t)m_gpr.r_gs;
+ reg_value = (uint16_t)m_gpr.r_gs;
break;
case lldb_ss_x86_64:
reg_value = (uint64_t)m_gpr.r_ss;
break;
case lldb_ds_x86_64:
- reg_value = (uint64_t)m_gpr.r_ds;
+ reg_value = (uint16_t)m_gpr.r_ds;
break;
case lldb_es_x86_64:
- reg_value = (uint64_t)m_gpr.r_es;
+ reg_value = (uint16_t)m_gpr.r_es;
break;
#else
case lldb_rax_x86_64:
@@ -644,19 +644,19 @@
reg_value = (uint32_t)m_gpr.r_cs;
break;
case lldb_fs_x86_64:
- reg_value = (uint32_t)m_gpr.r_fs;
+ reg_value = (uint16_t)m_gpr.r_fs;
break;
case lldb_gs_x86_64:
- reg_value = (uint32_t)m_gpr.r_gs;
+ reg_value = (uint16_t)m_gpr.r_gs;
break;
case lldb_ss_x86_64:
reg_value = (uint32_t)m_gpr.r_ss;
break;
case lldb_ds_x86_64:
- reg_value = (uint32_t)m_gpr.r_ds;
+ reg_value = (uint16_t)m_gpr.r_ds;
break;
case lldb_es_x86_64:
- reg_value = (uint32_t)m_gpr.r_es;
+ reg_value = (uint16_t)m_gpr.r_es;
break;
#endif
#if defined(__x86_64__)
@@ -905,19 +905,19 @@
m_gpr.r_cs = reg_value.GetAsUInt64();
break;
case lldb_fs_x86_64:
- m_gpr.r_fs = reg_value.GetAsUInt64();
+ m_gpr.r_fs = reg_value.GetAsUInt16();
break;
case lldb_gs_x86_64:
- m_gpr.r_gs = reg_value.GetAsUInt64();
+ m_gpr.r_gs = reg_value.GetAsUInt16();
break;
case lldb_ss_x86_64:
m_gpr.r_ss = reg_value.GetAsUInt64();
break;
case lldb_ds_x86_64:
- m_gpr.r_ds = reg_value.GetAsUInt64();
+ m_gpr.r_ds = reg_value.GetAsUInt16();
break;
case lldb_es_x86_64:
- m_gpr.r_es = reg_value.GetAsUInt64();
+ m_gpr.r_es = reg_value.GetAsUInt16();
break;
#else
case lldb_rax_x86_64:
@@ -954,19 +954,19 @@
m_gpr.r_cs = reg_value.GetAsUInt32();
break;
case lldb_fs_x86_64:
- m_gpr.r_fs = reg_value.GetAsUInt32();
+ m_gpr.r_fs = reg_value.GetAsUInt16();
break;
case lldb_gs_x86_64:
- m_gpr.r_gs = reg_value.GetAsUInt32();
+ m_gpr.r_gs = reg_value.GetAsUInt16();
break;
case lldb_ss_x86_64:
m_gpr.r_ss = reg_value.GetAsUInt32();
break;
case lldb_ds_x86_64:
- m_gpr.r_ds = reg_value.GetAsUInt32();
+ m_gpr.r_ds = reg_value.GetAsUInt16();
break;
case lldb_es_x86_64:
- m_gpr.r_es = reg_value.GetAsUInt32();
+ m_gpr.r_es = reg_value.GetAsUInt16();
break;
#endif
case lldb_fctrl_x86_64:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91076.303859.patch
Type: text/x-patch
Size: 2957 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20201109/cddaf721/attachment.bin>
More information about the lldb-commits
mailing list