diff options
-rwxr-xr-x | indra/llcommon/llerror.cpp | 13 | ||||
-rwxr-xr-x | indra/llcommon/llerror.h | 2 |
2 files changed, 10 insertions, 5 deletions
diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 37ba097832..d2af004cde 100755 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -1402,15 +1402,20 @@ namespace LLError #if LL_WINDOWS void LLOutputDebugUTF8(const std::string& s) { - // Be careful not to enable this in non-debug builds as there are bad interactions between the - // exceptions thrown by this function and the handling of stacks in coroutine fibers. BUG-2707 + // Be careful when calling OutputDebugString as it throws DBG_PRINTEXCEPTION_C + // which works just fine under the windows debugger, but can cause users who + // have enabled SEHOP exception chain validation to crash due to interactions + // between the Win 32-bit exception handling and boost coroutine fiber stacks. BUG-2707 // if (IsDebuggerPresent()) { // Need UTF16 for Unicode OutputDebugString // - OutputDebugString(utf8str_to_utf16str(s).c_str()); - OutputDebugString(TEXT("\n")); + if (s.size()) + { + OutputDebugString(utf8str_to_utf16str(s).c_str()); + OutputDebugString(TEXT("\n")); + } } } #endif diff --git a/indra/llcommon/llerror.h b/indra/llcommon/llerror.h index cc9bfba818..0b723aeb5d 100755 --- a/indra/llcommon/llerror.h +++ b/indra/llcommon/llerror.h @@ -206,7 +206,7 @@ namespace LLError } #if LL_WINDOWS - // Macro accepting a const std::string& for display in windows debugging console in debug builds only + // Macro accepting a std::string for display in windows debugging console #define LL_WINDOWS_OUTPUT_DEBUG(a) LLError::LLOutputDebugUTF8(a) #else #define LL_WINDOWS_OUTPUT_DEBUG(a) |