summaryrefslogtreecommitdiffstats
path: root/lldb/tools/debugserver/source/MacOSX
diff options
context:
space:
mode:
authorFrederic Riss <friss@apple.com>2018-04-27 00:09:04 +0000
committerFrederic Riss <friss@apple.com>2018-04-27 00:09:04 +0000
commit34ec0bfb5ecee851d31d77a21dd69d49d58eb6b5 (patch)
treebb2ebbd0e9dcc0db454e18d9d7c0eddd103c0f2c /lldb/tools/debugserver/source/MacOSX
parent887fbc61d4ad17842214329dddcd8085d822081a (diff)
downloadbcm5719-llvm-34ec0bfb5ecee851d31d77a21dd69d49d58eb6b5.tar.gz
bcm5719-llvm-34ec0bfb5ecee851d31d77a21dd69d49d58eb6b5.zip
[debugserver] Fix handling of the 'g' packet
LLDB doesn't use this packet so we never hit this, but it looks like some other projects talk to debugserver and are hitting an assert (https://github.com/derekparker/delve/issues/1015). We had an off by 1 in the accounting of the FPU structure sizes. I added a test that basically just check that 'g' doesn't return an error (currently it assert in debug builds). I didn't make it an lldb-server test because it looks like lldb-server doesn't implement the g packet. llvm-svn: 331004
Diffstat (limited to 'lldb/tools/debugserver/source/MacOSX')
-rw-r--r--lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp b/lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
index 4cdb3e265bc..6b4dcdec144 100644
--- a/lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
+++ b/lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
@@ -2633,7 +2633,9 @@ nub_size_t DNBArchImplX86_64::GetRegisterContext(void *buf,
// Walk around the gaps in the FPU regs
memcpy(p, &m_state.context.fpu.no_avx.__fpu_fcw, 5);
- p += 5;
+ // We read 5 bytes, but we skip 6 to account for __fpu_rsrv1
+ // to match the g_fpu_registers_* tables.
+ p += 6;
memcpy(p, &m_state.context.fpu.no_avx.__fpu_fop, 8);
p += 8;
memcpy(p, &m_state.context.fpu.no_avx.__fpu_dp, 6);
OpenPOWER on IntegriCloud