From a923d54bef9755b3ef3ea7868ed943bb0371f56e Mon Sep 17 00:00:00 2001
From: Rye Mutt <rye@alchemyviewer.org>
Date: Tue, 1 Oct 2019 18:15:22 -0400
Subject: [PATCH] A few more tweaks to crash reporting

---
 indra/newview/llappviewer.cpp      | 8 +++++++-
 indra/newview/llappviewerwin32.cpp | 2 ++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 943db853ee..e858ec0f0c 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -722,10 +722,12 @@ LLAppViewer::LLAppViewer()
 	// init() call, which will overwrite the static_debug_info.log file for
 	// THIS run. So setDebugFileNames() early.
 
+#if !defined(USE_CRASHPAD)
 	// write dump files to a per-run dump directory to avoid multiple viewer issues.
 	std::string logdir = gDirUtilp->getExpandedFilename(LL_PATH_DUMP, "");
 
 	setDebugFileNames(logdir);
+#endif
 }
 
 LLAppViewer::~LLAppViewer()
@@ -3064,6 +3066,7 @@ bool LLAppViewer::initWindow()
 
 void LLAppViewer::writeDebugInfo(bool isStatic)
 {
+#if !defined(USE_CRASHPAD)
     //Try to do the minimum when writing data during a crash.
     std::string* debug_filename;
     debug_filename = ( isStatic
@@ -3075,6 +3078,7 @@ void LLAppViewer::writeDebugInfo(bool isStatic)
 
     isStatic ?  LLSDSerialize::toPrettyXML(gDebugInfo, out_file)
              :  LLSDSerialize::toPrettyXML(gDebugInfo["Dynamic"], out_file);
+#endif
 }
 
 LLSD LLAppViewer::getViewerInfo() const
@@ -3405,7 +3409,7 @@ void LLAppViewer::writeSystemInfo()
         gDebugInfo["Dynamic"] = LLSD::emptyMap();
 
 #if LL_WINDOWS
-	gDebugInfo["SLLog"] = gDirUtilp->getExpandedFilename(LL_PATH_DUMP,"Alchemy.log");
+	gDebugInfo["SLLog"] = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"Alchemy.log");
 #else
     //Not ideal but sufficient for good reporting.
     gDebugInfo["SLLog"] = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"Alchemy.old");  //LLError::logFileName();
@@ -3848,10 +3852,12 @@ void LLAppViewer::removeMarkerFiles()
 
 void LLAppViewer::removeDumpDir()
 {
+#if !defined(USE_CRASHPAD)
     //Call this routine only on clean exit.  Crash reporter will clean up
     //its locking table for us.
     std::string dump_dir = gDirUtilp->getExpandedFilename(LL_PATH_DUMP, "");
     gDirUtilp->deleteDirAndContents(dump_dir);
+#endif
 }
 
 void LLAppViewer::forceQuit()
diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp
index 2b57491278..c787e744f6 100644
--- a/indra/newview/llappviewerwin32.cpp
+++ b/indra/newview/llappviewerwin32.cpp
@@ -237,7 +237,9 @@ int APIENTRY WINMAIN(HINSTANCE hInstance,
 	
 	gOldTerminateHandler = std::set_terminate(exceptionTerminateHandler);
 
+#if !defined(USE_CRASHPAD)
 	viewer_app_ptr->setErrorHandler(LLAppViewer::handleViewerCrash);
+#endif
 
 	// Set a debug info flag to indicate if multiple instances are running.
 	bool found_other_instance = !create_app_mutex();
-- 
GitLab