[lldb] [Process/NetBSD] Fix operating on ftag register
authorMichał Górny <mgorny@moritz.systems>
Wed, 30 Sep 2020 12:53:05 +0000 (14:53 +0200)
committerMichał Górny <mgorny@moritz.systems>
Wed, 30 Sep 2020 13:39:31 +0000 (15:39 +0200)
lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp

index ca4706a..af8b2a2 100644 (file)
@@ -324,7 +324,7 @@ static constexpr int RegNumX86ToX86_64(int regnum) {
   case lldb_fstat_i386:
     return lldb_fstat_x86_64;
   case lldb_ftag_i386:
-    return lldb_fstat_x86_64;
+    return lldb_ftag_x86_64;
   case lldb_fop_i386:
     return lldb_fop_x86_64;
   case lldb_fiseg_i386:
@@ -651,7 +651,7 @@ NativeRegisterContextNetBSD_x86_64::ReadRegister(const RegisterInfo *reg_info,
     reg_value = (uint16_t)m_fpr.fxstate.fx_sw;
     break;
   case lldb_ftag_x86_64:
-    reg_value = (uint8_t)m_fpr.fxstate.fx_tw;
+    reg_value = (uint16_t)m_fpr.fxstate.fx_tw;
     break;
   case lldb_fop_x86_64:
     reg_value = (uint64_t)m_fpr.fxstate.fx_opcode;
@@ -939,7 +939,7 @@ Status NativeRegisterContextNetBSD_x86_64::WriteRegister(
     m_fpr.fxstate.fx_sw = reg_value.GetAsUInt16();
     break;
   case lldb_ftag_x86_64:
-    m_fpr.fxstate.fx_tw = reg_value.GetAsUInt8();
+    m_fpr.fxstate.fx_tw = reg_value.GetAsUInt16();
     break;
   case lldb_fop_x86_64:
     m_fpr.fxstate.fx_opcode = reg_value.GetAsUInt16();