assert.cpp revision a7aa94e0115a73841f34ebbfa00f63fa1904e51f
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/* $Id$ */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/** @file
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * IPRT - Assertions, common code.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/*
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Copyright (C) 2006-2009 Sun Microsystems, Inc.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync *
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * available from http://www.virtualbox.org. This file is free software;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * you can redistribute it and/or modify it under the terms of the GNU
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * General Public License (GPL) as published by the Free Software
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync *
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * The contents of this file may alternatively be used under the terms
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * of the Common Development and Distribution License Version 1.0
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * VirtualBox OSE distribution, in which case the provisions of the
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * CDDL are applicable instead of those of the GPL.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync *
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * You may elect to license modified versions of this file under the
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * terms and conditions of either the GPL or the CDDL or both.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync *
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * additional information or have any questions.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/*******************************************************************************
f78b12e570284aa8291f4ca1add24937fd107403vboxsync* Header Files *
f78b12e570284aa8291f4ca1add24937fd107403vboxsync*******************************************************************************/
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#include <iprt/assert.h>
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#include "internal/iprt.h"
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#include <iprt/asm.h>
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#include <iprt/log.h>
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#include <iprt/string.h>
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#include <iprt/stdarg.h>
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#ifdef IN_RING3
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# include <stdio.h>
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#endif
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#include "internal/assert.h"
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/*******************************************************************************
f78b12e570284aa8291f4ca1add24937fd107403vboxsync* Global Variables *
f78b12e570284aa8291f4ca1add24937fd107403vboxsync*******************************************************************************/
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/** The last assert message, 1st part. */
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncRTDATADECL(char) g_szRTAssertMsg1[1024];
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncRT_EXPORT_SYMBOL(g_szRTAssertMsg1);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/** The last assert message, 2nd part. */
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncRTDATADECL(char) g_szRTAssertMsg2[2048];
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncRT_EXPORT_SYMBOL(g_szRTAssertMsg2);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/** The last assert message, expression. */
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncRTDATADECL(const char * volatile) g_pszRTAssertExpr;
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncRT_EXPORT_SYMBOL(g_pszRTAssertExpr);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/** The last assert message, function name. */
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncRTDATADECL(const char * volatile) g_pszRTAssertFunction;
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncRT_EXPORT_SYMBOL(g_pszRTAssertFunction);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/** The last assert message, file name. */
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncRTDATADECL(const char * volatile) g_pszRTAssertFile;
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncRT_EXPORT_SYMBOL(g_pszRTAssertFile);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/** The last assert message, line number. */
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncRTDATADECL(uint32_t volatile) g_u32RTAssertLine;
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncRT_EXPORT_SYMBOL(g_u32RTAssertLine);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/** Set if assertions are quiet. */
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncstatic bool volatile g_fQuiet = false;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/** Set if assertions may panic. */
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncstatic bool volatile g_fMayPanic = true;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncRTDECL(bool) RTAssertSetQuiet(bool fQuiet)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync{
f78b12e570284aa8291f4ca1add24937fd107403vboxsync return ASMAtomicXchgBool(&g_fQuiet, fQuiet);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync}
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncRT_EXPORT_SYMBOL(RTAssertSetQuiet);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncRTDECL(bool) RTAssertAreQuiet(void)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync{
f78b12e570284aa8291f4ca1add24937fd107403vboxsync return ASMAtomicUoReadBool(&g_fQuiet);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync}
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncRT_EXPORT_SYMBOL(RTAssertAreQuiet);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncRTDECL(bool) RTAssertSetMayPanic(bool fMayPanic)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync{
f78b12e570284aa8291f4ca1add24937fd107403vboxsync return ASMAtomicXchgBool(&g_fMayPanic, fMayPanic);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync}
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncRT_EXPORT_SYMBOL(RTAssertSetMayPanic);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncRTDECL(bool) RTAssertMayPanic(void)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync{
f78b12e570284aa8291f4ca1add24937fd107403vboxsync return ASMAtomicUoReadBool(&g_fMayPanic);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync}
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncRT_EXPORT_SYMBOL(RTAssertMayPanic);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncRTDECL(void) RTAssertMsg1(const char *pszExpr, unsigned uLine, const char *pszFile, const char *pszFunction)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync{
f78b12e570284aa8291f4ca1add24937fd107403vboxsync /*
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Fill in the globals.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync ASMAtomicUoWritePtr((void * volatile *)&g_pszRTAssertExpr, (void *)pszExpr);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync ASMAtomicUoWritePtr((void * volatile *)&g_pszRTAssertFile, (void *)pszFile);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync ASMAtomicUoWritePtr((void * volatile *)&g_pszRTAssertFunction, (void *)pszFunction);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync ASMAtomicUoWriteU32(&g_u32RTAssertLine, uLine);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync RTStrPrintf(g_szRTAssertMsg1, sizeof(g_szRTAssertMsg1),
f78b12e570284aa8291f4ca1add24937fd107403vboxsync "\n!!Assertion Failed!!\n"
f78b12e570284aa8291f4ca1add24937fd107403vboxsync "Expression: %s\n"
f78b12e570284aa8291f4ca1add24937fd107403vboxsync "Location : %s(%d) %s\n",
f78b12e570284aa8291f4ca1add24937fd107403vboxsync pszExpr, pszFile, uLine, pszFunction);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync /*
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * If not quiet, make noise.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync if (!RTAssertAreQuiet())
f78b12e570284aa8291f4ca1add24937fd107403vboxsync {
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#ifdef IN_RING0
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# ifdef IN_GUEST_R0
f78b12e570284aa8291f4ca1add24937fd107403vboxsync RTLogBackdoorPrintf("\n!!Assertion Failed!!\n"
f78b12e570284aa8291f4ca1add24937fd107403vboxsync "Expression: %s\n"
f78b12e570284aa8291f4ca1add24937fd107403vboxsync "Location : %s(%d) %s\n",
f78b12e570284aa8291f4ca1add24937fd107403vboxsync pszExpr, pszFile, uLine, pszFunction);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# endif
f78b12e570284aa8291f4ca1add24937fd107403vboxsync /** @todo fully integrate this with the logger... play safe a bit for now. */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync rtR0AssertNativeMsg1(pszExpr, uLine, pszFile, pszFunction);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#else /* !IN_RING0 */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# if !defined(IN_RING3) && !defined(LOG_NO_COM)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync RTLogComPrintf("\n!!Assertion Failed!!\n"
f78b12e570284aa8291f4ca1add24937fd107403vboxsync "Expression: %s\n"
f78b12e570284aa8291f4ca1add24937fd107403vboxsync "Location : %s(%d) %s\n",
f78b12e570284aa8291f4ca1add24937fd107403vboxsync pszExpr, pszFile, uLine, pszFunction);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# endif
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync PRTLOGGER pLog = RTLogRelDefaultInstance();
f78b12e570284aa8291f4ca1add24937fd107403vboxsync if (pLog)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync {
f78b12e570284aa8291f4ca1add24937fd107403vboxsync RTLogRelPrintf("\n!!Assertion Failed!!\n"
f78b12e570284aa8291f4ca1add24937fd107403vboxsync "Expression: %s\n"
f78b12e570284aa8291f4ca1add24937fd107403vboxsync "Location : %s(%d) %s\n",
f78b12e570284aa8291f4ca1add24937fd107403vboxsync pszExpr, pszFile, uLine, pszFunction);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# ifndef IN_RC /* flushing is done automatically in RC */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync RTLogFlush(pLog);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# endif
f78b12e570284aa8291f4ca1add24937fd107403vboxsync }
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# ifndef LOG_ENABLED
f78b12e570284aa8291f4ca1add24937fd107403vboxsync if (!pLog)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# endif
f78b12e570284aa8291f4ca1add24937fd107403vboxsync {
f78b12e570284aa8291f4ca1add24937fd107403vboxsync pLog = RTLogDefaultInstance();
f78b12e570284aa8291f4ca1add24937fd107403vboxsync if (pLog)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync {
f78b12e570284aa8291f4ca1add24937fd107403vboxsync RTLogPrintf("\n!!Assertion Failed!!\n"
f78b12e570284aa8291f4ca1add24937fd107403vboxsync "Expression: %s\n"
f78b12e570284aa8291f4ca1add24937fd107403vboxsync "Location : %s(%d) %s\n",
f78b12e570284aa8291f4ca1add24937fd107403vboxsync pszExpr, pszFile, uLine, pszFunction);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# ifndef IN_RC /* flushing is done automatically in RC */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync RTLogFlush(pLog);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# endif
f78b12e570284aa8291f4ca1add24937fd107403vboxsync }
f78b12e570284aa8291f4ca1add24937fd107403vboxsync }
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# ifdef IN_RING3
f78b12e570284aa8291f4ca1add24937fd107403vboxsync /* print to stderr, helps user and gdb debugging. */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync fprintf(stderr,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync "\n!!Assertion Failed!!\n"
f78b12e570284aa8291f4ca1add24937fd107403vboxsync "Expression: %s\n"
f78b12e570284aa8291f4ca1add24937fd107403vboxsync "Location : %s(%d) %s\n",
f78b12e570284aa8291f4ca1add24937fd107403vboxsync VALID_PTR(pszExpr) ? pszExpr : "<none>",
f78b12e570284aa8291f4ca1add24937fd107403vboxsync VALID_PTR(pszFile) ? pszFile : "<none>",
f78b12e570284aa8291f4ca1add24937fd107403vboxsync uLine,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync VALID_PTR(pszFunction) ? pszFunction : "");
f78b12e570284aa8291f4ca1add24937fd107403vboxsync fflush(stderr);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# endif
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#endif /* !IN_RING0 */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync }
f78b12e570284aa8291f4ca1add24937fd107403vboxsync}
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncRT_EXPORT_SYMBOL(RTAssertMsg1);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncRTDECL(void) RTAssertMsg2V(const char *pszFormat, va_list va)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync{
f78b12e570284aa8291f4ca1add24937fd107403vboxsync va_list vaCopy;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync /*
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * The global first.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync va_copy(vaCopy, va);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync RTStrPrintfV(g_szRTAssertMsg2, sizeof(g_szRTAssertMsg2), pszFormat, vaCopy);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync va_end(vaCopy);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync /*
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * If not quiet, make some noise.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync if (!RTAssertAreQuiet())
f78b12e570284aa8291f4ca1add24937fd107403vboxsync {
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#ifdef IN_RING0
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# ifdef IN_GUEST_R0
f78b12e570284aa8291f4ca1add24937fd107403vboxsync va_copy(vaCopy, va);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync RTLogBackdoorPrintfV(pszFormat, vaCopy);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync va_end(vaCopy);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# endif
f78b12e570284aa8291f4ca1add24937fd107403vboxsync /** @todo fully integrate this with the logger... play safe a bit for now. */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync rtR0AssertNativeMsg2V(pszFormat, va);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#else /* !IN_RING0 */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# if !defined(IN_RING3) && !defined(LOG_NO_COM)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync va_copy(vaCopy, va);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync RTLogComPrintfV(pszFormat, vaCopy);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync va_end(vaCopy);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# endif
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync PRTLOGGER pLog = RTLogRelDefaultInstance();
f78b12e570284aa8291f4ca1add24937fd107403vboxsync if (pLog)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync {
f78b12e570284aa8291f4ca1add24937fd107403vboxsync va_copy(vaCopy, va);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync RTLogRelPrintfV(pszFormat, vaCopy);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync va_end(vaCopy);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# ifndef IN_RC /* flushing is done automatically in RC */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync RTLogFlush(pLog);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# endif
f78b12e570284aa8291f4ca1add24937fd107403vboxsync }
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync pLog = RTLogDefaultInstance();
f78b12e570284aa8291f4ca1add24937fd107403vboxsync if (pLog)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync {
f78b12e570284aa8291f4ca1add24937fd107403vboxsync va_copy(vaCopy, va);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync RTLogPrintfV(pszFormat, vaCopy);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync va_end(vaCopy);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# ifndef IN_RC /* flushing is done automatically in RC */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync RTLogFlush(pLog);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#endif
f78b12e570284aa8291f4ca1add24937fd107403vboxsync }
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# ifdef IN_RING3
f78b12e570284aa8291f4ca1add24937fd107403vboxsync /* print to stderr, helps user and gdb debugging. */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync char szMsg[1024];
f78b12e570284aa8291f4ca1add24937fd107403vboxsync va_copy(vaCopy, va);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync RTStrPrintfV(szMsg, sizeof(szMsg), pszFormat, vaCopy);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync va_end(vaCopy);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync fprintf(stderr, "%s", szMsg);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync fflush(stderr);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# endif
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#endif /* !IN_RING0 */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync }
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync}
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncRT_EXPORT_SYMBOL(RTAssertMsg2V);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync