What are the library for catching exceptions and sending them?

Good day!
I have searched the answer but never found.
I use qt.
I need to do to all the program crashes, i.e., the exception is recorded and displayed error message.
I did the usual, I catch exception using catch(). Exceptions, such as sigsegv, I'm caught by the use of
SetUnhandledExceptionFilter() in Windows and sigaction() on Linux. Also I put some std::set_terminate(). And then displays a backtrace if it is Windows created a mini dump and displayed the error description.
But there are several problems:
1. If an error occurs in another thread (and I have them just there and happening), the program first does not wait for clicking "OK" in the error message and closes, and second, after the closing, the thread is cleared to work, and even QProcess::startDetached("taskkill ...") not helps
2. Now the most important. As to the place where the error occurred? With the help of a minidump can be obtained only in the case that the program skompilowany in debug mode and if the error occurred directly in program code, but if I passed to the function qt the wrong pointer, I will get a place in this function and not the place where it was called.
3. To get a normal vectras and the error location, I need to compile in debug the program, but then she, along with all the DLL will weigh 500 MB.
4. std::set_terminate() is set for only one thread. How to install for everyone?
How to implement all of this? I googled crashrpt, but I have mingw and it is not crossplatformed. I found Google breakpad and adaptatio under qt (https://github.com/dschmidt/libcrashreporter-qt), but there is not written how to implement it in your project. What libraries you can use for this?
Thanks in advance!
June 8th 19 at 17:15
1 answer
June 8th 19 at 17:17
Solution
In General, library - google breakpad.
You must first collect it. And that's how I did it:
First you need to throw in a folder papcastle\src\third_party here it is (library lss) https://yadi.sk/d/BmWlgUmx3SHqka
On Linux Just completely downloaded it, then in the root directory did ./configure && make. After that .and the file will be in папка_с_breakpad\src\client\linux\libbreakpad_client.a
On Windows, I have created here is such .pro file in the root folder breakpad and compiled it:
spoiler
TEMPLATE = lib
CONFIG += staticlib

INCLUDEPATH += $$PWD
INCLUDEPATH += $$PWD/src

# Windows
win32:HEADERS += $$PWD/src/common/windows/string_utils-inl.h
win32:HEADERS += $$PWD/src/common/windows/guid_string.h
win32:HEADERS += $$PWD/src/client/windows/handler/exception_handler.h
win32:HEADERS += $$PWD/src/client/windows/common/ipc_protocol.h
win32:HEADERS += $$PWD/src/google_breakpad/common/minidump_format.h
win32:HEADERS += $$PWD/src/google_breakpad/common/breakpad_types.h
win32:HEADERS += $$PWD/src/client/windows/crash_generation/crash_generation_client.h
win32:HEADERS += $$PWD/src/common/scoped_ptr.h
win32:SOURCES += $$PWD/src/client/windows/handler/exception_handler.cc
win32:SOURCES += $$PWD/src/common/windows/string_utils.cc
win32:SOURCES += $$PWD/src/common/windows/guid_string.cc
win32:SOURCES += $$PWD/src/client/windows/crash_generation/crash_generation_client.cc

after that, the root folder will appear .and file
Now it is necessary (.and the file) to connect (in qt's LIBS += path\name.a Pro file) and then connect is the only header file client/windows/sender/crash_report_sender.h for Windows and client/linux/sender/crash_report_sender.h and all. About what to do dalbke can be read here:
https://maxsavenkov.livejournal.com/189460.html for Windows
https://gist.github.com/byronwind/94c94ee00dc442c71638 for linux

Find more questions by tags C++Qt