From e711376cc75a51973291d1730467c0b6e3a74226 Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Wed, 5 Jun 2019 14:27:48 -0400
Subject: [PATCH] assorted cleanup

---
 indra/llcommon/llapp.cpp            |  5 +++++
 indra/newview/CMakeLists.txt        |  2 +-
 indra/newview/llappdelegate-objc.mm |  2 ++
 indra/newview/llappviewer.cpp       | 10 ++--------
 indra/newview/llappviewerwin32.cpp  |  3 +--
 indra/newview/llviewerwindow.cpp    |  3 ++-
 6 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp
index 421af3006e2..34c969437b7 100644
--- a/indra/llcommon/llapp.cpp
+++ b/indra/llcommon/llapp.cpp
@@ -526,7 +526,12 @@ void LLApp::setupErrorHandling(bool second_instance)
 #endif // LL_LINUX
 
 #endif // ! LL_WINDOWS
+
+#ifdef LL_BUGSPLAT
+    // do not start our own error thread
+#else // ! LL_BUGSPLAT
 	startErrorThread();
+#endif
 }
 
 void LLApp::startErrorThread()
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index bbfa8388274..fd520d2c6fd 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -1729,7 +1729,7 @@ endif (SDL_FOUND)
 
 if (USE_BUGSPLAT)
   set_property(TARGET ${VIEWER_BINARY_NAME}
-    PROPERTY COMPILE_DEFINITIONS "LL_BUGSPLAT")
+    PROPERTY COMPILE_DEFINITIONS "${BUGSPLAT_DEFINE}")
 endif (USE_BUGSPLAT)
 
 # add package files
diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm
index 47fde299c7e..30bfe1f4390 100644
--- a/indra/newview/llappdelegate-objc.mm
+++ b/indra/newview/llappdelegate-objc.mm
@@ -66,6 +66,7 @@
 	constructViewer();
 
 #if defined(LL_BUGSPLAT)
+    infos("bugsplat setup");
 	// Engage BugsplatStartupManager *before* calling initViewer() to handle
 	// any crashes during initialization.
 	// https://www.bugsplat.com/docs/platforms/os-x#initialization
@@ -74,6 +75,7 @@
 	[BugsplatStartupManager sharedManager].delegate = self;
 	[[BugsplatStartupManager sharedManager] start];
 #endif
+    infos("post-bugsplat setup");
 
 	frameTimer = nil;
 
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 0e97ed5a47e..35f9d7f4fd9 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -3386,9 +3386,8 @@ void LLAppViewer::writeSystemInfo()
 	gDebugInfo["CrashNotHandled"] = (LLSD::Boolean)true;
 #else // LL_BUGSPLAT
 	// "CrashNotHandled" is obsolete; it used (not very successsfully)
-    // to try to distinguish crashes from freezes
+    // to try to distinguish crashes from freezes - the intent here to to avoid calling it a freeze
 	gDebugInfo["CrashNotHandled"] = (LLSD::Boolean)false;
-    gDebugInfo["Dynamic"]["FatalMessage"] = LLError::getFatalMessage();
 #endif // ! LL_BUGSPLAT
 
 	// Insert crash host url (url to post crash log to) if configured. This insures
@@ -3617,7 +3616,7 @@ void LLAppViewer::handleViewerCrash()
 
 	if (LLWorld::instanceExists()) LLWorld::getInstance()->getInfo(gDebugInfo["Dynamic"]);
 
-	gDebugInfo["Dynamic"]["FatalMessage"] = LLError::getFatalMessage();
+	gDebugInfo["FatalMessage"] = LLError::getFatalMessage();
 
 	// Close the debug file
 	pApp->writeDebugInfo(false);  //false answers the isStatic question with the least overhead.
@@ -5476,11 +5475,6 @@ void LLAppViewer::pauseMainloopTimeout()
 
 void LLAppViewer::pingMainloopTimeout(const std::string& state, F32 secs)
 {
-//	if(!restoreErrorTrap())
-//	{
-//		LL_WARNS() << "!!!!!!!!!!!!! Its an error trap!!!!" << state << LL_ENDL;
-//	}
-
 	if(mMainloopTimeout)
 	{
 		if(secs < 0.0f)
diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp
index d208e135bbb..6a6cc225d40 100644
--- a/indra/newview/llappviewerwin32.cpp
+++ b/indra/newview/llappviewerwin32.cpp
@@ -802,8 +802,7 @@ bool LLAppViewerWin32::beingDebugged()
 
 bool LLAppViewerWin32::restoreErrorTrap()
 {	
-	return true;
-	//return LLWinDebug::checkExceptionHandler();
+	return false;
 }
 
 void LLAppViewerWin32::initCrashReporting(bool reportFreeze)
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index c214984e1d1..b0f5b550e6a 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1791,7 +1791,8 @@ LLViewerWindow::LLViewerWindow(const Params& p)
 	
 	if (!LLAppViewer::instance()->restoreErrorTrap())
 	{
-		LL_WARNS("Window") << " Someone took over my signal/exception handler (post createWindow)!" << LL_ENDL;
+        // this always happens, so downgrading it to INFO
+		LL_INFOS("Window") << " Someone took over my signal/exception handler (post createWindow; normal)" << LL_ENDL;
 	}
 
 	const bool do_not_enforce = false;
-- 
GitLab