Changeset 13306 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Oct 15, 2008 9:17:04 PM (16 years ago)
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 6 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/Makefile.kmk
r13300 r13306 282 282 RuntimeR3_SOURCES += \ 283 283 VBox/strformat-vbox.cpp \ 284 VBox/RTAssert DoBreakpoint-vbox.cpp \284 VBox/RTAssertShouldPanic-vbox.cpp \ 285 285 VBox/log-vbox.cpp 286 286 ifneq ($(KBUILD_TARGET),win) … … 650 650 common/string/utf-16.cpp \ 651 651 generic/pathhost-generic.cpp \ 652 generic/RTAssert DoBreakpoint-generic.cpp \652 generic/RTAssertShouldPanic-generic.cpp \ 653 653 r3/alloc.cpp \ 654 654 r3/fileio.cpp \ … … 873 873 common/table/avlu32.cpp \ 874 874 common/time/timesup.cpp \ 875 generic/RTAssert DoBreakpoint-generic.cpp \875 generic/RTAssertShouldPanic-generic.cpp \ 876 876 VBox/strformat-vbox.cpp 877 877 … … 973 973 common/string/strpbrk.cpp \ 974 974 common/err/RTErrConvertToErrno.cpp \ 975 generic/RTAssert DoBreakpoint-generic.cpp \975 generic/RTAssertShouldPanic-generic.cpp \ 976 976 generic/RTLogWriteStdOut-stub-generic.cpp \ 977 977 generic/mppresent-generic.cpp \ … … 1007 1007 common/string/strncmp.cpp \ 1008 1008 common/string/strpbrk.cpp \ 1009 generic/RTAssert DoBreakpoint-generic.cpp \1009 generic/RTAssertShouldPanic-generic.cpp \ 1010 1010 generic/RTLogWriteStdOut-stub-generic.cpp \ 1011 1011 generic/mppresent-generic.cpp \ … … 1042 1042 darwin/RTErrConvertFromDarwinIO.cpp \ 1043 1043 darwin/RTErrConvertFromDarwinKern.cpp \ 1044 generic/RTAssert DoBreakpoint-generic.cpp \1044 generic/RTAssertShouldPanic-generic.cpp \ 1045 1045 generic/RTMpCpuId-generic.cpp \ 1046 1046 generic/RTMpCpuIdFromSetIndex-generic.cpp \ … … 1120 1120 r0drv/os2/os2imports.imp \ 1121 1121 r0drv/os2/process-r0drv-os2.cpp \ 1122 r0drv/os2/RT AssertDoBreakpoint-r0drv-os2.asm \1122 r0drv/os2/RTR0AssertPanicSystem-r0drv-os2.asm \ 1123 1123 r0drv/os2/RTR0Os2DHQueryDOSVar.asm \ 1124 1124 r0drv/os2/RTR0Os2DHVMGlobalToProcess.asm \ … … 1142 1142 common/string/memcmp.asm \ 1143 1143 common/string/strchr.asm \ 1144 generic/RTAssert DoBreakpoint-generic.cpp \1144 generic/RTAssertShouldPanic-generic.cpp \ 1145 1145 generic/RTLogWriteDebugger-generic.cpp \ 1146 1146 generic/RTLogWriteStdOut-stub-generic.cpp \ … … 1181 1181 common/misc/thread.cpp \ 1182 1182 common/string/memchr.asm \ 1183 generic/RTAssert DoBreakpoint-generic.cpp \1183 generic/RTAssertShouldPanic-generic.cpp \ 1184 1184 generic/RTLogWriteStdOut-stub-generic.cpp \ 1185 1185 generic/RTTimerCreate-generic.cpp \ … … 1261 1261 common/misc/thread.cpp \ 1262 1262 common/string/memchr.asm \ 1263 generic/RTAssert DoBreakpoint-generic.cpp \1263 generic/RTAssertShouldPanic-generic.cpp \ 1264 1264 generic/RTTimerCreate-generic.cpp \ 1265 1265 r0drv/memobj-r0drv.cpp \ … … 1344 1344 common/time/timesup.cpp \ 1345 1345 gc/initterm-gc.cpp \ 1346 generic/RTAssert DoBreakpoint-generic.cpp \1346 generic/RTAssertShouldPanic-generic.cpp \ 1347 1347 VBox/strformat-vbox.cpp \ 1348 1348 -
trunk/src/VBox/Runtime/VBox/RTAssertShouldPanic-vbox.cpp
r13298 r13306 1 1 /* $Id$ */ 2 2 /** @file 3 * IPRT - Assertions, generic RTAssert DoBreakpoint.3 * IPRT - Assertions, generic RTAssertShouldPanic. 4 4 */ 5 5 … … 56 56 57 57 58 RTDECL(bool) RTAssertDoBreakpoint(void)58 RTDECL(bool) RTAssertShouldPanic(void) 59 59 { 60 60 /* … … 67 67 return true; 68 68 69 /* 'breakpoint' means default behaviour. */70 if (!strcmp(psz, "breakpoint") )69 /* 'breakpoint' or 'panic' means default behaviour. */ 70 if (!strcmp(psz, "breakpoint") || !strcmp(psz, "panic")) 71 71 return true; 72 72 … … 82 82 /* Try find a suitable terminal program. */ 83 83 const char *pszTerm = RTEnvGet("VBOX_ASSERT_TERM"); 84 if ( !pszTerm 84 if ( !pszTerm 85 85 || !RTPathExists(pszTerm)) 86 86 { … … 91 91 if (!RTPathExists(pszTerm)) 92 92 { 93 pszTerm ="/usr/bin/xterm"; 93 pszTerm ="/usr/bin/xterm"; 94 94 if (!RTPathExists(pszTerm)) 95 95 return true; … … 100 100 /* And find gdb. */ 101 101 const char *pszGdb = RTEnvGet("VBOX_ASSERT_GDB"); 102 if ( !pszGdb 102 if ( !pszGdb 103 103 || !RTPathExists(pszGdb)) 104 104 { -
trunk/src/VBox/Runtime/VBox/VBoxRTDeps.cpp
r11794 r13306 34 34 #include <VBox/sup.h> 35 35 #include <iprt/system.h> 36 #include <iprt/assert.h> 36 37 37 38 … … 42 43 { 43 44 (PFNRT)SUPR3Init, 44 (PFNRT)SUPPageLock 45 (PFNRT)SUPPageLock, 46 (PFNRT)RTAssertShouldPanic 45 47 }; 48 -
trunk/src/VBox/Runtime/VBox/log-vbox.cpp
r10608 r13306 197 197 #define ASSERT_LOG_GROUP(grp) ASSERT_LOG_GROUP2(LOG_GROUP_##grp, #grp) 198 198 #define ASSERT_LOG_GROUP2(def, str) \ 199 do { if (strcmp(g_apszGroups[def], str)) {printf("%s='%s' expects '%s'\n", #def, g_apszGroups[def], str); AssertReleaseBreakpoint(); } } while (0)199 do { if (strcmp(g_apszGroups[def], str)) {printf("%s='%s' expects '%s'\n", #def, g_apszGroups[def], str); RTAssertDoPanic(); } } while (0) 200 200 ASSERT_LOG_GROUP(DEFAULT); 201 201 ASSERT_LOG_GROUP(CFGM); -
trunk/src/VBox/Runtime/generic/RTAssertShouldPanic-generic.cpp
r13298 r13306 1 1 /* $Id$ */ 2 2 /** @file 3 * IPRT - Assertions, generic RTAssert DoBreakpoint.3 * IPRT - Assertions, generic RTAssertShouldPanic. 4 4 */ 5 5 … … 29 29 */ 30 30 31 32 31 /******************************************************************************* 33 32 * Header Files * … … 36 35 37 36 38 /** 39 * Overridable function that decides whether assertions executes the breakpoint or not. 40 * 41 * The generic implementation will return true. 42 * 43 * @returns true if the breakpoint should be hit, false if it should be ignored. 44 * @remark The RTDECL() makes this a bit difficult to override on windows. Sorry. 45 */ 46 RTDECL(bool) RTAssertDoBreakpoint(void) 37 RTDECL(bool) RTAssertShouldPanic(void) 47 38 { 48 39 return true; -
trunk/src/VBox/Runtime/r0drv/darwin/assert-r0drv-darwin.cpp
r11645 r13306 44 44 *******************************************************************************/ 45 45 /** The last assert message, 1st part. */ 46 RTDATADECL(char) g_szRTAssertMsg1[1024];46 RTDATADECL(char) g_szRTAssertMsg1[1024]; 47 47 /** The last assert message, 2nd part. */ 48 RTDATADECL(char) g_szRTAssertMsg2[2048]; 48 RTDATADECL(char) g_szRTAssertMsg2[2048]; 49 /** The last assert message, file name. */ 50 RTDATADECL(const char *) volatile g_pszRTAssertFile; 51 /** The last assert message, line number. */ 52 RTDATADECL(uint32_t) volatile g_u32RTAssertLine; 53 /** The last assert message, function name. */ 54 RTDATADECL(const char *) volatile g_pszRTAssertFunction; 49 55 50 56 … … 68 74 "Location : %s(%d) %s\n", 69 75 pszExpr, pszFile, uLine, pszFunction); 76 ASMAtomicUoWritePtr(&g_pszRTAssertFile, pszFile); 77 ASMAtomicUoWriteU32(&g_u32RTAssertLine, uLine); 78 ASMAtomicUoWritePtr(&g_pszRTAssertFunction, pszFunction); 70 79 } 71 80 … … 91 100 RTStrPrintfV(g_szRTAssertMsg2, sizeof(g_szRTAssertMsg2), pszFormat, va); 92 101 va_end(va); 102 } 93 103 104 105 RTR0DECL(void) RTR0AssertPanicSystem(void) 106 { 94 107 panic("%s%s", g_szRTAssertMsg1, g_szRTAssertMsg2); 95 108 } -
trunk/src/VBox/Runtime/r0drv/os2/RTR0AssertPanicSystem-r0drv-os2.asm
r13298 r13306 1 1 ; $Id$ 2 2 ;; @file 3 ; IPRT - DevHelp_GetDOSVar, Ring-0 Driver, OS/2.3 ; IPRT - RTR0AssertPanicSystem, Ring-0 Driver, OS/2. 4 4 ; 5 5 … … 55 55 BEGINCODE 56 56 57 BEGINPROC_EXPORTED RT AssertDoBreakpoint57 BEGINPROC_EXPORTED RTR0AssertPanicSystem 58 58 push ebp 59 59 mov ebp, esp … … 71 71 ; 72 72 call KernThunkStackTo16 73 ;jmp far dword NAME(RT AssertDoBreakpoint_16) wrt CODE1673 ;jmp far dword NAME(RTR0AssertPanicSystem_16) wrt CODE16 74 74 db 066h 75 75 db 0eah 76 dw NAME(RT AssertDoBreakpoint_16) wrt CODE1676 dw NAME(RTR0AssertPanicSystem_16) wrt CODE16 77 77 dw CODE16 78 78 BEGINCODE16 79 GLOBALNAME RT AssertDoBreakpoint_1679 GLOBALNAME RTR0AssertPanicSystem_16 80 80 ; mov ax, seg NAME(g_szRTAssertMsg) - makes wlink crash. 81 81 mov ax, DATA16 … … 87 87 88 88 ; Doesn't normally return, but in case it does... 89 ;jmp far dword NAME(RT AssertDoBreakpoint_32)89 ;jmp far dword NAME(RTR0AssertPanicSystem_32) 90 90 db 066h 91 91 db 0eah 92 dd NAME(RT AssertDoBreakpoint_32)92 dd NAME(RTR0AssertPanicSystem_32) 93 93 dw TEXT32 wrt FLAT 94 94 BEGINCODE32: 95 GLOBALNAME RT AssertDoBreakpoint_3295 GLOBALNAME RTR0AssertPanicSystem_32 96 96 call KernThunkStackTo32 97 97 mov eax, 1 … … 101 101 leave 102 102 ret 103 ENDPROC RT AssertDoBreakpoint103 ENDPROC RTR0AssertPanicSystem 104 104 -
trunk/src/VBox/Runtime/r0drv/solaris/assert-r0drv-solaris.c
r8245 r13306 41 41 42 42 43 /******************************************************************************* 44 * Global Variables * 45 *******************************************************************************/ 46 /** The last assert message, 1st part. */ 47 RTDATADECL(char) g_szRTAssertMsg1[1024]; 48 /** The last assert message, 2nd part. */ 49 RTDATADECL(char) g_szRTAssertMsg2[2048]; 50 /** The last assert message, file name. */ 51 RTDATADECL(const char *) volatile g_pszRTAssertFile; 52 /** The last assert message, line number. */ 53 RTDATADECL(uint32_t) volatile g_u32RTAssertLine; 54 /** The last assert message, function name. */ 55 RTDATADECL(const char *) volatile g_pszRTAssertFunction; 56 57 43 58 RTDECL(void) AssertMsg1(const char *pszExpr, unsigned uLine, const char *pszFile, const char *pszFunction) 44 59 { … … 54 69 "Location : %s(%d) %s\r\n", 55 70 pszExpr, pszFile, uLine, pszFunction); 71 72 RTStrPrintf(g_szRTAssertMsg1, sizeof(g_szRTAssertMsg1), 73 "\n!!Assertion Failed!!\n" 74 "Expression: %s\n" 75 "Location : %s(%d) %s\n", 76 pszExpr, pszFile, uLine, pszFunction); 77 ASMAtomicUoWritePtr(&g_pszRTAssertFile, pszFile); 78 ASMAtomicUoWriteU32(&g_u32RTAssertLine, uLine); 79 ASMAtomicUoWritePtr(&g_pszRTAssertFunction, pszFunction); 56 80 } 57 81 … … 73 97 va_end(va); 74 98 uprintf("%s", szMsg); 99 100 va_start(va, pszFormat); 101 RTStrPrintfV(g_szRTAssertMsg2, sizeof(g_szRTAssertMsg2), pszFormat, va); 102 va_end(va); 75 103 } 76 104 105 106 RTR0DECL(void) RTR0AssertPanicSystem(void) 107 { 108 const char *psz = &g_szRTAssertMsg2[0]; 109 const char *pszEnd = &g_szRTAssertMsg2[sizeof(g_szRTAssertMsg2)]; 110 while (psz < pszEnd && (*psz == ' ' || *psz == '\t' || *psz == '\n' || *psz == '\r')) 111 psz++; 112 113 if (psz >= pszEnd || *psz) 114 assfail(psz, g_pszRTAssertFile, g_u32RTAssertLine); 115 else 116 assfail(g_szRTAssertMsg1, g_pszRTAssertFile, g_u32RTAssertLine); 117 } 118 -
trunk/src/VBox/Runtime/r3/alloc-ef.cpp
r11019 r13306 85 85 vfprintf(stderr, pszFormat, args); 86 86 va_end(args); 87 AssertReleaseBreakpoint();87 RTAssertDoPanic(); 88 88 } 89 89 … … 368 368 for (unsigned i = 0; i < ELEMENTS(gapvRTMemFreeWatch); i++) 369 369 if (gapvRTMemFreeWatch[i] == pv) 370 AssertReleaseBreakpoint();370 RTAssertDoPanic(); 371 371 372 372 #ifdef RTALLOC_EFENCE_TRACE
Note:
See TracChangeset
for help on using the changeset viewer.