diff options
Diffstat (limited to 'lldb')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteGPacket.py | 30 | ||||
-rw-r--r-- | lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp | 4 |
2 files changed, 33 insertions, 1 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteGPacket.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteGPacket.py new file mode 100644 index 00000000000..f2155a03786 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteGPacket.py @@ -0,0 +1,30 @@ +from __future__ import print_function + + +import gdbremote_testcase +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + + +class TestGdbRemoteGPacket(gdbremote_testcase.GdbRemoteTestCaseBase): + + mydir = TestBase.compute_mydir(__file__) + + def run_test_g_packet(self): + self.build() + self.prep_debug_monitor_and_inferior() + self.test_sequence.add_log_lines( + ["read packet: $g#67", + {"direction": "send", "regex": r"^\$(.+)#[0-9a-fA-F]{2}$", + "capture": {1: "register_bank"}}], + True) + self.connect_to_debug_monitor() + context = self.expect_gdbremote_sequence() + register_bank = context.get("register_bank") + self.assertTrue(register_bank[0] != 'E') + + @debugserver_test + def test_g_packet_debugserver(self): + self.init_debugserver_test() + self.run_test_g_packet() 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); |