diff options
Diffstat (limited to 'src/VBox/Runtime/common/misc/assert.cpp')
-rw-r--r-- | src/VBox/Runtime/common/misc/assert.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/VBox/Runtime/common/misc/assert.cpp b/src/VBox/Runtime/common/misc/assert.cpp index fb4165029..ca7d1caf1 100644 --- a/src/VBox/Runtime/common/misc/assert.cpp +++ b/src/VBox/Runtime/common/misc/assert.cpp @@ -1,4 +1,4 @@ -/* $Id: assert.cpp $ */ +/* $Id: assert.cpp 37233 2011-05-27 13:31:57Z vboxsync $ */ /** @file * IPRT - Assertions, common code. */ @@ -32,6 +32,7 @@ #include "internal/iprt.h" #include <iprt/asm.h> +#include <iprt/err.h> #include <iprt/log.h> #include <iprt/string.h> #include <iprt/stdarg.h> @@ -121,6 +122,9 @@ RTDECL(void) RTAssertMsg1(const char *pszExpr, unsigned uLine, const char *pszFi */ if (!RTAssertAreQuiet()) { + RTERRVARS SavedErrVars; + RTErrVarsSave(&SavedErrVars); + #ifdef IN_RING0 # ifdef IN_GUEST_R0 RTLogBackdoorPrintf("\n!!Assertion Failed!!\n" @@ -181,6 +185,8 @@ RTDECL(void) RTAssertMsg1(const char *pszExpr, unsigned uLine, const char *pszFi fflush(stderr); # endif #endif /* !IN_RING0 */ + + RTErrVarsRestore(&SavedErrVars); } } RT_EXPORT_SYMBOL(RTAssertMsg1); @@ -225,6 +231,9 @@ static void rtAssertMsg2Worker(bool fInitial, const char *pszFormat, va_list va) */ if (!RTAssertAreQuiet()) { + RTERRVARS SavedErrVars; + RTErrVarsSave(&SavedErrVars); + #ifdef IN_RING0 # ifdef IN_GUEST_R0 va_copy(vaCopy, va); @@ -265,7 +274,7 @@ static void rtAssertMsg2Worker(bool fInitial, const char *pszFormat, va_list va) # ifdef IN_RING3 /* print to stderr, helps user and gdb debugging. */ - char szMsg[1024]; + char szMsg[sizeof(g_szRTAssertMsg2)]; va_copy(vaCopy, va); RTStrPrintfV(szMsg, sizeof(szMsg), pszFormat, vaCopy); va_end(vaCopy); @@ -273,8 +282,9 @@ static void rtAssertMsg2Worker(bool fInitial, const char *pszFormat, va_list va) fflush(stderr); # endif #endif /* !IN_RING0 */ - } + RTErrVarsRestore(&SavedErrVars); + } } |