Little cleanup regarding crashlogger toggling.

This commit is contained in:
Shyotl
2012-01-28 22:02:10 -06:00
parent e7a20b04de
commit d9640ecc65
3 changed files with 21 additions and 6 deletions

View File

@@ -401,6 +401,18 @@ bool LLApp::isExiting()
return isQuitting() || isError();
}
void LLApp::disableCrashlogger()
{
// Disable Breakpad exception handler.
sDisableCrashlogger = TRUE;
}
// static
bool LLApp::isCrashloggerDisabled()
{
return (sDisableCrashlogger == TRUE);
}
#if !LL_WINDOWS
// static
U32 LLApp::getSigChildCount()
@@ -734,7 +746,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
llwarns << "Signal handler - Flagging error status and waiting for shutdown" << llendl;
}
if(LLApp::sDisableCrashlogger) //Don't gracefully handle any signals crash and core for a gdb post mortum
if (LLApp::isCrashloggerDisabled()) // Don't gracefully handle any signal, crash and core for a gdb post mortem
{
clear_signals();
llwarns << "Fatal signal received, not handling the crash here, passing back to operating system" << llendl;

View File

@@ -191,6 +191,11 @@ public:
//
virtual bool mainLoop() = 0; // Override for the application main loop. Needs to at least gracefully notice the QUITTING state and exit.
//
// Crash logging
//
void disableCrashlogger(); // Let the OS handle the crashes
static bool isCrashloggerDisabled(); // Get the here above set value
//
// Application status
@@ -214,9 +219,6 @@ public:
//
void setErrorHandler(LLAppErrorHandler handler);
void setSyncErrorHandler(LLAppErrorHandler handler);
static BOOL sDisableCrashlogger; // Let the OS handle crashes for us.
#if !LL_WINDOWS
//
// Child process handling (Unix only for now)
@@ -245,6 +247,7 @@ protected:
static void setStatus(EAppStatus status); // Use this to change the application status.
static EAppStatus sStatus; // Reflects current application status
static BOOL sErrorThreadRunning; // Set while the error thread is running
static BOOL sDisableCrashlogger; // Let the OS handle crashes for us.
#if !LL_WINDOWS
static LLAtomicU32* sSigChildCount; // Number of SIGCHLDs received.

View File

@@ -2145,7 +2145,7 @@ bool LLAppViewer::initConfiguration()
if(clp.hasOption("disablecrashlogger"))
{
llwarns << "Crashes will be handled by system, stack trace logs and crash logger are both disabled" <<llendl;
sDisableCrashlogger=TRUE;
LLAppViewer::instance()->disableCrashlogger();
}
// Handle initialization from settings.
@@ -2731,7 +2731,7 @@ void LLAppViewer::handleViewerCrash()
abort();
}
if(pApp->sDisableCrashlogger==TRUE)
if (LLApp::isCrashloggerDisabled())
{
abort();
}