From ce2cd00cc516dbff712956875d4565b8d26e44ca Mon Sep 17 00:00:00 2001
From: Aura Linden <aura@lindenlab.com>
Date: Wed, 4 Dec 2013 19:57:11 -0800
Subject: [PATCH] Removed debugging code.

---
 indra/llcommon/llapp.cpp                    |  9 +----
 indra/llcommon/llapp.h                      |  1 -
 indra/llcrashlogger/llcrashlogger.cpp       | 12 +-----
 indra/newview/llappviewer.cpp               |  6 +--
 indra/newview/llappviewerwin32.cpp          | 44 +--------------------
 indra/newview/llappviewerwin32.h            |  2 -
 indra/win_crash_logger/win_crash_logger.cpp | 29 +-------------
 7 files changed, 6 insertions(+), 97 deletions(-)

diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp
index d228f0d8303..b219f66a29a 100755
--- a/indra/llcommon/llapp.cpp
+++ b/indra/llcommon/llapp.cpp
@@ -72,8 +72,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *);
 
 #if LL_LINUX
 #include "google_breakpad/minidump_descriptor.h"
-//SPATTERS this is static in my other version not sure why I changed it review.
-bool unix_minidump_callback(const google_breakpad::MinidumpDescriptor& minidump_desc, 
+static bool unix_minidump_callback(const google_breakpad::MinidumpDescriptor& minidump_desc, 
                                    void* context, 
                                    bool succeeded);
 #else
@@ -328,7 +327,7 @@ void LLApp::setupErrorHandling()
 #if LL_WINDOWS
 
 #if LL_SEND_CRASH_REPORTS
-	EnableCrashingOnCrashes(); //SPATTERS review
+	EnableCrashingOnCrashes();
 
 	// This sets a callback to handle w32 signals to the console window.
 	// The viewer shouldn't be affected, sicne its a windowed app.
@@ -345,7 +344,6 @@ void LLApp::setupErrorHandling()
 		std::string ptmp = std::string(wpipe_name.begin(), wpipe_name.end());
 
 		::Sleep(3000);  //HACK hopefully a static wait won't blow up in my face before google fixes their implementation.
-std::cout << "SPATTERS getting here" << std::endl;
 
 		//HACK this for loop is ueless.  Breakpad dumbly returns success when the OOP handler isn't initialized.
 		for (int retries=0;retries<5;++retries)
@@ -441,7 +439,6 @@ std::cout << "SPATTERS getting here" << std::endl;
 			mDumpPath = "/tmp";
 		}
 		google_breakpad::MinidumpDescriptor desc(mDumpPath);
-	    //SPATTERS mExceptionHandler = new google_breakpad::ExceptionHandler(desc, 0, unix_minidump_callback, 0, true, 0);
 	    mExceptionHandler = new google_breakpad::ExceptionHandler(desc, NULL, unix_minidump_callback, NULL, true, -1);
 	}
 #endif
