Does lldb have an equivalent to either of these gdb directives? I'm trying to make it follow a child process instead of the parent without having to do this manual process:
Some googling did not provide any insight.
Context: I'm using NSTask & injecting a dylib using dyld, and want to set breakpoints in my library without lots of pain. I'm pretty sure NSTask uses fork() internally.
It looks like follow-fork-mode was just recently merged into LLDB's main branch.
settings set target.process.follow-fork-mode child
This code is newer than the LLVM 13.0.0 release and isn't in the 13.0.1 release, so probably until there's a LLVM 14.0.0 release you would have to build it from source or perhaps use brew install --HEAD llvm
. For macOS you would also have to codesign lldb.
Eventually it should make it into a release version and then Apple's CLI tools too, although I do not know what the timeline on that is likely to be.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With