From 28862ab53b9e532bf6ff789743d80b33af10f395 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 12 May 2021 14:21:27 -0400 Subject: SL-10297: Clean up a few merge glitches. --- indra/newview/llappviewer.cpp | 29 ++++++++++++----------------- indra/test/test.cpp | 22 ++++++++-------------- 2 files changed, 20 insertions(+), 31 deletions(-) (limited to 'indra') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index c44690ac25..7d7d41fe22 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2298,10 +2298,6 @@ void LLAppViewer::initLoggingAndGetLastDuration() { LL_WARNS("MarkerFile") << duration_log_msg << LL_ENDL; } - - // TBD - temporary location for fatal hook (should be above, but for now it logs...) - LL_DEBUGS("FatalHook") << "initial setting of default fatalhook" << LL_ENDL; - LLError::setFatalHook(fatalErrorHook); } bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key, @@ -2998,16 +2994,15 @@ bool LLAppViewer::initWindow() use_watchdog = bool(watchdog_enabled_setting); } - LL_INFOS("AppInit") << "watchdog" - << (use_watchdog ? " " : " NOT ") - << "enabled" - << " (setting = " << watchdog_enabled_setting << ")" - << LL_ENDL; + LL_INFOS("AppInit") << "watchdog" + << (use_watchdog ? " " : " NOT ") + << "enabled" + << " (setting = " << watchdog_enabled_setting << ")" + << LL_ENDL; if (use_watchdog) { - LLWatchdog::getInstance()->init( - [](){ LL_ERRS() << "Watchdog killer event" << LL_ENDL; }); + LLWatchdog::getInstance()->init(); } LLNotificationsUI::LLNotificationManager::getInstance(); @@ -3441,8 +3436,8 @@ void LLAppViewer::writeSystemInfo() gDebugInfo["CPUInfo"]["CPUSSE"] = gSysCPU.hasSSE(); gDebugInfo["CPUInfo"]["CPUSSE2"] = gSysCPU.hasSSE2(); - gDebugInfo["RAMInfo"]["Physical"] = (LLSD::Integer)(gSysMemory.getPhysicalMemoryKB().value()); - gDebugInfo["RAMInfo"]["Allocated"] = (LLSD::Integer)(gMemoryAllocated.valueInUnits()); + gDebugInfo["RAMInfo"]["Physical"] = LLSD::Integer(gSysMemory.getPhysicalMemoryKB().value()); + gDebugInfo["RAMInfo"]["Allocated"] = LLSD::Integer(gMemoryAllocated.valueInUnits()); gDebugInfo["OSInfo"] = LLOSInfo::instance().getOSStringSimple(); // The user is not logged on yet, but record the current grid choice login url @@ -3461,11 +3456,11 @@ void LLAppViewer::writeSystemInfo() // and can read this value from the debug_info.log. // If the crash is handled by LLAppViewer::handleViewerCrash, ie not a freeze, // then the value of "CrashNotHandled" will be set to true. - gDebugInfo["CrashNotHandled"] = (LLSD::Boolean)true; + gDebugInfo["CrashNotHandled"] = LLSD::Boolean(true); #else // LL_BUGSPLAT // "CrashNotHandled" is obsolete; it used (not very successsfully) // to try to distinguish crashes from freezes - the intent here to to avoid calling it a freeze - gDebugInfo["CrashNotHandled"] = (LLSD::Boolean)false; + gDebugInfo["CrashNotHandled"] = LLSD::Boolean(false); #endif // ! LL_BUGSPLAT // Insert crash host url (url to post crash log to) if configured. This insures @@ -3497,7 +3492,7 @@ void LLAppViewer::writeSystemInfo() gDebugInfo["SettingsFilename"] = gSavedSettings.getString("ClientSettingsFile"); gDebugInfo["ViewerExePath"] = gDirUtilp->getExecutablePathAndName(); gDebugInfo["CurrentPath"] = gDirUtilp->getCurPath(); - gDebugInfo["FirstLogin"] = (LLSD::Boolean) gAgent.isFirstLogin(); + gDebugInfo["FirstLogin"] = LLSD::Boolean(gAgent.isFirstLogin()); gDebugInfo["FirstRunThisInstall"] = gSavedSettings.getBOOL("FirstRunThisInstall"); gDebugInfo["StartupState"] = LLStartUp::getStartupStateString(); @@ -3627,7 +3622,7 @@ void LLAppViewer::handleViewerCrash() // The crash is being handled here so set this value to false. // Otherwise the crash logger will think this crash was a freeze. - gDebugInfo["Dynamic"]["CrashNotHandled"] = (LLSD::Boolean)false; + gDebugInfo["Dynamic"]["CrashNotHandled"] = LLSD::Boolean(false); //Write out the crash status file //Use marker file style setup, as that's the simplest, especially since diff --git a/indra/test/test.cpp b/indra/test/test.cpp index 571f502861..87c4a8d8a3 100644 --- a/indra/test/test.cpp +++ b/indra/test/test.cpp @@ -75,18 +75,7 @@ #include -LLError::ErrFatalHookResult wouldHaveCrashed(const std::string& message) -{ -#if LL_MSVC -#pragma warning (push) -#pragma warning (disable : 4702) // warning C4702: unreachable code -#endif - tut::fail("fatal error message: " + message); - return LLError::ERR_DO_NOT_CRASH; -#if LL_MSVC -#pragma warning (pop) -#endif -} +void wouldHaveCrashed(const std::string& message); namespace tut { @@ -157,7 +146,7 @@ public: mOldSettings(LLError::saveAndResetSettings()), mRecorder(new RecordToTempFile(pool)) { - LLError::setFatalHook(wouldHaveCrashed); + LLError::setFatalFunction(wouldHaveCrashed); LLError::setDefaultLevel(level); LLError::addRecorder(mRecorder); } @@ -523,6 +512,11 @@ void stream_groups(std::ostream& s, const char* app) } } +void wouldHaveCrashed(const std::string& message) +{ + tut::fail("llerrs message: " + message); +} + static LLTrace::ThreadRecorder* sMasterThreadRecorder = NULL; int main(int argc, char **argv) @@ -632,7 +626,7 @@ int main(int argc, char **argv) replayer.reset(new LLReplayLogReal(level, gAPRPoolp)); } } - LLError::setFatalHook(wouldHaveCrashed); + LLError::setFatalFunction(wouldHaveCrashed); std::string test_app_name(argv[0]); std::string test_log = test_app_name + ".log"; LLFile::remove(test_log); -- cgit v1.2.3