[Lldb-commits] [lldb] r318260 - Two small fixes to handle arm64 fpu register contexts in

Jason Molenda via lldb-commits lldb-commits at lists.llvm.org
Tue Nov 14 19:18:24 PST 2017


Author: jmolenda
Date: Tue Nov 14 19:18:24 2017
New Revision: 318260

URL: http://llvm.org/viewvc/llvm-project?rev=318260&view=rev
Log:
Two small fixes to handle arm64 fpu register contexts in 
a Mach-O file load command correctly, patch by Ryan
Mansfield.

<rdar://problem/35468499> 

Modified:
    lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.h

Modified: lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp?rev=318260&r1=318259&r2=318260&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Tue Nov 14 19:18:24 2017
@@ -686,7 +686,7 @@ public:
       case FPURegSet: {
         uint8_t *fpu_reg_buf = (uint8_t *)&fpu.v[0];
         const int fpu_reg_buf_size = sizeof(fpu);
-        if (fpu_reg_buf_size == count &&
+        if (fpu_reg_buf_size == count * sizeof(uint32_t) &&
             data.ExtractBytes(offset, fpu_reg_buf_size, eByteOrderLittle,
                               fpu_reg_buf) == fpu_reg_buf_size) {
           SetError(FPURegSet, Read, 0);

Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.h?rev=318260&r1=318259&r2=318260&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.h (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.h Tue Nov 14 19:18:24 2017
@@ -83,7 +83,7 @@ public:
 
   // mirrors <mach/arm/thread_status.h> arm_neon_state64_t
   struct FPU {
-    VReg v[32];
+    alignas(__uint128_t) VReg v[32];
     uint32_t fpsr;
     uint32_t fpcr;
   };




More information about the lldb-commits mailing list