@@ -990,9 +987,7 @@ bool windows_post_minidump_callback(const wchar_t* dump_path,
 									MDRawAssertionInfo* assertion,
 									bool succeeded)
 {
-	llinfos << "SPATTERS got to here." << llendl;
 	char * path = LLApp::instance()->getMiniDumpFilename();
-	std::cout << "SPATTERS path is " << path << std::endl;
 	S32 remaining = LLApp::MAX_MINDUMP_PATH_LENGTH;
 	size_t bytesUsed;
 
diff --git a/indra/llcommon/llapp.h b/indra/llcommon/llapp.h
index f90e7228039..c86625b6ebd 100755
--- a/indra/llcommon/llapp.h
+++ b/indra/llcommon/llapp.h
@@ -27,7 +27,6 @@
 #ifndef LL_LLAPP_H
 #define LL_LLAPP_H
 
-//#define LL_SEND_CRASH_REPORTS 1 /*SPATTERS*/
 #include <map>
 #include "llrun.h"
 #include "llsd.h"
diff --git a/indra/llcrashlogger/llcrashlogger.cpp b/indra/llcrashlogger/llcrashlogger.cpp
index baff29e818c..15c15a449bc 100755
--- a/indra/llcrashlogger/llcrashlogger.cpp
+++ b/indra/llcrashlogger/llcrashlogger.cpp
@@ -46,8 +46,6 @@
 #include "llsdserialize.h"
 #include "llproxy.h"
  
-extern void flog(std::string msg); //SPATTERS
-
 LLPumpIO* gServicePump;
 BOOL gBreak = false;
 BOOL gSent = false;
@@ -168,9 +166,6 @@ bool LLCrashLogger::readMinidump(std::string minidump_path)
 {
 	size_t length=0;
 
-	flog("SPATTERS 1");
-	flog (minidump_path);
-
 	std::ifstream minidump_stream(minidump_path.c_str(), std::ios_base::in | std::ios_base::binary);
 	if(minidump_stream.is_open())
 	{
@@ -302,8 +297,6 @@ void LLCrashLogger::gatherFiles()
 	if (has_minidump)
 	{
 		minidump_path = mDebugLog["MinidumpPath"].asString();
-		flog ("SPATTERS minidump name is");
-		flog (minidump_path);
 	}
 
 	if (has_minidump)
@@ -315,7 +308,6 @@ void LLCrashLogger::gatherFiles()
     {
        //Look for a filename at least 30 characters long in the dump dir which contains the characters MDMP as the first 4 characters in the file.
         typedef std::vector<std::string> vec;
-    flog("Failed to read minidump.");
         std::string pathname = gDirUtilp->getExpandedFilename(LL_PATH_DUMP,"");
         vec file_vec = gDirUtilp->getFilesInDir(pathname);
         for(vec::const_iterator iter=file_vec.begin(); iter!=file_vec.end(); ++iter)
@@ -334,8 +326,6 @@ void LLCrashLogger::gatherFiles()
                         minidump_path = *iter;
                         has_minidump = readMinidump(minidump_path);
 						mDebugLog["MinidumpPath"] = fullname;
-						flog ("Picked up minidump on the rebound.");
-						flog (fullname);
                     }
                 }
             }
@@ -498,7 +488,7 @@ bool LLCrashLogger::sendCrashLogs()
                         {
                             //mCrashInfo["DebugLog"].erase("MinidumpPath");
 
-                            //SPATTERS mKeyMaster.cleanupProcess((*lock)["dumpdir"].asString());
+                            mKeyMaster.cleanupProcess((*lock)["dumpdir"].asString());
                         }
                     }
 				}
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index eaced99c136..307a02b5276 100755
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -3365,7 +3365,7 @@ void LLAppViewer::writeSystemInfo()
 //also didn't see fit to provide a simple query request across the pipe to get this name either.
 //Since we are putting our output in a runtime generated directory and we know the header data in
 //the dump format, we can however use the following hack to identify our file. 
-//SPATTERS TODO make this a member function.
+// TODO make this a member function.
 void getFileList()
 {
 	std::stringstream filenames;
@@ -3403,8 +3403,6 @@ void LLAppViewer::handleViewerCrash()
 
 	llinfos << "Last render pool type: " << LLPipeline::sCurRenderPoolType << llendl ;
 
-	std::cout << "SPATTERS I am here." << std::endl;
-
 	LLMemory::logMemoryInfo(true) ;
 
 	//print out recorded call stacks if there are any.
@@ -3509,7 +3507,6 @@ void LLAppViewer::handleViewerCrash()
 
 	char *minidump_file = pApp->getMiniDumpFilename();
 
-	std::cout << "SPATTERS minidump name is " << minidump_file << std::endl;
 	if(minidump_file && minidump_file[0] != 0)
 	{
 		gDebugInfo["Dynamic"]["MinidumpPath"] = minidump_file;
@@ -3517,7 +3514,6 @@ void LLAppViewer::handleViewerCrash()
 #ifdef LL_WINDOWS
 	getFileList();
 #endif
-	gDebugInfo["Dynamic"]["SPATTERS1"] = "Where my output?"; 
     gDebugInfo["Dynamic"]["CrashType"]="crash";
 	
 	if (gMessageSystem && gDirUtilp)
diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp
index c6152574c17..69461306313 100644
--- a/indra/newview/llappviewerwin32.cpp
+++ b/indra/newview/llappviewerwin32.cpp
@@ -269,13 +269,12 @@ int APIENTRY WINMAIN(HINSTANCE hInstance,
 
 	LLAppViewerWin32* viewer_app_ptr = new LLAppViewerWin32(lpCmdLine);
 	
-    // install unexpected exception handler SPATTERS test point
 	gOldTerminateHandler = std::set_terminate(exceptionTerminateHandler);
 
 	viewer_app_ptr->setErrorHandler(LLAppViewer::handleViewerCrash);
 
 #if LL_SEND_CRASH_REPORTS 
-	::SetUnhandledExceptionFilter(catchallCrashHandler);	//SPATTERS test point
+	::SetUnhandledExceptionFilter(catchallCrashHandler);
 #endif
 
 	// Set a debug info flag to indicate if multiple instances are running.
@@ -386,14 +385,6 @@ int APIENTRY WINMAIN(HINSTANCE hInstance,
 		hSession = 0;
 	}
 	
-	/* SPATTERS?
-    // Wait until child process exits.
-    WaitForSingleObject( mCrashReporterProcessInfo.hProcess, 30000 ); //Wait up to 30 seconds for crash report to finish up.
-
-    // Close process and thread handles. 
-    CloseHandle( mCrashReporterProcessInfo.hProcess );
-    CloseHandle( mCrashReporterProcessInfo.hThread );
-	*/
 	return 0;
 }
 
@@ -699,7 +690,6 @@ void LLAppViewerWin32::initCrashReporting(bool reportFreeze)
     std::string logdir = gDirUtilp->getExpandedFilename(LL_PATH_DUMP, "");
     std::string appname = gDirUtilp->getExecutableFilename();
 
-	std::cout << "SPATTERS in init" << std::endl;
 	S32 slen = logdir.length() -1;
 	S32 end = slen;
 	while (logdir.at(end) == '/' || logdir.at(end) == '\\') end--;
@@ -710,38 +700,6 @@ void LLAppViewerWin32::initCrashReporting(bool reportFreeze)
 	}
 	std::string arg_str = "\"" + exe_path + "\" -dumpdir \"" + logdir + "\" -procname \"" + appname + "\" -pid " + pid_str.str(); 
 	_spawnl(_P_NOWAIT, exe_path.c_str(), arg_str.c_str(), NULL);
-	  
-/*	STARTUPINFO         siStartupInfo;
-	
-	std::string arg_str =  "-dumpdir \"" + logdir + "\" -procname \"" + appname + "\" -pid " + pid_str.str(); 
-
-    memset(&siStartupInfo, 0, sizeof(siStartupInfo));
-    memset(&mCrashReporterProcessInfo, 0, sizeof(mCrashReporterProcessInfo));
-
-    siStartupInfo.cb = sizeof(siStartupInfo);
-
-	std::wstring exe_wstr;
-	exe_wstr.assign(exe_path.begin(), exe_path.end());
-
-	std::wstring arg_wstr;
-	arg_wstr.assign(arg_str.begin(), arg_str.end());
-
-    if(CreateProcess(&exe_wstr[0],     
-                     &arg_wstr[0],                 // Application arguments
-                     0,
-                     0,
-                     FALSE,
-                     CREATE_DEFAULT_ERROR_MODE,
-                     0,
-                     0,                              // Working directory
-                     &siStartupInfo,
-                     &mCrashReporterProcessInfo) == FALSE)
-      // Could not start application -> call 'GetLastError()'
-	{
-        //llinfos << "CreateProcess failed " << GetLastError() << llendl;
-        return;
-    }
-	*/
 }
 
 //virtual
diff --git a/indra/newview/llappviewerwin32.h b/indra/newview/llappviewerwin32.h
index 1fb255d7f17..fb37df1a2f0 100644
--- a/indra/newview/llappviewerwin32.h
+++ b/indra/newview/llappviewerwin32.h
@@ -55,8 +55,6 @@ class LLAppViewerWin32 : public LLAppViewer
 	virtual bool sendURLToOtherInstance(const std::string& url);
 
 	std::string generateSerialNumber();
-	PROCESS_INFORMATION mCrashReporterProcessInfo;
-
 
 	static const std::string sWindowClass;
 
diff --git a/indra/win_crash_logger/win_crash_logger.cpp b/indra/win_crash_logger/win_crash_logger.cpp
index ede81a406e9..0078559c243 100755
--- a/indra/win_crash_logger/win_crash_logger.cpp
+++ b/indra/win_crash_logger/win_crash_logger.cpp
@@ -30,33 +30,6 @@
 #include "llcrashloggerwindows.h"
 #include <iostream>
 
-//SPATTERS killme
-#include <iostream>
-#include <fstream>
-
-std::ofstream gCLOG; //SPATTERS for testing only remove ASAP.
-
-void flog (std::string msg)
-{
-    //Windows can't even write a goddamned file without fucking it up.
-    static bool first_time=true;
-
-    std::cout << "Init Crash Logger" << std::endl;
-    static std::string logname="C:\\Users\\Aura\\AppData\\Roaming\\SecondLife\\logs\\WinCrashLog.log";
-    if (first_time)
-	{
-        gCLOG.open(logname, std::fstream::out); //first time open for overwrite.
-        first_time = false;
-        gCLOG << "BEGINNING Windows Crash Report Log\n";
-	}
-	else
-        gCLOG.open(logname,  std::fstream::out | std::fstream::app);
-
-    gCLOG << msg << "\n";
-    gCLOG.close();
-}
-//END SPATTERS KILLME
-
 int APIENTRY WinMain(HINSTANCE hInstance,
                      HINSTANCE hPrevInstance,
                      LPSTR     lpCmdLine,
@@ -78,7 +51,7 @@ int APIENTRY WinMain(HINSTANCE hInstance,
 		llwarns << "Unable to initialize application." << llendl;
 		return 1;
 	}
-	flog("Hi there.");
+
 	app.processingLoop();
 	app.mainLoop();
 	app.cleanup();
-- 
GitLab