[Lldb-commits] [PATCH] D112131: [lldb] [Process/Linux] Support arbitrarily-sized FPR writes on ARM

Michał Górny via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Oct 20 06:07:42 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rG192331b890e2: [lldb] [Process/Linux] Support arbitrarily-sized FPR writes on ARM (authored by mgorny).
Herald added a project: LLDB.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112131/new/

https://reviews.llvm.org/D112131

Files:
  lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp


Index: lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
===================================================================
--- lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
+++ lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
@@ -182,27 +182,9 @@
     uint32_t fpr_offset = CalculateFprOffset(reg_info);
     assert(fpr_offset < sizeof m_fpr);
     uint8_t *dst = (uint8_t *)&m_fpr + fpr_offset;
-    switch (reg_info->byte_size) {
-    case 2:
-      *(uint16_t *)dst = reg_value.GetAsUInt16();
-      break;
-    case 4:
-      *(uint32_t *)dst = reg_value.GetAsUInt32();
-      break;
-    case 8:
-      *(uint64_t *)dst = reg_value.GetAsUInt64();
-      break;
-    default:
-      assert(false && "Unhandled data size.");
-      return Status("unhandled register data size %" PRIu32,
-                    reg_info->byte_size);
-    }
+    ::memcpy(dst, reg_value.GetBytes(), reg_info->byte_size);
 
-    Status error = WriteFPR();
-    if (error.Fail())
-      return error;
-
-    return Status();
+    return WriteFPR();
   }
 
   return Status("failed - register wasn't recognized to be a GPR or an FPR, "


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112131.380926.patch
Type: text/x-patch
Size: 1179 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20211020/28cc3eb6/attachment.bin>


More information about the lldb-commits mailing list