Skip to content

Set breakpoints in libsystem_kernel. - #52

Merged
Mic92 merged 3 commits into
Mic92:mainfrom
bwelling:breakpoint
May 22, 2026
Merged

Set breakpoints in libsystem_kernel.#52
Mic92 merged 3 commits into
Mic92:mainfrom
bwelling:breakpoint

Conversation

@bwelling

@bwelling bwelling commented Mar 3, 2026

Copy link
Copy Markdown
Contributor

Explicitly specify the "libsystem_kernel.dylib" module when setting breakpoints. Without this, setting breakpoints by name for each syscall will end up creating a breakpoint for any method with the same name as the syscall, which can be pretty common.

For example, in a C++ program I was testing, the runtimes were:
no strace - 0.1 seconds
strace with this patch - 20 seconds
strace without this patch - 250 seconds

This was because there were thousands of calls to a method named link(), which was not the link(2) syscall.

@Mic92
Mic92 enabled auto-merge May 22, 2026 16:21
@Mic92

Mic92 commented May 22, 2026

Copy link
Copy Markdown
Owner

Yeah that sounds useful.

@Mic92
Mic92 force-pushed the breakpoint branch 2 times, most recently from d8031fa to c59aed1 Compare May 22, 2026 16:35
Searching every loaded module for breakpoints is slow. The syscall
wrappers all live in a handful of system dylibs (libsystem_kernel,
libsystem_c, libsystem_pthread, ...), so restrict the search to those.
@Mic92
Mic92 merged commit 39b5620 into Mic92:main May 22, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants