VirtualBox

Ignore:
Timestamp:
Dec 20, 2009 11:24:59 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
56201
Message:

IPRT,SUPDrv,++: AssertMsg[12] -> AssertMsg1Weak, AssertMsg1, AssertMsg2Weak, AssertMsg2, AssertMsg2WeakV and AssertMsg2V. Doing more of the assertion machinery in common/misc/assert.cpp to avoid code duplication (ring-0). Major SUPDrv version bump.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/solaris/assert-r0drv-solaris.c

    r22073 r25528  
    4242#include <iprt/string.h>
    4343
    44 
    45 /*******************************************************************************
    46 *   Global Variables                                                           *
    47 *******************************************************************************/
    48 /** The last assert message, 1st part. */
    49 RTDATADECL(char)                    g_szRTAssertMsg1[1024];
    50 /** The last assert message, 2nd part. */
    51 RTDATADECL(char)                    g_szRTAssertMsg2[2048];
    52 /** The last assert message, expression. */
    53 RTDATADECL(const char * volatile)   g_pszRTAssertExpr;
    54 /** The last assert message, file name. */
    55 RTDATADECL(const char * volatile)   g_pszRTAssertFile;
    56 /** The last assert message, line number. */
    57 RTDATADECL(uint32_t volatile)       g_u32RTAssertLine;
    58 /** The last assert message, function name. */
    59 RTDATADECL(const char * volatile)   g_pszRTAssertFunction;
     44#include "internal/assert.h"
    6045
    6146
    62 RTDECL(void) AssertMsg1(const char *pszExpr, unsigned uLine, const char *pszFile, const char *pszFunction)
     47void rtR0AssertNativeMsg1(const char *pszExpr, unsigned uLine, const char *pszFile, const char *pszFunction)
    6348{
    64 
    65 #ifdef IN_GUEST_R0
    66     RTLogBackdoorPrintf("\n!!Assertion Failed!!\n"
    67                         "Expression: %s\n"
    68                         "Location  : %s(%d) %s\n",
    69                         pszExpr, pszFile, uLine, pszFunction);
    70 #endif
    71 
    7249    uprintf("\r\n!!Assertion Failed!!\r\n"
    7350            "Expression: %s\r\n"
    7451            "Location  : %s(%d) %s\r\n",
    7552            pszExpr, pszFile, uLine, pszFunction);
    76 
    77     RTStrPrintf(g_szRTAssertMsg1, sizeof(g_szRTAssertMsg1),
    78                 "\n!!Assertion Failed!!\n"
    79                 "Expression: %s\n"
    80                 "Location  : %s(%d) %s\n",
    81                 pszExpr, pszFile, uLine, pszFunction);
    82     ASMAtomicUoWritePtr((void * volatile *)&g_pszRTAssertExpr, (void *)pszExpr);
    83     ASMAtomicUoWritePtr((void * volatile *)&g_pszRTAssertFile, (void *)pszFile);
    84     ASMAtomicUoWritePtr((void * volatile *)&g_pszRTAssertFunction, (void *)pszFunction);
    85     ASMAtomicUoWriteU32(&g_u32RTAssertLine, uLine);
    8653}
    8754
    8855
    89 RTDECL(void) AssertMsg2(const char *pszFormat, ...)
     56void rtR0AssertNativeMsg2V(const char *pszFormat, va_list va)
    9057{
    9158    va_list va;
    9259    char    szMsg[256];
    93 
    94 #ifdef IN_GUEST_R0
    95     va_start(va, pszFormat);
    96     RTLogBackdoorPrintfV(pszFormat, va);
    97     va_end(va);
    98 #endif
    9960
    10061    va_start(va, pszFormat);
     
    10364    va_end(va);
    10465    uprintf("%s", szMsg);
    105 
    106     va_start(va, pszFormat);
    107     RTStrPrintfV(g_szRTAssertMsg2, sizeof(g_szRTAssertMsg2), pszFormat, va);
    108     va_end(va);
    10966}
    11067
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette