-
Notifications
You must be signed in to change notification settings - Fork 14k
[lldb] Ignore registers that the debugserver fails to read #132122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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.
@llvm/pr-subscribers-lldb Author: Robert O'Callahan (rocallahan) ChangesOn 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. Full diff: https://github.com/llvm/llvm-project/pull/132122.diff 3 Files Affected:
diff --git a/lldb/packages/Python/lldbsuite/test/lldbreverse.py b/lldb/packages/Python/lldbsuite/test/lldbreverse.py
index a42cc7cac15d3..d9a8daba3772d 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbreverse.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbreverse.py
@@ -300,7 +300,10 @@ def capture_snapshot(self):
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 1ff645b94d2eb..a159e0f716dbe 100644
--- a/lldb/test/API/functionalities/reverse-execution/TestReverseContinueBreakpoints.py
+++ b/lldb/test/API/functionalities/reverse-execution/TestReverseContinueBreakpoints.py
@@ -11,13 +11,11 @@
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 @@ def reverse_continue_internal(self, async_mode):
@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 @@ def reverse_continue_breakpoint_internal(self, async_mode):
@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 @@ def reverse_continue_skip_breakpoint_internal(self, async_mode):
@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 519f1cb23604d..c942f2a0386e5 100644
--- a/lldb/test/API/functionalities/reverse-execution/TestReverseContinueWatchpoints.py
+++ b/lldb/test/API/functionalities/reverse-execution/TestReverseContinueWatchpoints.py
@@ -11,13 +11,11 @@
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 @@ def reverse_continue_watchpoint_internal(self, async_mode):
@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)
|
@labath can someone merge this for me? Thanks! |
FWIW this is a change from September, #108663 , where debugserver can report DS, ES, SS, GSbase contents when the kernel provides them. But they are most often not available, so reads will fail. |
The x86-specific issue has been fixed with llvm#132122. Watchpoint tests fail on aarch64 with macos<15.0 due to a kernel bug.
The x86-specific issue has been fixed with #132122. Watchpoint tests fail on aarch64 with macos<15.0 due to a kernel bug.
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.