diff options
| -rwxr-xr-x | indra/llcommon/llerror.cpp | 16 | ||||
| -rwxr-xr-x | indra/llcommon/llerror.h | 29 | ||||
| -rwxr-xr-x | indra/llcommon/llsys.cpp | 5 | ||||
| -rwxr-xr-x | indra/llui/llxuiparser.cpp | 12 | ||||
| -rwxr-xr-x | indra/lscript/lscript_compile/indra.l | 8 | ||||
| -rwxr-xr-x | indra/lscript/lscript_compile/indra.y | 7 | 
6 files changed, 37 insertions, 40 deletions
| diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 5c8e6cca29..10b8b3105b 100755 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -201,7 +201,7 @@ namespace {  		virtual void recordMessage(LLError::ELevel level,  								   const std::string& message)  		{ -			LL_WINDOWS_OUTPUT_DEBUG(wstring_to_utf16str(utf8str_to_wstring(message))); +			LL_WINDOWS_OUTPUT_DEBUG(wstring_to_utf16str(utf8str_to_wstring(message)).c_str());  		}  	};  #endif @@ -1398,5 +1398,19 @@ namespace LLError     {         sIndex = 0 ;     } + +#if LL_WINDOWS && !defined(LL_RELEASE_FOR_DOWNLOAD) +	void LLOutputDebugUTF16(const unsigned short* 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 +		// +		#if defined(_DEBUG) +			OutputDebugString(s); +			OutputDebugString(TEXT("\n")); +		#endif +	} +#endif +  } diff --git a/indra/llcommon/llerror.h b/indra/llcommon/llerror.h index 08a5cd26df..1bc93b4def 100755 --- a/indra/llcommon/llerror.h +++ b/indra/llcommon/llerror.h @@ -34,7 +34,6 @@  #include "llerrorlegacy.h"  #include "stdtypes.h" -  /** Error Logging Facility  	Information for most users: @@ -199,8 +198,22 @@ namespace LLError         static void clear() ;  	   static void end(std::ostringstream* _out) ;     };  + +#if LL_WINDOWS && !defined(LL_RELEASE_FOR_DOWNLOAD) +	void LLOutputDebugUTF16(const unsigned short* s); +#endif +  } +#if LL_WINDOWS && !defined(LL_RELEASE_FOR_DOWNLOAD) +	// Macro accepting a wchar_t* for display in windows debugging console in debug builds only +	// (wchar_t flavor chosen for maximal utility with unicode text debugging) +	// +	#define LL_WINDOWS_OUTPUT_DEBUG(a) LLError::LLOutputDebugUTF16((a)) +#else +	#define LL_WINDOWS_OUTPUT_DEBUG(a) +#endif +  //this is cheaper than llcallstacks if no need to output other variables to call stacks.   #define llpushcallstacks LLError::LLCallStacks::push(__FUNCTION__, __LINE__)  #define llcallstacks \ @@ -283,20 +296,6 @@ typedef LLError::NoClassInfo _LL_CLASS_TO_LOG;  #define LL_ENDL llendl  #define LL_CONT	(*_out) -// Short story: We don't want to enable this in release builds. -// -// Long story: ...because this call generates C++ exceptions -// which are handled and fine under the debugger, but instant death should they occur from -// within a coroutine's stackframe due to inherent limitations of Windows 32-bit SEH -// interacting with the fiber-based coroutine support used by boost. -// -// gmad BUG-2707/MAINT-2740 -#if LL_WINDOWS && defined(_DEBUG) -	#define LL_WINDOWS_OUTPUT_DEBUG(a) OutputDebugString(utf8str_to_utf16str(a).c_str()), OutputDebugString("\n") -#else -	#define LL_WINDOWS_OUTPUT_DEBUG(a) -#endif -  	/*  		Use this construct if you need to do computation in the middle of a  		message: diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index 418c5763f8..57a6de9060 100755 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -1385,7 +1385,7 @@ public:              return false;          }          // Congratulations, we've hit a new low.  :-P -#if _DEBUG +          LL_INFOS("FrameWatcher") << ' ';          if (! prevSize)          { @@ -1398,9 +1398,6 @@ public:          }          LL_CONT << std::fixed << std::setprecision(1) << framerate << '\n'                  << LLMemoryInfo() << LL_ENDL; -#else -	(void)prevSize; -#endif          return false;      } diff --git a/indra/llui/llxuiparser.cpp b/indra/llui/llxuiparser.cpp index 4f3a2e0623..a92ec7a3c1 100755 --- a/indra/llui/llxuiparser.cpp +++ b/indra/llui/llxuiparser.cpp @@ -1310,8 +1310,7 @@ void LLXUIParser::parserWarning(const std::string& message)  {  #ifdef LL_WINDOWS  	// use Visual Studo friendly formatting of output message for easy access to originating xml -	llutf16string utf16str = utf8str_to_utf16str(llformat("%s(%d):\t%s", mCurFileName.c_str(), mCurReadNode->getLineNumber(), message.c_str()).c_str()); -	LL_WINDOWS_OUTPUT_DEBUG(utf16str); +	LL_WINDOWS_OUTPUT_DEBUG(utf8str_to_utf16str(llformat("%s(%d):\t%s", mCurFileName.c_str(), mCurReadNode->getLineNumber(), message.c_str())));  #else  	Parser::parserWarning(message);  #endif @@ -1320,8 +1319,7 @@ void LLXUIParser::parserWarning(const std::string& message)  void LLXUIParser::parserError(const std::string& message)  {  #ifdef LL_WINDOWS -	llutf16string utf16str = utf8str_to_utf16str(llformat("%s(%d):\t%s", mCurFileName.c_str(), mCurReadNode->getLineNumber(), message.c_str()).c_str()); -	LL_WINDOWS_OUTPUT_DEBUG(utf16str); +	LL_WINDOWS_OUTPUT_DEBUG(utf8str_to_utf16str(llformat("%s(%d):\t%s", mCurFileName.c_str(), mCurReadNode->getLineNumber(), message.c_str())));  #else  	Parser::parserError(message);  #endif @@ -1639,8 +1637,7 @@ void LLSimpleXUIParser::parserWarning(const std::string& message)  {  #ifdef LL_WINDOWS  	// use Visual Studo friendly formatting of output message for easy access to originating xml -	llutf16string utf16str = utf8str_to_utf16str(llformat("%s(%d):\t%s", mCurFileName.c_str(), LINE_NUMBER_HERE, message.c_str()).c_str()); -	LL_WINDOWS_OUTPUT_DEBUG(utf16str); +	LL_WINDOWS_OUTPUT_DEBUG(utf8str_to_utf16str(llformat("%s(%d):\t%s", mCurFileName.c_str(), LINE_NUMBER_HERE, message.c_str())));  #else  	Parser::parserWarning(message);  #endif @@ -1649,8 +1646,7 @@ void LLSimpleXUIParser::parserWarning(const std::string& message)  void LLSimpleXUIParser::parserError(const std::string& message)  {  #ifdef LL_WINDOWS -	llutf16string utf16str = utf8str_to_utf16str(llformat("%s(%d):\t%s", mCurFileName.c_str(), LINE_NUMBER_HERE, message.c_str()).c_str()); -	LL_WINDOWS_OUTPUT_DEBUG(utf16str); +	LL_WINDOWS_OUTPUT_DEBUG(utf8str_to_utf16str(llformat("%s(%d):\t%s", mCurFileName.c_str(), LINE_NUMBER_HERE, message.c_str())));  #else  	Parser::parserError(message);  #endif diff --git a/indra/lscript/lscript_compile/indra.l b/indra/lscript/lscript_compile/indra.l index b2c49083cb..1bb38bbf65 100755 --- a/indra/lscript/lscript_compile/indra.l +++ b/indra/lscript/lscript_compile/indra.l @@ -79,11 +79,9 @@ void parse_string();  #define yyfree indra_free -#if defined(__cplusplus) -extern "C" { int yylex( void ); } -extern "C" { int yyparse( void ); } -extern "C" { int yyerror(const char *fmt, ...); } -#endif +int yylex( void ); +int yyparse( void ); +int yyerror(const char *fmt, ...);  %} diff --git a/indra/lscript/lscript_compile/indra.y b/indra/lscript/lscript_compile/indra.y index e4b10ffdd9..a0a034d21c 100755 --- a/indra/lscript/lscript_compile/indra.y +++ b/indra/lscript/lscript_compile/indra.y @@ -2,10 +2,6 @@  	#include "linden_common.h"  	#include "lscript_tree.h" -    #ifdef __cplusplus -    extern "C" { -    #endif -  	int yylex(void);  	int yyparse( void );  	int yyerror(const char *fmt, ...); @@ -20,9 +16,6 @@  	#pragma warning( disable : 4065 )	// warning: switch statement contains 'default' but no 'case' labels  	#endif -    #ifdef __cplusplus -    } -    #endif  %}  %union | 
