[lldb/test] Fix BacktraceRecording path for Darwin embedded devices (NFC) (#193436)
rdar://172707080 Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
This commit is contained in:
committed by
GitHub
parent
f1c4db6aef
commit
fb3ab402c1
@@ -185,7 +185,7 @@ def findMainThreadCheckerDylib():
|
||||
return ""
|
||||
|
||||
if getPlatform() in lldbplatform.translate(lldbplatform.darwin_embedded):
|
||||
if getDarwinEmbeddedKernelVersion() >= 26:
|
||||
if getDarwinEmbeddedKernelVersion() > 25:
|
||||
return "/usr/lib/libMainThreadChecker.dylib"
|
||||
return "/Developer/usr/lib/libMainThreadChecker.dylib"
|
||||
|
||||
@@ -203,6 +203,8 @@ def findBacktraceRecordingDylib():
|
||||
return ""
|
||||
|
||||
if getPlatform() in lldbplatform.translate(lldbplatform.darwin_embedded):
|
||||
if getDarwinEmbeddedKernelVersion() > 25:
|
||||
return "/usr/lib/libBacktraceRecording.dylib"
|
||||
return "/Developer/usr/lib/libBacktraceRecording.dylib"
|
||||
|
||||
with os.popen("xcode-select -p") as output:
|
||||
|
||||
@@ -4,6 +4,7 @@ import os
|
||||
import lldb
|
||||
from lldbsuite.test.decorators import *
|
||||
from lldbsuite.test.lldbtest import *
|
||||
from lldbsuite.test.lldbplatformutil import findBacktraceRecordingDylib
|
||||
from lldbsuite.test import lldbutil
|
||||
|
||||
|
||||
@@ -21,25 +22,10 @@ class TestExtendedBacktraceAPI(TestBase):
|
||||
self.build()
|
||||
exe = self.getBuildArtifact("a.out")
|
||||
|
||||
# Get Xcode developer directory path.
|
||||
# Try DEVELOPER_DIR environment variable first, then fall back to xcode-select.
|
||||
xcode_dev_path = os.environ.get("DEVELOPER_DIR")
|
||||
|
||||
if not xcode_dev_path:
|
||||
import subprocess
|
||||
|
||||
xcode_dev_path = (
|
||||
subprocess.check_output(["xcode-select", "-p"]).decode("utf-8").strip()
|
||||
)
|
||||
|
||||
# Check for libBacktraceRecording.dylib.
|
||||
libbtr_path = os.path.join(
|
||||
xcode_dev_path, "usr/lib/libBacktraceRecording.dylib"
|
||||
)
|
||||
|
||||
libbtr_path = findBacktraceRecordingDylib()
|
||||
self.assertTrue(
|
||||
os.path.isfile(libbtr_path),
|
||||
f"libBacktraceRecording.dylib is not present at {libbtr_path}",
|
||||
libbtr_path,
|
||||
"libBacktraceRecording.dylib was not found on the system.",
|
||||
)
|
||||
|
||||
self.assertTrue(
|
||||
|
||||
@@ -4,6 +4,7 @@ import os
|
||||
import lldb
|
||||
from lldbsuite.test.decorators import *
|
||||
from lldbsuite.test.lldbtest import *
|
||||
from lldbsuite.test.lldbplatformutil import findBacktraceRecordingDylib
|
||||
from lldbsuite.test import lldbutil
|
||||
|
||||
|
||||
@@ -307,11 +308,10 @@ class TestQueues(TestBase):
|
||||
"""Test queues inspection SB APIs with libBacktraceRecording present."""
|
||||
exe = self.getBuildArtifact("a.out")
|
||||
|
||||
if not os.path.isfile(
|
||||
"/Applications/Xcode.app/Contents/Developer/usr/lib/libBacktraceRecording.dylib"
|
||||
):
|
||||
libbtr_path = findBacktraceRecordingDylib()
|
||||
if not libbtr_path:
|
||||
self.skipTest(
|
||||
"Skipped because libBacktraceRecording.dylib was present on the system."
|
||||
"Skipped because libBacktraceRecording.dylib was not found on the system."
|
||||
)
|
||||
|
||||
if not os.path.isfile("/usr/lib/system/introspection/libdispatch.dylib"):
|
||||
@@ -327,18 +327,6 @@ class TestQueues(TestBase):
|
||||
break1 = target.BreakpointCreateByName("stopper", "a.out")
|
||||
self.assertTrue(break1, VALID_BREAKPOINT)
|
||||
|
||||
# Now launch the process, and do not stop at entry point.
|
||||
libbtr_path = "/Applications/Xcode.app/Contents/Developer/usr/lib/libBacktraceRecording.dylib"
|
||||
if self.getArchitecture() in [
|
||||
"arm",
|
||||
"arm64",
|
||||
"arm64e",
|
||||
"arm64_32",
|
||||
"armv7",
|
||||
"armv7k",
|
||||
]:
|
||||
libbtr_path = "/Developer/usr/lib/libBacktraceRecording.dylib"
|
||||
|
||||
process = target.LaunchSimple(
|
||||
[],
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user