[Lldb-commits] [lldb] r318357 - Fix alignment of arm64 fpu register context structure
Jason Molenda via lldb-commits
lldb-commits at lists.llvm.org
Wed Nov 15 16:50:29 PST 2017
Author: jmolenda
Date: Wed Nov 15 16:50:29 2017
New Revision: 318357
URL: http://llvm.org/viewvc/llvm-project?rev=318357&view=rev
Log:
Fix alignment of arm64 fpu register context structure
so it has the same padding as the kernel's definition
which is written in terms of uint128_t. Original 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.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=318357&r1=318356&r2=318357&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Wed Nov 15 16:50:29 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.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp?rev=318357&r1=318356&r2=318357&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp Wed Nov 15 16:50:29 2017
@@ -426,7 +426,7 @@ bool RegisterContextDarwin_arm64::ReadRe
case fpu_v29:
case fpu_v30:
case fpu_v31:
- value.SetBytes(fpu.v[reg].bytes, reg_info->byte_size,
+ value.SetBytes(fpu.v[reg].bytes.buffer, reg_info->byte_size,
endian::InlHostByteOrder());
break;
@@ -618,7 +618,7 @@ bool RegisterContextDarwin_arm64::WriteR
case fpu_v29:
case fpu_v30:
case fpu_v31:
- ::memcpy(fpu.v[reg].bytes, value.GetBytes(), value.GetByteSize());
+ ::memcpy(fpu.v[reg].bytes.buffer, value.GetBytes(), value.GetByteSize());
break;
case fpu_fpsr:
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=318357&r1=318356&r2=318357&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.h (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.h Wed Nov 15 16:50:29 2017
@@ -78,7 +78,7 @@ public:
};
struct VReg {
- uint8_t bytes[16];
+ llvm::AlignedCharArray<16, 16> bytes;
};
// mirrors <mach/arm/thread_status.h> arm_neon_state64_t
More information about the lldb-commits
mailing list