diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2021-06-08 05:06:21 +0300 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2021-06-08 05:06:21 +0300 |
commit | 0a745b47880fb16b1db8cd3327377a383dbfe6a8 (patch) | |
tree | e96e11b0083858ce6f70d67f3ea818c13bc43b29 /indra/newview/llappviewerwin32.cpp | |
parent | 4cec2d689f9a7d1791f7ea3933cc1cdc59e972ab (diff) |
Revert "Merge branch 'DRTVWR-520-apple-notarization' into DRTVWR-540-maint"
This reverts commit 681298dd726b2d00910fe71646147fadd1aba980, reversing
changes made to 323f41f4892248762fc8505d8df17d70bd833cf3.
Diffstat (limited to 'indra/newview/llappviewerwin32.cpp')
-rw-r--r-- | indra/newview/llappviewerwin32.cpp | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index f0bede5321..9b1c0d1f8b 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -603,6 +603,9 @@ bool LLAppViewerWin32::init() #if ! defined(LL_BUGSPLAT) #pragma message("Building without BugSplat") + LLAppViewer* pApp = LLAppViewer::instance(); + pApp->initCrashReporting(); + #else // LL_BUGSPLAT #pragma message("Building with BugSplat") @@ -814,6 +817,57 @@ bool LLAppViewerWin32::restoreErrorTrap() //return LLWinDebug::checkExceptionHandler(); } +void LLAppViewerWin32::initCrashReporting(bool reportFreeze) +{ + if (isSecondInstance()) return; //BUG-5707 do not start another crash reporter for second instance. + + const char* logger_name = "win_crash_logger.exe"; + std::string exe_path = gDirUtilp->getExecutableDir(); + exe_path += gDirUtilp->getDirDelimiter(); + exe_path += logger_name; + + std::string logdir = gDirUtilp->getExpandedFilename(LL_PATH_DUMP, ""); + std::string appname = gDirUtilp->getExecutableFilename(); + + S32 slen = logdir.length() -1; + S32 end = slen; + while (logdir.at(end) == '/' || logdir.at(end) == '\\') end--; + + if (slen !=end) + { + logdir = logdir.substr(0,end+1); + } + //std::string arg_str = "\"" + exe_path + "\" -dumpdir \"" + logdir + "\" -procname \"" + appname + "\" -pid " + stringize(LLApp::getPid()); + //_spawnl(_P_NOWAIT, exe_path.c_str(), arg_str.c_str(), NULL); + std::string arg_str = "\"" + exe_path + "\" -dumpdir \"" + logdir + "\" -procname \"" + appname + "\" -pid " + stringize(LLApp::getPid()); + + STARTUPINFO startInfo={sizeof(startInfo)}; + PROCESS_INFORMATION processInfo; + + std::wstring exe_wstr; + exe_wstr = utf8str_to_utf16str(exe_path); + + std::wstring arg_wstr; + arg_wstr = utf8str_to_utf16str(arg_str); + + LL_INFOS("CrashReport") << "Creating crash reporter process " << exe_path << " with params: " << arg_str << LL_ENDL; + if(CreateProcess(exe_wstr.c_str(), + &arg_wstr[0], // Application arguments + 0, + 0, + FALSE, + CREATE_DEFAULT_ERROR_MODE, + 0, + 0, // Working directory + &startInfo, + &processInfo) == FALSE) + // Could not start application -> call 'GetLastError()' + { + LL_WARNS("CrashReport") << "CreateProcess failed " << GetLastError() << LL_ENDL; + return; + } +} + //virtual bool LLAppViewerWin32::sendURLToOtherInstance(const std::string& url) { |