Google Breakpad を Windows Qt プロジェクトに統合しようとしています。
MinGW(w64 ではない)でコンパイルすると、Breakpad は期待どおりに動作し、アプリがクラッシュすると Minidump ファイルが生成されます。
ただし、MinGW-w64 で同じコードをコンパイルすると、アプリは Minidump ファイルなしで科学的にクラッシュします。
この問題は、簡単なテスト プログラムで再現できます。
#include "breakpad/client/windows/handler/exception_handler.h"
#include "breakpad/client/windows/sender/crash_report_sender.h"
void test()
{
// install the exception handler
std::wstring prod(L"some prod");
std::wstring ver(L"some ver");
std::wstring subver(L"some subver");
static google_breakpad::CustomInfoEntry custom_entries[] = {
google_breakpad::CustomInfoEntry(L"prod", prod.c_str()),
google_breakpad::CustomInfoEntry(L"ver", ver.c_str()),
google_breakpad::CustomInfoEntry(L"subver", subver.c_str()),
};
static google_breakpad::CustomClientInfo custom_info = {custom_entries, 3};
std::wstring path(L"some/path/to/dump/file");
auto handler = new google_breakpad::ExceptionHandler(path, nullptr, nullptr, nullptr, google_breakpad::ExceptionHandler::HANDLER_ALL, MiniDumpNormal, (const wchar_t *)nullptr, &custom_info);
// feed crash
*(int*)0x1 = 1;
}
int main()
{
test();
return 0;
}
コードは、Breakpad ソース ツリーと共にコンパイルされます (バイナリ ライブラリとしてではありません)。
例外ハンドラが呼び出されていないようです。の ctor に登録すると、コールバック関数が呼び出されませんgoogle_breakpad::ExceptionHandler
。
では、なぜそれが起こるのですか?Breakpad を MinGW-w64 でコンパイルされたプロジェクトに統合することは可能ですか?