Integrate Crashpad crash handler into CApplication

Crash handler launches an external crash handler executable called
swift_crashpad_handler. It monitores the parent process and produces
a local dump in case of a crash.
For release builds, the dump is also uploaded to a crash report server.

refs #490
This commit is contained in:
Roland Winklmeier
2016-07-27 13:35:13 +02:00
parent 4c82009ac1
commit e47aec223e
7 changed files with 91 additions and 2 deletions

View File

@@ -37,6 +37,10 @@
#include "blackmisc/statusmessage.h"
#include "blackmisc/statusmessagelist.h"
#if defined(Q_CC_MSVC) || defined(Q_OS_OSX) // Crashpad only supported on MSVC and MacOS/X
#define BLACK_USE_CRASHPAD
#endif
class QHttpMultiPart;
class QNetworkReply;
class QNetworkRequest;
@@ -47,6 +51,12 @@ namespace BlackMisc
class CLogCategoryList;
}
namespace crashpad
{
class CrashpadClient;
class CrashReportDatabase;
}
namespace BlackCore
{
class CCoreFacade;
@@ -402,6 +412,8 @@ namespace BlackCore
//! Async. start when setup is loaded
bool asyncWebAndContextStart();
void initCrashHandler();
QScopedPointer<CCoreFacade> m_coreFacade; //!< core facade if any
QScopedPointer<CSetupReader> m_setupReader; //!< setup reader
QScopedPointer<CWebDataServices> m_webDataServices; //!< web data services
@@ -422,6 +434,8 @@ namespace BlackCore
bool m_unitTest = false; //!< is UNIT test
bool m_autoSaveSettings = true;//!< automatically saving all settings
std::unique_ptr<crashpad::CrashpadClient> m_crashpadClient;
std::unique_ptr<crashpad::CrashReportDatabase> m_crashReportDatabase;
};
} // namespace