VirtualBox

Changeset 25528 in vbox for trunk/src/VBox/Runtime/r0drv/nt


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.

Location:
trunk/src/VBox/Runtime/r0drv/nt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/nt/assert-r0drv-nt.cpp

    r11917 r25528  
    3939#include <iprt/stdarg.h>
    4040
    41 
    42 /*******************************************************************************
    43 *   Global Variables                                                           *
    44 *******************************************************************************/
    45 /** The last assert message, 1st part. */
    46 RTDATADECL(char) g_szRTAssertMsg1[1024];
    47 /** The last assert message, 2nd part. */
    48 RTDATADECL(char) g_szRTAssertMsg2[2048];
     41#include "internal/assert.h"
    4942
    5043
    51 RTDECL(void) AssertMsg1(const char *pszExpr, unsigned uLine, const char *pszFile, const char *pszFunction)
     44void rtR0AssertNativeMsg1(const char *pszExpr, unsigned uLine, const char *pszFile, const char *pszFunction)
    5245{
    53 #ifdef IN_GUEST_R0
    54     RTLogBackdoorPrintf("\n!!Assertion Failed!!\n"
    55                         "Expression: %s\n"
    56                         "Location  : %s(%d) %s\n",
    57                         pszExpr, pszFile, uLine, pszFunction);
    58 #endif
    59 
    6046    DbgPrint("\n!!Assertion Failed!!\n"
    6147             "Expression: %s\n"
    6248             "Location  : %s(%d) %s\n",
    6349             pszExpr, pszFile, uLine, pszFunction);
    64 
    65     RTStrPrintf(g_szRTAssertMsg1, sizeof(g_szRTAssertMsg1),
    66                 "\n!!Assertion Failed!!\n"
    67                 "Expression: %s\n"
    68                 "Location  : %s(%d) %s\n",
    69                 pszExpr, pszFile, uLine, pszFunction);
    7050}
    7151
    7252
    73 RTDECL(void) AssertMsg2(const char *pszFormat, ...)
     53void rtR0AssertNativeMsg2V(const char *pszFormat, va_list va)
    7454{
    75     va_list va;
    76     char    szMsg[256];
    77 
    78 # ifdef IN_GUEST_R0
    79     va_start(va, pszFormat);
    80     RTLogBackdoorPrintfV(pszFormat, va);
    81     va_end(va);
    82 # endif
     55    char szMsg[256];
    8356
    8457    va_start(va, pszFormat);
     
    8760    va_end(va);
    8861    DbgPrint("%s", szMsg);
    89 
    90     va_start(va, pszFormat);
    91     RTStrPrintfV(g_szRTAssertMsg2, sizeof(g_szRTAssertMsg2), pszFormat, va);
    92     va_end(va);
    9362}
    9463
  • trunk/src/VBox/Runtime/r0drv/nt/timer-r0drv-nt.cpp

    r18988 r25528  
    115115#ifdef RT_STRICT
    116116    if (KeGetCurrentIrql() < DISPATCH_LEVEL)
    117         AssertMsg2("rtTimerNtSimpleCallback: Irql=%d expected >=%d\n", KeGetCurrentIrql(), DISPATCH_LEVEL);
     117        RTAssertMsg2Weak("rtTimerNtSimpleCallback: Irql=%d expected >=%d\n", KeGetCurrentIrql(), DISPATCH_LEVEL);
    118118#endif
    119119
     
    145145#ifdef RT_STRICT
    146146    if (KeGetCurrentIrql() < DISPATCH_LEVEL)
    147         AssertMsg2("rtTimerNtOmniSlaveCallback: Irql=%d expected >=%d\n", KeGetCurrentIrql(), DISPATCH_LEVEL);
     147        RTAssertMsg2Weak("rtTimerNtOmniSlaveCallback: Irql=%d expected >=%d\n", KeGetCurrentIrql(), DISPATCH_LEVEL);
    148148    int iCpuSelf = RTMpCpuIdToSetIndex(RTMpCpuId());
    149149    if (pSubTimer - &pTimer->aSubTimers[0] != iCpuSelf)
    150         AssertMsg2("rtTimerNtOmniSlaveCallback: iCpuSelf=%d pSubTimer=%p / %d\n", iCpuSelf, pSubTimer, pSubTimer - &pTimer->aSubTimers[0]);
     150        RTAssertMsg2Weak("rtTimerNtOmniSlaveCallback: iCpuSelf=%d pSubTimer=%p / %d\n", iCpuSelf, pSubTimer, pSubTimer - &pTimer->aSubTimers[0]);
    151151#endif
    152152
     
    182182#ifdef RT_STRICT
    183183    if (KeGetCurrentIrql() < DISPATCH_LEVEL)
    184         AssertMsg2("rtTimerNtOmniMasterCallback: Irql=%d expected >=%d\n", KeGetCurrentIrql(), DISPATCH_LEVEL);
     184        RTAssertMsg2Weak("rtTimerNtOmniMasterCallback: Irql=%d expected >=%d\n", KeGetCurrentIrql(), DISPATCH_LEVEL);
    185185    if (pSubTimer - &pTimer->aSubTimers[0] != iCpuSelf)
    186         AssertMsg2("rtTimerNtOmniMasterCallback: iCpuSelf=%d pSubTimer=%p / %d\n", iCpuSelf, pSubTimer, pSubTimer - &pTimer->aSubTimers[0]);
     186        RTAssertMsg2Weak("rtTimerNtOmniMasterCallback: iCpuSelf=%d pSubTimer=%p / %d\n", iCpuSelf, pSubTimer, pSubTimer - &pTimer->aSubTimers[0]);
    187187#endif
    188188
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