diff options
author | Dessie Linden <dessie@lindenlab.com> | 2010-07-12 11:14:26 -0700 |
---|---|---|
committer | Dessie Linden <dessie@lindenlab.com> | 2010-07-12 11:14:26 -0700 |
commit | 4ac2dbb82eeaa5ead25c0821abe443d86e0333f5 (patch) | |
tree | bfa36a69e2ee97a32a5cf2dd06d610cb5c1656bb /indra/newview/llwindebug.cpp | |
parent | c371f359dc211f551c9ee3a999a77cee8027c6fa (diff) | |
parent | d3f114d6901877bb79ae9719f59d681fa6a9d494 (diff) |
Merged from viewer-release
Diffstat (limited to 'indra/newview/llwindebug.cpp')
-rw-r--r-- | indra/newview/llwindebug.cpp | 61 |
1 files changed, 35 insertions, 26 deletions
diff --git a/indra/newview/llwindebug.cpp b/indra/newview/llwindebug.cpp index 502fefd4ef..660245b02b 100644 --- a/indra/newview/llwindebug.cpp +++ b/indra/newview/llwindebug.cpp @@ -97,6 +97,9 @@ void LLWinDebug::init() // Load the dbghelp dll now, instead of waiting for the crash. // Less potential for stack mangling + // Don't install vectored exception handler if being debugged. + if(IsDebuggerPresent()) return; + if (s_first_run) { // First, try loading from the directory that the app resides in. @@ -135,36 +138,42 @@ void LLWinDebug::init() void LLWinDebug::writeDumpToFile(MINIDUMP_TYPE type, MINIDUMP_EXCEPTION_INFORMATION *ExInfop, const std::string& filename) { - if(f_mdwp == NULL || gDirUtilp == NULL) - { - return; - } - else + // Temporary fix to switch out the code that writes the DMP file. + // Fix coming that doesn't write a mini dump file for regular C++ exceptions. + const bool enable_write_dump_file = false; + if ( enable_write_dump_file ) { - std::string dump_path = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, filename); - - HANDLE hFile = CreateFileA(dump_path.c_str(), - GENERIC_WRITE, - FILE_SHARE_WRITE, - NULL, - CREATE_ALWAYS, - FILE_ATTRIBUTE_NORMAL, - NULL); - - if (hFile != INVALID_HANDLE_VALUE) + if(f_mdwp == NULL || gDirUtilp == NULL) { - // Write the dump, ignoring the return value - f_mdwp(GetCurrentProcess(), - GetCurrentProcessId(), - hFile, - type, - ExInfop, - NULL, - NULL); - - CloseHandle(hFile); + return; } + else + { + std::string dump_path = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, filename); + + HANDLE hFile = CreateFileA(dump_path.c_str(), + GENERIC_WRITE, + FILE_SHARE_WRITE, + NULL, + CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL, + NULL); + + if (hFile != INVALID_HANDLE_VALUE) + { + // Write the dump, ignoring the return value + f_mdwp(GetCurrentProcess(), + GetCurrentProcessId(), + hFile, + type, + ExInfop, + NULL, + NULL); + + CloseHandle(hFile); + } + } } } |