Coming from the Linux/gdb world, the gdb by default interrupts the execution of the program upon detecting a SEGV, before the default handler cleans the process up.
How can lldb do the similar trick? Currently the process just exits, making it impossible to query the backtrace etc.
Edit: proccess handle -p true -n true -s true
attempted - with no result :(
(lldb) process handle -p true -n true -s true SIGSEGV
NAME PASS STOP NOTIFY
========== ===== ===== ======
SIGSEGV true true true
(lldb) run
Process 97630 launched: '/Volumes/My Finder Extensions 1/My_Daemon.app/Contents/PlugIns/My_ShellExt.appex/Contents/MacOS/My_ShellExt' (x86_64)
Process 97630 exited with status = 0 (0x00000000) Terminated due to signal 9
Edit: more information:
(lldb) bt all
error: invalid thread
I suspect lldb
does not play nice with corrupted stacks - I'm trying to track down a problem involving a _NSExtensionMain
entry point, or something down the line from there.
In lldb you can set breakpoints by typing either break or b followed by information on where you want the program to pause. After the b command, you can put either: a function name (e.g., b my_subroutine ) a line number (e.g., b 12 )
GDB is part of the GNU framework, and was created to work alongside of g++ , which is the GNU C++ compiler. LLDB is part of the LLVM framework, and was created to work alongside of clang++ , which is the LLVM C++ compiler. Ideally, you would use the debugger of the same framework that the compiler is part of.
LLDB is a next generation, high-performance debugger. It is built as a set of reusable components which highly leverage existing libraries in the larger LLVM Project, such as the Clang expression parser and LLVM disassembler.
you should type process handle SIGSEGV --notify true --pass true --stop true
on lldb according to this.
(lldb)process handle SIGSEGV --notify true --pass true --stop true
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