summaryrefslogtreecommitdiff
path: root/indra/llcrashlogger/llcrashlogger.cpp
diff options
context:
space:
mode:
authorbrad kittenbrink <brad@lindenlab.com>2010-05-27 15:40:16 -0700
committerbrad kittenbrink <brad@lindenlab.com>2010-05-27 15:40:16 -0700
commitd9052212b5c575e31ddfe358c228e0ba9a7403ed (patch)
tree1670d0c29894ff18f8a48dcfab99877bddd11eaf /indra/llcrashlogger/llcrashlogger.cpp
parent0c7fafb70425853df26c703969e7a1892de2374e (diff)
parent4e8d423cc5fae86c8273df5e7ea583a9e0475711 (diff)
Merge of latest dessie/viewer-public with brad/viewer-public
Diffstat (limited to 'indra/llcrashlogger/llcrashlogger.cpp')
-rwxr-xr-xindra/llcrashlogger/llcrashlogger.cpp67
1 files changed, 34 insertions, 33 deletions
diff --git a/indra/llcrashlogger/llcrashlogger.cpp b/indra/llcrashlogger/llcrashlogger.cpp
index c1022c1195..aa2ea17af9 100755
--- a/indra/llcrashlogger/llcrashlogger.cpp
+++ b/indra/llcrashlogger/llcrashlogger.cpp
@@ -155,25 +155,6 @@ std::string getStartupStateFromLog(std::string& sllog)
void LLCrashLogger::gatherFiles()
{
-
- /*
- //TODO:This function needs to be reimplemented somewhere in here...
- if(!previous_crash && is_crash_log)
- {
- // Make sure the file isn't too old.
- double age = difftime(gLaunchTime, stat_data.st_mtimespec.tv_sec);
-
- // llinfos << "age is " << age << llendl;
-
- if(age > 60.0)
- {
- // The file was last modified more than 60 seconds before the crash reporter was launched. Assume it's stale.
- llwarns << "File " << mFilename << " is too old!" << llendl;
- return;
- }
- }
- */
-
updateApplication("Gathering logs...");
// Figure out the filename of the debug log
@@ -209,23 +190,22 @@ void LLCrashLogger::gatherFiles()
mFileMap["SettingsXml"] = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,"settings.xml");
}
-#if !LL_DARWIN
- if(mCrashInPreviousExec)
-#else
-#endif
- {
- // 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;
- }
+ // 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
- if(mDebugLog.has("CurrentSimHost"))
+ if(mDebugLog.has("CrashHostUrl"))
+ {
+ // Crash log receiver has been manually configured.
+ mCrashHost = mDebugLog["CrashHostUrl"].asString();
+ }
+ else if(mDebugLog.has("CurrentSimHost"))
{
mCrashHost = "https://";
mCrashHost += mDebugLog["CurrentSimHost"].asString();
@@ -247,7 +227,6 @@ void LLCrashLogger::gatherFiles()
mCrashInfo["DebugLog"] = mDebugLog;
mFileMap["StatsLog"] = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"stats.log");
- mFileMap["StackTrace"] = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"stack_trace.log");
updateApplication("Encoding files...");
@@ -274,6 +253,28 @@ void LLCrashLogger::gatherFiles()
mCrashInfo[(*itr).first] = rawstr_to_utf8(crash_info);
}
+
+ // Add minidump as binary.
+ std::string minidump_path = mDebugLog["MinidumpPath"];
+ if(minidump_path != "")
+ {
+ std::ifstream minidump_stream(minidump_path.c_str(), std::ios_base::in | std::ios_base::binary);
+ if(minidump_stream.is_open())
+ {
+ minidump_stream.seekg(0, std::ios::end);
+ size_t length = minidump_stream.tellg();
+ minidump_stream.seekg(0, std::ios::beg);
+
+ LLSD::Binary data;
+ data.resize(length);
+
+ minidump_stream.read(reinterpret_cast<char *>(&(data[0])),length);
+ minidump_stream.close();
+
+ mCrashInfo["Minidump"] = data;
+ }
+ }
+ mCrashInfo["DebugLog"].erase("MinidumpPath");
}
LLSD LLCrashLogger::constructPostData()