From f89a7fa319ccd903a9db69a9e32e1e63d866c5f8 Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Fri, 21 Mar 2025 22:10:54 +1300 Subject: [PATCH] [lldb] Ignore registers that the debugserver fails to read (#132122) On Mac x86-64, the debugserver reports a register ('ds' at least) but returns an error when we try to read it. Just skip storing such registers in snapshots so we won't try to restore them. --- lldb/packages/Python/lldbsuite/test/lldbreverse.py | 5 ++++- .../reverse-execution/TestReverseContinueBreakpoints.py | 8 -------- .../reverse-execution/TestReverseContinueWatchpoints.py | 4 ---- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/lldb/packages/Python/lldbsuite/test/lldbreverse.py b/lldb/packages/Python/lldbsuite/test/lldbreverse.py index a42cc7cac15d..d9a8daba3772 100644 --- a/lldb/packages/Python/lldbsuite/test/lldbreverse.py +++ b/lldb/packages/Python/lldbsuite/test/lldbreverse.py @@ -300,7 +300,10 @@ class ReverseTestBase(GDBProxyTestBase): for index in sorted(self.general_purpose_register_info.keys()): reply = self.pass_through(f"p{index:x};thread:{thread_id:x};") if reply == "" or reply[0] == "E": - raise ValueError("Can't read register") + # Mac debugserver tells us about registers that it won't let + # us actually read. Ignore those registers. + self.logger.debug(f"Failed to read register {index:x}") + continue registers[index] = reply thread_snapshot = ThreadSnapshot(thread_id, registers) thread_sp = self.get_register( diff --git a/lldb/test/API/functionalities/reverse-execution/TestReverseContinueBreakpoints.py b/lldb/test/API/functionalities/reverse-execution/TestReverseContinueBreakpoints.py index 1ff645b94d2e..a159e0f716db 100644 --- a/lldb/test/API/functionalities/reverse-execution/TestReverseContinueBreakpoints.py +++ b/lldb/test/API/functionalities/reverse-execution/TestReverseContinueBreakpoints.py @@ -11,13 +11,11 @@ from lldbsuite.test import lldbutil class TestReverseContinueBreakpoints(ReverseTestBase): @skipIfRemote @skipIf(macos_version=["<", "15.0"]) - @skipIf(oslist=lldbplatformutil.getDarwinOSTriples(), archs=["x86_64"]) def test_reverse_continue(self): self.reverse_continue_internal(async_mode=False) @skipIfRemote @skipIf(macos_version=["<", "15.0"]) - @skipIf(oslist=lldbplatformutil.getDarwinOSTriples(), archs=["x86_64"]) def test_reverse_continue_async(self): self.reverse_continue_internal(async_mode=True) @@ -47,13 +45,11 @@ class TestReverseContinueBreakpoints(ReverseTestBase): @skipIfRemote @skipIf(macos_version=["<", "15.0"]) - @skipIf(oslist=lldbplatformutil.getDarwinOSTriples(), archs=["x86_64"]) def test_reverse_continue_breakpoint(self): self.reverse_continue_breakpoint_internal(async_mode=False) @skipIfRemote @skipIf(macos_version=["<", "15.0"]) - @skipIf(oslist=lldbplatformutil.getDarwinOSTriples(), archs=["x86_64"]) def test_reverse_continue_breakpoint_async(self): self.reverse_continue_breakpoint_internal(async_mode=True) @@ -72,13 +68,11 @@ class TestReverseContinueBreakpoints(ReverseTestBase): @skipIfRemote @skipIf(macos_version=["<", "15.0"]) - @skipIf(oslist=lldbplatformutil.getDarwinOSTriples(), archs=["x86_64"]) def test_reverse_continue_skip_breakpoint(self): self.reverse_continue_skip_breakpoint_internal(async_mode=False) @skipIfRemote @skipIf(macos_version=["<", "15.0"]) - @skipIf(oslist=lldbplatformutil.getDarwinOSTriples(), archs=["x86_64"]) def test_reverse_continue_skip_breakpoint_async(self): self.reverse_continue_skip_breakpoint_internal(async_mode=True) @@ -104,13 +98,11 @@ class TestReverseContinueBreakpoints(ReverseTestBase): @skipIfRemote @skipIf(macos_version=["<", "15.0"]) - @skipIf(oslist=lldbplatformutil.getDarwinOSTriples(), archs=["x86_64"]) def test_continue_preserves_direction(self): self.continue_preserves_direction_internal(async_mode=False) @skipIfRemote @skipIf(macos_version=["<", "15.0"]) - @skipIf(oslist=lldbplatformutil.getDarwinOSTriples(), archs=["x86_64"]) def test_continue_preserves_direction_asyhc(self): self.continue_preserves_direction_internal(async_mode=True) diff --git a/lldb/test/API/functionalities/reverse-execution/TestReverseContinueWatchpoints.py b/lldb/test/API/functionalities/reverse-execution/TestReverseContinueWatchpoints.py index 519f1cb23604..c942f2a0386e 100644 --- a/lldb/test/API/functionalities/reverse-execution/TestReverseContinueWatchpoints.py +++ b/lldb/test/API/functionalities/reverse-execution/TestReverseContinueWatchpoints.py @@ -11,13 +11,11 @@ from lldbsuite.test import lldbutil class TestReverseContinueWatchpoints(ReverseTestBase): @skipIfRemote @skipIf(macos_version=["<", "15.0"]) - @skipIf(oslist=lldbplatformutil.getDarwinOSTriples(), archs=["x86_64"]) def test_reverse_continue_watchpoint(self): self.reverse_continue_watchpoint_internal(async_mode=False) @skipIfRemote @skipIf(macos_version=["<", "15.0"]) - @skipIf(oslist=lldbplatformutil.getDarwinOSTriples(), archs=["x86_64"]) def test_reverse_continue_watchpoint_async(self): self.reverse_continue_watchpoint_internal(async_mode=True) @@ -63,13 +61,11 @@ class TestReverseContinueWatchpoints(ReverseTestBase): @skipIfRemote @skipIf(macos_version=["<", "15.0"]) - @skipIf(oslist=lldbplatformutil.getDarwinOSTriples(), archs=["x86_64"]) def test_reverse_continue_skip_watchpoint(self): self.reverse_continue_skip_watchpoint_internal(async_mode=False) @skipIfRemote @skipIf(macos_version=["<", "15.0"]) - @skipIf(oslist=lldbplatformutil.getDarwinOSTriples(), archs=["x86_64"]) def test_reverse_continue_skip_watchpoint_async(self): self.reverse_continue_skip_watchpoint_internal(async_mode=True)