[Lldb-commits] [lldb] 194c5ac - [lldb] [Process/FreeBSDRemote] Correct DS/ES/FS/GS register sizes
Michał Górny via lldb-commits
lldb-commits at lists.llvm.org
Tue Nov 10 05:18:19 PST 2020
Author: Michał Górny
Date: 2020-11-10T14:18:03+01:00
New Revision: 194c5accb2be0dab75085f8f5c9c488d1cee7606
URL: https://github.com/llvm/llvm-project/commit/194c5accb2be0dab75085f8f5c9c488d1cee7606
DIFF: https://github.com/llvm/llvm-project/commit/194c5accb2be0dab75085f8f5c9c488d1cee7606.diff
LOG: [lldb] [Process/FreeBSDRemote] Correct DS/ES/FS/GS register sizes
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.
Differential Revision: https://reviews.llvm.org/D91076
Added:
Modified:
lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
Removed:
################################################################################
diff --git a/lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp b/lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
index 8a58e8ff2181..4e0fb280ceff 100644
--- a/lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
+++ b/lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
@@ -595,19 +595,19 @@ NativeRegisterContextFreeBSD_x86_64::ReadRegister(const RegisterInfo *reg_info,
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 @@ NativeRegisterContextFreeBSD_x86_64::ReadRegister(const RegisterInfo *reg_info,
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 @@ Status NativeRegisterContextFreeBSD_x86_64::WriteRegister(
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 @@ Status NativeRegisterContextFreeBSD_x86_64::WriteRegister(
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:
More information about the lldb-commits
mailing list