VirtualBox

Changeset 8953

Show
Ignore:
Timestamp:
05/20/08 15:55:09 (8 months ago)
Author:
vboxsync
Message:

Ring-0 assertions are now always printed to the debug log.
Introduced LogAlways? for this purpose.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/include/iprt/log.h

    r8663 r8953  
    446446        } \ 
    447447    } while (0) 
     448#  define LogItAlways(pvInst, fFlags, fmtargs) \ 
     449    do \ 
     450    { \ 
     451        register PRTLOGGER LogIt_pLogger = (PRTLOGGER)(pvInst) ? (PRTLOGGER)(pvInst) : RTLogDefaultInstance(); \ 
     452        if (LogIt_pLogger) \ 
     453        { \ 
     454            LogIt_pLogger->pfnLogger fmtargs; \ 
     455        } \ 
     456    } while (0) 
    448457# endif 
    449458#else 
    450459# define LogIt(pvInst, fFlags, iGroup, fmtargs)     do { } while (0) 
     460# define LogItAlways(pvInst, fFlags, fmtargs)       do { } while (0) 
    451461# if defined(LOG_USE_C99) 
    452462#  define _LogRemoveParentheseis(...)               __VA_ARGS__ 
     
    455465#endif 
    456466 
     467 
     468/** @def Log 
     469 * Level 1 logging that works regardless of the group settings (used for ring-0 assertion logging) 
     470 */ 
     471#define LogAlways(a)    LogItAlways(LOG_INSTANCE, RTLOGGRPFLAGS_LEVEL_1, a) 
    457472 
    458473/** @def Log 
  • trunk/src/VBox/VMM/VMMR0/VMMR0.cpp

    r8841 r8953  
    10871087 
    10881088 
    1089 # undef LOG_GROUP 
    1090 # define LOG_GROUP LOG_GROUP_EM 
    1091  
    10921089/** 
    10931090 * Override this so we can push 
     
    11071104                pszExpr, pszFile, uLine, pszFunction); 
    11081105#endif 
    1109     LogRel(("\n!!R0-Assertion Failed!!\n" 
    1110             "Expression: %s\n" 
    1111             "Location  : %s(%d) %s\n", 
    1112             pszExpr, pszFile, uLine, pszFunction)); 
     1106    LogAlways(("\n!!R0-Assertion Failed!!\n" 
     1107               "Expression: %s\n" 
     1108               "Location  : %s(%d) %s\n", 
     1109               pszExpr, pszFile, uLine, pszFunction)); 
    11131110} 
    11141111 
     
    11221119    for (size_t i = 0; i < cbChars; i++) 
    11231120    { 
    1124         LogRel(("%c", pachChars[i])); /** @todo this isn't any release logging in ring-0 from what I can tell... */ 
     1121        LogAlways(("%c", pachChars[i])); /** @todo this isn't any release logging in ring-0 from what I can tell... */ 
    11251122#ifndef DEBUG_sandervl 
    11261123        SUPR0Printf("%c", pachChars[i]); 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy