VirtualBox

source: vbox/trunk/src/VBox/Runtime/r0drv/solaris/assert-r0drv-solaris.c@ 4612

Last change on this file since 4612 was 4071, checked in by vboxsync, 18 years ago

Biggest check-in ever. New source code headers for all (C) innotek files.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.8 KB
Line 
1/* $Id: assert-r0drv-solaris.c 4071 2007-08-07 17:07:59Z vboxsync $ */
2/** @file
3 * innotek Portable Runtime - Assertion Workers, Ring-0 Drivers, Solaris.
4 */
5
6/*
7 * Copyright (C) 2006-2007 innotek GmbH
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License as published by the Free Software Foundation,
13 * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
14 * distribution. VirtualBox OSE is distributed in the hope that it will
15 * be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18
19/*******************************************************************************
20* Header Files *
21*******************************************************************************/
22#include "the-solaris-kernel.h"
23
24#include <iprt/assert.h>
25#include <iprt/log.h>
26#include <iprt/string.h>
27#include <iprt/stdarg.h>
28
29
30RTDECL(void) AssertMsg1(const char *pszExpr, unsigned uLine, const char *pszFile, const char *pszFunction)
31{
32#ifdef IN_GUEST_R0
33 RTLogBackdoorPrintf("\n!!Assertion Failed!!\n"
34 "Expression: %s\n"
35 "Location : %s(%d) %s\n",
36 pszExpr, pszFile, uLine, pszFunction);
37#endif
38
39 printf("\r\n!!Assertion Failed!!\r\n"
40 "Expression: %s\r\n"
41 "Location : %s(%d) %s\r\n",
42 pszExpr, pszFile, uLine, pszFunction);
43}
44
45
46RTDECL(void) AssertMsg2(const char *pszFormat, ...)
47{
48 va_list va;
49 char szMsg[256];
50
51#ifdef IN_GUEST_R0
52 va_start(va, pszFormat);
53 RTLogBackdoorPrintfV(pszFormat, va);
54 va_end(va);
55#endif
56
57 va_start(va, pszFormat);
58 RTStrPrintfV(szMsg, sizeof(szMsg) - 1, pszFormat, va);
59 szMsg[sizeof(szMsg) - 1] = '\0';
60 va_end(va);
61 printf("%s", szMsg);
62}
63
Note: See TracBrowser for help on using the repository browser.

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