From d359dca06518d778c0f115afec8c759ca026de47 Mon Sep 17 00:00:00 2001
From: callum_linden <callum@lindenlab.com>
Date: Tue, 24 Oct 2017 14:28:43 -0700
Subject: [PATCH] painfully add in the path to the second life log file that we
 also send - painful because of string <--> wstring issues

---
 indra/llcommon/llapp.cpp | 26 +++++---------------------
 1 file changed, 5 insertions(+), 21 deletions(-)

diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp
index ea4a0fb59c4..6ea1700ea84 100644
--- a/indra/llcommon/llapp.cpp
+++ b/indra/llcommon/llapp.cpp
@@ -406,27 +406,11 @@ bool BugSplatExceptionCallback(unsigned int nCode, void* lpVal1, void* lpVal2)
 	{
 		case MDSCB_EXCEPTIONCODE:
 		{
-			EXCEPTION_RECORD *p = (EXCEPTION_RECORD *)lpVal1;
-			DWORD code = p ? p->ExceptionCode : 0;
-
-			// create some files in the %temp% directory and attach them
-			wchar_t cmdString[2 * MAX_PATH];
-			wchar_t filePath[MAX_PATH];
-			wchar_t tempPath[MAX_PATH];
-			GetTempPathW(MAX_PATH, tempPath);
-
-			wsprintf(filePath, L"%sfile1.txt", tempPath);
-			wsprintf(cmdString, L"echo Exception Code = 0x%08x > %s", code, filePath);
-			_wsystem(cmdString);
-			gBugSplatSender->sendAdditionalFile((const __wchar_t *)filePath);
-
-			wsprintf(filePath, L"%sfile2.txt", tempPath);
-			wchar_t buf[_MAX_PATH];
-			gBugSplatSender->getMinidumpPath((__wchar_t *)buf, _MAX_PATH);
-
-			wsprintf(cmdString, L"echo Crash reporting is so clutch!  minidump path = %s > %s", buf, filePath);
-			_wsystem(cmdString);
-			gBugSplatSender->sendAdditionalFile((const __wchar_t *)filePath);
+			// send the main viewer log file (Clearly a temporary hack since we don't have access to the gDir*** set of functions in newview
+			const std::string appdata = std::string(getenv("APPDATA"));
+			const std::string logfile = appdata + "\\SecondLife\\logs\\Secondlife.log";
+			const std::wstring wide_logfile(logfile.begin(), logfile.end());
+			gBugSplatSender->sendAdditionalFile((const __wchar_t *)wide_logfile.c_str());
 		}
 		break;
 	}
-- 
GitLab