[Lldb-commits] [lldb] 0869a69 - NFC test if rosetta debugserver exists before testing rosetta
Jason Molenda via lldb-commits
lldb-commits at lists.llvm.org
Tue Nov 15 14:35:09 PST 2022
Author: Jason Molenda
Date: 2022-11-15T14:35:02-08:00
New Revision: 0869a699173f6d92949153e5301e6cfadf33201c
URL: https://github.com/llvm/llvm-project/commit/0869a699173f6d92949153e5301e6cfadf33201c
DIFF: https://github.com/llvm/llvm-project/commit/0869a699173f6d92949153e5301e6cfadf33201c.diff
LOG: NFC test if rosetta debugserver exists before testing rosetta
A fresh install of macOS does not have Rosetta 2 installed by
default; the CI bots are often in this state, resulting in a
test failure. debugserver already hardcodes the filepath of
the Rosetta 2 debugserver; test if that file exists before
running the Rosetta test.
Added:
Modified:
lldb/test/API/macosx/rosetta/TestRosetta.py
Removed:
################################################################################
diff --git a/lldb/test/API/macosx/rosetta/TestRosetta.py b/lldb/test/API/macosx/rosetta/TestRosetta.py
index 8836db9db73dc..4146fc3dbe929 100644
--- a/lldb/test/API/macosx/rosetta/TestRosetta.py
+++ b/lldb/test/API/macosx/rosetta/TestRosetta.py
@@ -3,6 +3,7 @@
import lldbsuite.test.lldbutil as lldbutil
from lldbsuite.test.lldbtest import *
from lldbsuite.test.decorators import *
+from os.path import exists
def get_os_version():
@@ -16,6 +17,8 @@ def get_os_version():
return m.group(1)
return None
+def rosetta_debugserver_installed():
+ return exists("/Library/Apple/usr/libexec/oah/debugserver")
def has_rosetta_shared_cache(os_version):
if not os_version:
@@ -41,16 +44,17 @@ def test_rosetta(self):
self.build()
self.main_source_file = lldb.SBFileSpec("main.c")
- broadcaster = self.dbg.GetBroadcaster()
- listener = lldbutil.start_listening_from(
- broadcaster, lldb.SBDebugger.eBroadcastBitWarning)
+ if rosetta_debugserver_installed():
+ broadcaster = self.dbg.GetBroadcaster()
+ listener = lldbutil.start_listening_from(
+ broadcaster, lldb.SBDebugger.eBroadcastBitWarning)
- target, process, thread, bkpt = lldbutil.run_to_source_breakpoint(
- self, "Set a breakpoint here", self.main_source_file)
+ target, process, thread, bkpt = lldbutil.run_to_source_breakpoint(
+ self, "Set a breakpoint here", self.main_source_file)
- event = lldb.SBEvent()
- os_version = get_os_version()
- if not has_rosetta_shared_cache(os_version):
- self.assertTrue(listener.GetNextEvent(event))
- else:
- self.assertFalse(listener.GetNextEvent(event))
+ event = lldb.SBEvent()
+ os_version = get_os_version()
+ if not has_rosetta_shared_cache(os_version):
+ self.assertTrue(listener.GetNextEvent(event))
+ else:
+ self.assertFalse(listener.GetNextEvent(event))
More information about the lldb-commits
mailing list