Skip to content

Commit 1988c27

Browse files
committed
[lldb] [NFC] Update TestEarlyProcessLaunch to work on macOS 15
This test sets a breakpoint on malloc, as a way to stop early in dyld's setting up code, before the system libraries are initialized so we can confirm that we don't fetch the Objective-C class table before it's initialized. In macOS 15 (macOS Sonoma), dyld doesn't call malloc any longer, so this heuristic/trick isn't working. It does call other things called *alloc though, so I'm changing this to use a regex breakpoint on that, to keep the test working.
1 parent 6c8ff4c commit 1988c27

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lldb/test/API/macosx/early-process-launch/TestEarlyProcessLaunch.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Test that we don't read objc class tables early in process startup."""
22

3-
43
import time
54
import lldb
65
from lldbsuite.test.decorators import *
@@ -30,7 +29,14 @@ def test_early_process_launch(self):
3029
###
3130
### Use the types logging to detect the difference.
3231

33-
target, process, _, bkpt = lldbutil.run_to_name_breakpoint(self, "malloc")
32+
exe = self.getBuildArtifact("a.out")
33+
target = self.dbg.CreateTarget(exe)
34+
self.assertTrue(target.IsValid())
35+
bkpt = target.BreakpointCreateByRegex("alloc", None)
36+
self.assertTrue(bkpt.IsValid())
37+
(target, process, thread, bkpt) = lldbutil.run_to_breakpoint_do_run(
38+
self, target, bkpt
39+
)
3440

3541
target.DisableAllBreakpoints()
3642
target.BreakpointCreateByName("main")

0 commit comments

Comments
 (0)