Answer the question
In order to leave comments, you need to log in
What are the libraries for catching exceptions and throwing them?
Good day!
I've already searched for the answer, but I couldn't find it.
I am using qt.
I need to make sure that all program crashes, i.e. exceptions were caught and an error message was displayed.
I did this: I catch ordinary exceptions using catch (). I catch exceptions like sigsegv with
SetUnhandledExceptionFilter() on Windows and sigaction() on Linux. I also added std::set_terminate(). After that, backtrace is displayed, if it is Windows, a mini-dump is created and an error with a description is displayed on the screen.
But there are several problems:
1. If an error occurs in another thread (and they only happen there for me), then the program, firstly, does not wait for the "ok" button in the error message to be pressed and closes, and secondly, after closing, the thread remains to work, and even QProcess::startDetached("taskkill ...") does not help
2. Now the most important thing. How to get the location where the error occurred? With the help of a minidump, you can only get it if the program is compiled in debug mode and if the error occurred directly in the program code, but if I passed the wrong pointer to the qt function, then I will get the place in this function, and not the place where it was called .
3. To get a normal backtrace and error location, I need to compile the program into debug, but then it, together with all the dlls, will weigh 500 mb.
4. std::set_terminate() is set for only one thread. How to install for everyone?
How to implement all this? I googled crashrpt, but I have mingw and it is not cross-platform. I also found Google breakpad and its adaptation for qt ( https://github.com/dschmidt/libcrashreporter-qt), but it doesn't say how to implement it in your project. What libraries can be used for this?
Thanks in advance!
Answer the question
In order to leave comments, you need to log in
In general, the library is google breakpad.
You need to collect it first. And here's how I did it:
First you need to put this (lss library) into the folder folder_with_brickpad\src\third_party https://yadi.sk/d/BmWlgUmx3SHqka
On Linux I just downloaded it completely , after which I did it in the root folder./ configure && make. After that, the .a file will be in folder_c_breakpad\src\client\linux\libbreakpad_client.a
On Windows, I created this .pro file in the breakpad root folder and compiled it:
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question