-
redirecting ASSERTs
I have setup my application so that if there is an uncaught exception or a segfault, it will call a special function that will save the data the user was working on and startup gdb to produce a stacktrace. This works fine, but sometimes the program dies because of an ASSERT (within the Qt library, I have none in my own code).
Is there a way to have assert cause a segfault or call one of my functions so the program can save user data and print a stacktrace before it dies?
-
Re: redirecting ASSERTs
install an event handler for SIGABRT
-
Re: redirecting ASSERTs
Q_ASSERT only works in debug mode so when you deploy the application to your users, Q_ASSERT will never cause an abort.