Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

lldb break upon SIGSEGV

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.

like image 839
qdot Avatar asked Oct 23 '14 13:10

qdot


People also ask

How to set break point in LLDB?

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 )

What is LLDB and GDB?

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.

What is LLDB Linux?

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.


1 Answers

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

like image 140
VivienG Avatar answered Sep 23 '22 10:09

VivienG