This is the Clang version of:
- Make gdb quit automatically on successful termination?
- How to have gdb exit if program succeeds, break if program crashes?
Running my application many times, programmatically, over a large number of possible inputs, I've occasionally encountered a segmentation fault.
I'd like each test invocation to be run under lldb
so that I can get a backtrace for further debugging. If an invocation exits without a crash, I'd like lldb
to automatically quit so that the test harness progresses to the next iteration. This way I can set the whole thing off over lunchtime and only have the suite interrupted when something crashes.
Bonus points for having lldb
auto-quit in all cases, but first print a backtrace if the program crashed.
I'm currently able to automate at least the initial run
command:
lldb -o run -f $CMD -- $ARGS