Changeset 25536 in vbox for trunk/src/VBox/Runtime/common/misc
- Timestamp:
- Dec 21, 2009 11:06:08 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 56209
- Location:
- trunk/src/VBox/Runtime/common/misc
- Files:
-
- 1 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/misc/RTAssertMsg2Add.cpp
r25534 r25536 1 1 /* $Id$ */ 2 2 /** @file 3 * IPRT - RTAssertMsg2 .3 * IPRT - RTAssertMsg2Add. 4 4 */ 5 5 6 6 /* 7 * Copyright (C) 2008 Sun Microsystems, Inc.7 * Copyright (C) 2008-2009 Sun Microsystems, Inc. 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 39 39 40 40 41 RTDECL(void) RTAssertMsg2 (const char *pszFormat, ...)41 RTDECL(void) RTAssertMsg2Add(const char *pszFormat, ...) 42 42 { 43 43 va_list va; 44 44 va_start(va, pszFormat); 45 RTAssertMsg2 V(pszFormat, va);45 RTAssertMsg2AddV(pszFormat, va); 46 46 va_end(va); 47 47 } 48 RT_EXPORT_SYMBOL(RTAssertMsg2 );48 RT_EXPORT_SYMBOL(RTAssertMsg2Add); 49 49 -
trunk/src/VBox/Runtime/common/misc/RTAssertMsg2AddWeak.cpp
r25534 r25536 1 1 /* $Id$ */ 2 2 /** @file 3 * IPRT - RTAssertMsg2 Weak.3 * IPRT - RTAssertMsg2AddWeak. 4 4 */ 5 5 … … 39 39 40 40 41 RTDECL(void) RTAssertMsg2 Weak(const char *pszFormat, ...)41 RTDECL(void) RTAssertMsg2AddWeak(const char *pszFormat, ...) 42 42 { 43 43 va_list va; 44 44 va_start(va, pszFormat); 45 RTAssertMsg2 WeakV(pszFormat, va);45 RTAssertMsg2AddWeakV(pszFormat, va); 46 46 va_end(va); 47 47 } 48 RT_EXPORT_SYMBOL(RTAssertMsg2 Weak);48 RT_EXPORT_SYMBOL(RTAssertMsg2AddWeak); 49 49 -
trunk/src/VBox/Runtime/common/misc/RTAssertMsg2AddWeakV.cpp
r25534 r25536 1 1 /* $Id$ */ 2 2 /** @file 3 * IPRT - RTAssertMsg2 WeakV.3 * IPRT - RTAssertMsg2AddWeakV. 4 4 */ 5 5 … … 37 37 38 38 39 RTDECL(void) RTAssertMsg2 WeakV(const char *pszFormat, va_list va)39 RTDECL(void) RTAssertMsg2AddWeakV(const char *pszFormat, va_list va) 40 40 { 41 RTAssertMsg2 V(pszFormat, va);41 RTAssertMsg2AddV(pszFormat, va); 42 42 } 43 RT_EXPORT_SYMBOL(RTAssertMsg2 WeakV);43 RT_EXPORT_SYMBOL(RTAssertMsg2AddWeakV); 44 44 -
trunk/src/VBox/Runtime/common/misc/assert.cpp
r25528 r25536 53 53 RT_EXPORT_SYMBOL(g_szRTAssertMsg1); 54 54 /** The last assert message, 2nd part. */ 55 RTDATADECL(char) g_szRTAssertMsg2[ 2048];55 RTDATADECL(char) g_szRTAssertMsg2[4096]; 56 56 RT_EXPORT_SYMBOL(g_szRTAssertMsg2); 57 /** The length of the g_szRTAssertMsg2 content. 58 * @remarks Race. */ 59 static uint32_t volatile g_cchRTAssertMsg2; 57 60 /** The last assert message, expression. */ 58 61 RTDATADECL(const char * volatile) g_pszRTAssertExpr; … … 188 191 189 192 190 RTDECL(void) RTAssertMsg2V(const char *pszFormat, va_list va) 193 /** 194 * Worker for RTAssertMsg2V and RTAssertMsg2AddV 195 * 196 * @param fInitial True if it's RTAssertMsg2V, otherwise false. 197 * @param pszFormat The message format string. 198 * @param va The format arguments. 199 */ 200 static void rtAssertMsg2Worker(bool fInitial, const char *pszFormat, va_list va) 191 201 { 192 202 va_list vaCopy; 203 size_t cch; 193 204 194 205 /* 195 206 * The global first. 196 207 */ 197 va_copy(vaCopy, va); 198 RTStrPrintfV(g_szRTAssertMsg2, sizeof(g_szRTAssertMsg2), pszFormat, vaCopy); 199 va_end(vaCopy); 208 if (fInitial) 209 { 210 va_copy(vaCopy, va); 211 cch = RTStrPrintfV(g_szRTAssertMsg2, sizeof(g_szRTAssertMsg2), pszFormat, vaCopy); 212 ASMAtomicWriteU32(&g_cchRTAssertMsg2, (uint32_t)cch); 213 va_end(vaCopy); 214 } 215 else 216 { 217 cch = ASMAtomicReadU32(&g_cchRTAssertMsg2); 218 if (cch < sizeof(g_szRTAssertMsg2) - 4) 219 { 220 va_copy(vaCopy, va); 221 cch += RTStrPrintfV(&g_szRTAssertMsg2[cch], sizeof(g_szRTAssertMsg2) - cch, pszFormat, vaCopy); 222 ASMAtomicWriteU32(&g_cchRTAssertMsg2, (uint32_t)cch); 223 va_end(vaCopy); 224 } 225 } 200 226 201 227 /* … … 211 237 # endif 212 238 /** @todo fully integrate this with the logger... play safe a bit for now. */ 213 rtR0AssertNativeMsg2V( pszFormat, va);239 rtR0AssertNativeMsg2V(fInitial, pszFormat, va); 214 240 215 241 #else /* !IN_RING0 */ … … 255 281 256 282 } 283 284 285 RTDECL(void) RTAssertMsg2V(const char *pszFormat, va_list va) 286 { 287 rtAssertMsg2Worker(true /*fInitial*/, pszFormat, va); 288 } 257 289 RT_EXPORT_SYMBOL(RTAssertMsg2V); 258 290 291 292 RTDECL(void) RTAssertMsg2AddV(const char *pszFormat, va_list va) 293 { 294 rtAssertMsg2Worker(false /*fInitial*/, pszFormat, va); 295 } 296 RT_EXPORT_SYMBOL(RTAssertMsg2AddV); 297
Note:
See TracChangeset
for help on using the changeset viewer.