From 663d2e18038337fb41ae592462fdd3d9deae7557 Mon Sep 17 00:00:00 2001 From: Jason Molenda Date: Tue, 14 May 2013 03:52:22 +0000 Subject: [PATCH] Small change to the previous checkin, read in the fpu register context in one large block - and be sure toget the fpscr value as well when processing a core file. llvm-svn: 181756 --- .../Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp index da32acd3e43e..7ef4fac24223 100644 --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -305,12 +305,18 @@ public: case FPURegSet: { - uint32_t *d = &fpu.floats.s[0]; - for (uint32_t i = 0; i < count && d < d + (sizeof (fpu.floats) / sizeof (uint32_t)); i++) + uint8_t *fpu_reg_buf = (uint8_t*) &fpu.floats.s[0]; + const int fpu_reg_buf_size = sizeof (fpu.floats); + if (data.ExtractBytes (offset, fpu_reg_buf_size, eByteOrderLittle, fpu_reg_buf) == fpu_reg_buf_size) { - *d++ = data.GetU32(&offset); + offset += fpu_reg_buf_size; + fpu.fpscr = data.GetU32(&offset); + SetError (FPURegSet, Read, 0); + } + else + { + done = true; } - SetError (FPURegSet, Read, 0); } break;