Linux; Crash reporting. Implement CRASH_BEHAVIOR_ASK with a simple FTLK choice dialog.
parent
98d2f30dff
commit
09fea3f2b2
|
|
@ -53,15 +53,13 @@ set(LIBRT_LIBRARY rt)
|
|||
|
||||
|
||||
target_link_libraries(linux-crash-logger
|
||||
${LLCOMMON_LIBRARIES}
|
||||
${BOOST_FIBER_LIBRARY}
|
||||
${BOOST_CONTEXT_LIBRARY}
|
||||
${UI_LIBRARIES}
|
||||
${CURL_LIBRARIES}
|
||||
${OPENSSL_LIBRARIES}
|
||||
${CRYPTO_LIBRARIES}
|
||||
${ZLIB_LIBRARIES}
|
||||
${LIBRT_LIBRARY}
|
||||
X11
|
||||
)
|
||||
|
||||
add_custom_target(linux-crash-logger-target ALL
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
#include <curl/curl.h>
|
||||
#include <FL/fl_ask.H>
|
||||
|
||||
/* Called via
|
||||
execl( gCrashLogger.c_str(), gCrashLogger.c_str(), descriptor.path(), gVersion.c_str(), gBugsplatDB.c_str(), nullptr );
|
||||
|
|
@ -48,7 +49,17 @@ int main(int argc, char **argv)
|
|||
std::string dmpFile{ argv[1] };
|
||||
std::string version{ argv[2] };
|
||||
std::string strDb{ argv[3] };
|
||||
std::string strAsk{ argv[4] };
|
||||
|
||||
if( strAsk == "ask" )
|
||||
{
|
||||
auto choice = fl_choice( "Firestorm has crashed, submit the minidump?", "No", "Yes", nullptr );
|
||||
if( choice == 0 )
|
||||
{
|
||||
std::cerr << "Abort send due to users choice" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
std::string url{ "https://" };
|
||||
url += strDb;
|
||||
|
|
|
|||
|
|
@ -144,11 +144,12 @@ LLAppViewerLinux::~LLAppViewerLinux()
|
|||
std::string gCrashLogger;
|
||||
std::string gVersion;
|
||||
std::string gBugsplatDB;
|
||||
std::string gCrashBehavior;
|
||||
|
||||
static bool dumpCallback(const google_breakpad::MinidumpDescriptor& descriptor, void* context, bool succeeded)
|
||||
{
|
||||
if( fork() == 0 )
|
||||
execl( gCrashLogger.c_str(), gCrashLogger.c_str(), descriptor.path(), gVersion.c_str(), gBugsplatDB.c_str(), nullptr );
|
||||
execl( gCrashLogger.c_str(), gCrashLogger.c_str(), descriptor.path(), gVersion.c_str(), gBugsplatDB.c_str(), gCrashBehavior.c_str(), nullptr );
|
||||
return succeeded;
|
||||
}
|
||||
|
||||
|
|
@ -187,12 +188,9 @@ void setupBreadpad()
|
|||
|
||||
LL_INFOS("BUGSPLAT") << "Initializing with crash logger: " << gCrashLogger << " database: " << gBugsplatDB << " version: " << gVersion << LL_ENDL;
|
||||
|
||||
google_breakpad::MinidumpDescriptor *descriptor = new google_breakpad::MinidumpDescriptor(
|
||||
gDirUtilp->getExpandedFilename(LL_PATH_DUMP, ""));
|
||||
google_breakpad::ExceptionHandler *eh = new google_breakpad::ExceptionHandler(*descriptor, NULL, dumpCallback, NULL,
|
||||
true, -1);
|
||||
google_breakpad::MinidumpDescriptor *descriptor = new google_breakpad::MinidumpDescriptor(gDirUtilp->getExpandedFilename(LL_PATH_DUMP, ""));
|
||||
google_breakpad::ExceptionHandler *eh = new google_breakpad::ExceptionHandler(*descriptor, NULL, dumpCallback, NULL, true, -1);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
bool LLAppViewerLinux::init()
|
||||
|
|
@ -208,8 +206,14 @@ bool LLAppViewerLinux::init()
|
|||
S32 nCrashSubmitBehavior = gCrashSettings.getS32("CrashSubmitBehavior");
|
||||
|
||||
// For the first version we just consider always send and create a nice dialog for CRASH_BEHAVIOR_ASK later.
|
||||
if (success && nCrashSubmitBehavior == CRASH_BEHAVIOR_ALWAYS_SEND)
|
||||
if (success && nCrashSubmitBehavior != CRASH_BEHAVIOR_NEVER_SEND )
|
||||
{
|
||||
if( nCrashSubmitBehavior == CRASH_BEHAVIOR_ASK )
|
||||
gCrashBehavior = "ask";
|
||||
else
|
||||
gCrashBehavior = "send";
|
||||
setupBreadpad();
|
||||
}
|
||||
#endif
|
||||
|
||||
return success;
|
||||
|
|
|
|||
Loading…
Reference in New Issue