VirtualBox

Changeset 14500 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Nov 24, 2008 2:22:08 AM (16 years ago)
Author:
vboxsync
Message:

IPRT/SUPDrv/VMM: Made RTR0AssertPanicSystem available to VMMR0.r0 on darwin & solaris (only platforms implemting it currently). Created RTAssertMsg1, RTAssertMsg2 and RTAssertMsg2V (darwin only atm) in addition to AssertMsg1/2 and delcared the latter two as weak and overridable by users, while the former are strong and exposed by SUPDrv. This way we can get the full assertion text in the 'Problem Report for Mac OS X Kernel' thing. Will propagte the changes to the other platforms and rings later.

Location:
trunk/src/VBox
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/Makefile.kmk

    r14468 r14500  
    879879        common/misc/sanity-c.c \
    880880        common/misc/sanity-cpp.cpp \
     881        common/misc/RTAssertMsg2.cpp \
    881882        common/string/strformat.cpp \
    882883        common/string/strformatrt.cpp \
     
    960961RuntimeR0Drv_SOURCES    = \
    961962        common/alloc/alloc.cpp \
     963        common/misc/RTAssertMsg2.cpp \
    962964        common/checksum/crc32.cpp \
    963965        common/checksum/crc64.cpp \
     
    10721074RuntimeR0Drv_SOURCES.darwin = \
    10731075        common/err/RTErrConvertFromErrno.cpp \
     1076        common/misc/RTAssertMsg1Weak.cpp \
     1077        common/misc/RTAssertMsg2Weak.cpp \
    10741078        common/misc/thread.cpp \
    10751079        common/string/memchr.asm \
  • trunk/src/VBox/Runtime/r0drv/darwin/assert-r0drv-darwin.cpp

    r13314 r14500  
    5959
    6060
    61 RTDECL(void) AssertMsg1(const char *pszExpr, unsigned uLine, const char *pszFile, const char *pszFunction)
     61RTDECL(void) RTAssertMsg1(const char *pszExpr, unsigned uLine, const char *pszFile, const char *pszFunction)
    6262{
    6363#ifdef IN_GUEST_R0
     
    8585
    8686
    87 RTDECL(void) AssertMsg2(const char *pszFormat, ...)
     87RTDECL(void) RTAssertMsg2V(const char *pszFormat, va_list va)
    8888{
    89     va_list va;
     89    va_list vaCopy;
    9090    char    szMsg[256];
    9191
    9292#ifdef IN_GUEST_R0
    93     va_start(va, pszFormat);
    94     RTLogBackdoorPrintfV(pszFormat, va);
    95     va_end(va);
     93    va_copy(vaCopy, va);
     94    RTLogBackdoorPrintfV(pszFormat, vaCopy);
     95    va_end(vaCopy);
    9696#endif
    9797
    98     va_start(va, pszFormat);
    99     RTStrPrintfV(szMsg, sizeof(szMsg) - 1, pszFormat, va);
     98    va_copy(vaCopy, va);
     99    RTStrPrintfV(szMsg, sizeof(szMsg) - 1, pszFormat, vaCopy);
    100100    szMsg[sizeof(szMsg) - 1] = '\0';
    101     va_end(va);
     101    va_end(vaCopy);
    102102    printf("%s", szMsg);
    103103
    104     va_start(va, pszFormat);
    105     RTStrPrintfV(g_szRTAssertMsg2, sizeof(g_szRTAssertMsg2), pszFormat, va);
    106     va_end(va);
     104    va_copy(vaCopy, va);
     105    RTStrPrintfV(g_szRTAssertMsg2, sizeof(g_szRTAssertMsg2), pszFormat, vaCopy);
     106    va_end(vaCopy);
    107107}
    108108
  • trunk/src/VBox/VMM/VMMR0/VMMR0.cpp

    r14499 r14500  
    11781178DECLEXPORT(void) RTCALL AssertMsg1(const char *pszExpr, unsigned uLine, const char *pszFile, const char *pszFunction)
    11791179{
    1180 #ifndef DEBUG_sandervl
     1180#if !defined(DEBUG_sandervl) && !defined(RT_OS_DARWIN)
    11811181    SUPR0Printf("\n!!R0-Assertion Failed!!\n"
    11821182                "Expression: %s\n"
     
    11961196                    "Location  : %s(%d) %s\n",
    11971197                    pszExpr, pszFile, uLine, pszFunction);
     1198#ifdef RT_OS_DARWIN
     1199    RTAssertMsg1(pszExpr, uLine, pszFile, pszFunction);
     1200#endif
    11981201}
    11991202
     
    12071210    for (size_t i = 0; i < cbChars; i++)
    12081211    {
    1209 #ifndef DEBUG_sandervl
     1212#if !defined(DEBUG_sandervl) && !defined(RT_OS_DARWIN)
    12101213        SUPR0Printf("%c", pachChars[i]);
    12111214#endif
     
    12191222DECLEXPORT(void) RTCALL AssertMsg2(const char *pszFormat, ...)
    12201223{
     1224    va_list va;
     1225
    12211226    PRTLOGGER pLog = RTLogDefaultInstance(); /** @todo we want this for release as well! */
    12221227    if (pLog)
    12231228    {
    1224         va_list va;
    12251229        va_start(va, pszFormat);
    12261230        RTLogFormatV(rtLogOutput, pLog, pszFormat, va);
     
    12351239        }
    12361240    }
    1237 }
    1238 
     1241
     1242#ifdef RT_OS_DARWIN
     1243    va_start(va, pszFormat);
     1244    RTAssertMsg2V(pszFormat, va);
     1245    va_end(va);
     1246#endif
     1247}
     1248
Note: See TracChangeset for help on using the changeset viewer.

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