From 7abecb48babe6a6f09bf6692ba55076546cfced9 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Mon, 1 Dec 2008 17:39:58 -0600 Subject: Second Life viewer sources 1.22.0-RC --- linden/indra/llcrashlogger/llcrashlogger.cpp | 38 ++++++++++------------------ 1 file changed, 13 insertions(+), 25 deletions(-) (limited to 'linden/indra/llcrashlogger') diff --git a/linden/indra/llcrashlogger/llcrashlogger.cpp b/linden/indra/llcrashlogger/llcrashlogger.cpp index 77274b0..3abbb2d 100755 --- a/linden/indra/llcrashlogger/llcrashlogger.cpp +++ b/linden/indra/llcrashlogger/llcrashlogger.cpp @@ -154,6 +154,9 @@ void LLCrashLogger::gatherFiles() if (debug_log_file.is_open()) { LLSDSerialize::fromXML(mDebugLog, debug_log_file); + + mCrashInPreviousExec = mDebugLog["CrashNotHandled"].asBoolean(); + mFileMap["SecondLifeLog"] = mDebugLog["SLLog"].asString(); mFileMap["SettingsXml"] = mDebugLog["SettingsFilename"].asString(); if(mDebugLog.has("CAFilename")) @@ -176,6 +179,16 @@ void LLCrashLogger::gatherFiles() mFileMap["SettingsXml"] = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,"settings.xml"); } + if(mCrashInPreviousExec) + { + // Replace the log file ext with .old, since the + // instance that launched this process has overwritten + // SecondLife.log + std::string log_filename = mFileMap["SecondLifeLog"]; + log_filename.replace(log_filename.size() - 4, 4, ".old"); + mFileMap["SecondLifeLog"] = log_filename; + } + gatherPlatformSpecificFiles(); //Use the debug log to reconstruct the URL to send the crash report to @@ -229,12 +242,6 @@ void LLCrashLogger::gatherFiles() LLSD LLCrashLogger::constructPostData() { LLSD ret; - - if(mCrashInPreviousExec) - { - mCrashInfo["CrashInPreviousExecution"] = "Y"; - } - return mCrashInfo; } @@ -338,25 +345,6 @@ bool LLCrashLogger::init() llinfos << "Loading crash behavior setting" << llendl; mCrashBehavior = loadCrashBehaviorSetting(); - //Run through command line options - if(getOption("previous").isDefined()) - { - llinfos << "Previous execution did not remove SecondLife.exec_marker" << llendl; - mCrashInPreviousExec = TRUE; - } - - if(getOption("dialog").isDefined()) - { - llinfos << "Show the user dialog" << llendl; - mCrashBehavior = CRASH_BEHAVIOR_ASK; - } - - LLSD name = getOption("name"); - if(name.isDefined()) - { - mProductName = name.asString(); - } - // If user doesn't want to send, bail out if (mCrashBehavior == CRASH_BEHAVIOR_NEVER_SEND) { -- cgit v1.1 From 6156baad67c744ed03ea47798bfeb8a77698efc6 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Sun, 11 Jan 2009 16:10:10 -0600 Subject: Second Life viewer sources 1.22.4-RC --- linden/indra/llcrashlogger/llcrashlogger.cpp | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'linden/indra/llcrashlogger') diff --git a/linden/indra/llcrashlogger/llcrashlogger.cpp b/linden/indra/llcrashlogger/llcrashlogger.cpp index 3abbb2d..9672af3 100755 --- a/linden/indra/llcrashlogger/llcrashlogger.cpp +++ b/linden/indra/llcrashlogger/llcrashlogger.cpp @@ -123,6 +123,33 @@ void trimSLLog(std::string& sllog) } } +std::string getStartupStateFromLog(std::string& sllog) +{ + std::string startup_state = "STATE_FIRST"; + std::string startup_token = "Startup state changing from "; + + int index = sllog.rfind(startup_token); + if (index < 0 || index + startup_token.length() > sllog.length()) { + return startup_state; + } + + // find new line + char cur_char = sllog[index + startup_token.length()]; + std::string::size_type newline_loc = index + startup_token.length(); + while(cur_char != '\n' && newline_loc < sllog.length()) + { + newline_loc++; + cur_char = sllog[newline_loc]; + } + + // get substring and find location of " to " + std::string state_line = sllog.substr(index, newline_loc - index); + std::string::size_type state_index = state_line.find(" to "); + startup_state = state_line.substr(state_index + 4, state_line.length() - state_index - 4); + + return startup_state; +} + void LLCrashLogger::gatherFiles() { @@ -232,6 +259,10 @@ void LLCrashLogger::gatherFiles() std::string crash_info = s.str(); if(itr->first == "SecondLifeLog") { + if(!mCrashInfo["DebugLog"].has("StartupState")) + { + mCrashInfo["DebugLog"]["StartupState"] = getStartupStateFromLog(crash_info); + } trimSLLog(crash_info); } -- cgit v1.1 From a87e38229921b48c32187c672a942516722f1b52 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Sun, 11 Jan 2009 16:10:39 -0600 Subject: Second Life viewer sources 1.22.5-RC --- linden/indra/llcrashlogger/llcrashlogger.cpp | 2 +- linden/indra/llcrashlogger/llcrashlogger.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'linden/indra/llcrashlogger') diff --git a/linden/indra/llcrashlogger/llcrashlogger.cpp b/linden/indra/llcrashlogger/llcrashlogger.cpp index 9672af3..095cf8a 100755 --- a/linden/indra/llcrashlogger/llcrashlogger.cpp +++ b/linden/indra/llcrashlogger/llcrashlogger.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2003&license=viewergpl$ * -* Copyright (c) 2003-2008, Linden Research, Inc. +* Copyright (c) 2003-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/linden/indra/llcrashlogger/llcrashlogger.h b/linden/indra/llcrashlogger/llcrashlogger.h index f8f7de7..9faaa76 100755 --- a/linden/indra/llcrashlogger/llcrashlogger.h +++ b/linden/indra/llcrashlogger/llcrashlogger.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2003&license=viewergpl$ * -* Copyright (c) 2003-2008, Linden Research, Inc. +* Copyright (c) 2003-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab -- cgit v1.1