Changeset 96448 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Aug 23, 2022 10:35:23 PM (2 years ago)
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 3 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/Makefile.kmk
r96444 r96448 520 520 common/ldr/ldrPE.cpp \ 521 521 common/log/log.cpp \ 522 common/log/log-weak.cpp \ 523 common/log/log-weak-assert.cpp \ 524 common/log/log-weak-rel.cpp \ 522 525 common/log/logellipsis.cpp \ 523 526 common/log/logrel.cpp \ … … 2273 2276 common/ldr/ldrVfsFile.cpp \ 2274 2277 common/log/log.cpp \ 2278 common/log/log-weak.cpp \ 2279 common/log/log-weak-assert.cpp \ 2280 common/log/log-weak-rel.cpp \ 2275 2281 common/log/logellipsis.cpp \ 2276 2282 common/log/logformat.cpp \ … … 3428 3434 common/err/errinfo.cpp \ 3429 3435 common/log/log.cpp \ 3436 common/log/log-weak.cpp \ 3437 common/log/log-weak-assert.cpp \ 3438 common/log/log-weak-rel.cpp \ 3430 3439 common/log/logellipsis.cpp \ 3431 3440 common/log/logrel.cpp \ … … 4172 4181 common/checksum/crc64.cpp \ 4173 4182 common/log/log.cpp \ 4183 common/log/log-weak.cpp \ 4184 common/log/log-weak-assert.cpp \ 4185 common/log/log-weak-rel.cpp \ 4174 4186 common/log/logellipsis.cpp \ 4175 4187 common/log/logrel.cpp \ -
trunk/src/VBox/Runtime/common/err/errinfolog.cpp
r96407 r96448 52 52 if (fFlags & RTERRINFO_LOG_F_RELEASE) 53 53 { 54 PRTLOGGER pLogger = RTLogRelGetDefaultInstanceEx (RT_MAKE_U32(RTLOGGRPFLAGS_LEVEL_1, iLogGroup));54 PRTLOGGER pLogger = RTLogRelGetDefaultInstanceExWeak(RT_MAKE_U32(RTLOGGRPFLAGS_LEVEL_1, iLogGroup)); 55 55 if (pLogger) 56 RTLogLoggerEx (pLogger, RTLOGGRPFLAGS_LEVEL_1, iLogGroup, "RTErrInfoSet(%Rrc): %s\n", rc, pszMsg);56 RTLogLoggerExWeak(pLogger, RTLOGGRPFLAGS_LEVEL_1, iLogGroup, "RTErrInfoSet(%Rrc): %s\n", rc, pszMsg); 57 57 } 58 58 59 PRTLOGGER pLogger = RTLogGetDefaultInstanceEx (RT_MAKE_U32(RTLOGGRPFLAGS_LEVEL_1, iLogGroup));59 PRTLOGGER pLogger = RTLogGetDefaultInstanceExWeak(RT_MAKE_U32(RTLOGGRPFLAGS_LEVEL_1, iLogGroup)); 60 60 if (pLogger) 61 RTLogLoggerEx (pLogger, RTLOGGRPFLAGS_LEVEL_1, iLogGroup, "RTErrInfoSet(%Rrc): %s\n", rc, pszMsg);61 RTLogLoggerExWeak(pLogger, RTLOGGRPFLAGS_LEVEL_1, iLogGroup, "RTErrInfoSet(%Rrc): %s\n", rc, pszMsg); 62 62 63 63 /* The setting: */ … … 90 90 if (fFlags & RTERRINFO_LOG_F_RELEASE) 91 91 { 92 PRTLOGGER pLogger = RTLogRelGetDefaultInstanceEx (RT_MAKE_U32(RTLOGGRPFLAGS_LEVEL_1, iLogGroup));92 PRTLOGGER pLogger = RTLogRelGetDefaultInstanceExWeak(RT_MAKE_U32(RTLOGGRPFLAGS_LEVEL_1, iLogGroup)); 93 93 if (pLogger) 94 RTLogLoggerEx (pLogger, RTLOGGRPFLAGS_LEVEL_1, iLogGroup, "RTErrInfoSet(%Rrc): %N\n", rc, pszFormat, &va);94 RTLogLoggerExWeak(pLogger, RTLOGGRPFLAGS_LEVEL_1, iLogGroup, "RTErrInfoSet(%Rrc): %N\n", rc, pszFormat, &va); 95 95 } 96 96 97 PRTLOGGER pLogger = RTLogGetDefaultInstanceEx (RT_MAKE_U32(RTLOGGRPFLAGS_LEVEL_1, iLogGroup));97 PRTLOGGER pLogger = RTLogGetDefaultInstanceExWeak(RT_MAKE_U32(RTLOGGRPFLAGS_LEVEL_1, iLogGroup)); 98 98 if (pLogger) 99 RTLogLoggerEx (pLogger, RTLOGGRPFLAGS_LEVEL_1, iLogGroup, "RTErrInfoSet(%Rrc): %N\n", rc, pszFormat, &va);99 RTLogLoggerExWeak(pLogger, RTLOGGRPFLAGS_LEVEL_1, iLogGroup, "RTErrInfoSet(%Rrc): %N\n", rc, pszFormat, &va); 100 100 101 101 /* The setting: */ … … 131 131 if (fFlags & RTERRINFO_LOG_F_RELEASE) 132 132 { 133 PRTLOGGER pLogger = RTLogRelGetDefaultInstanceEx (RT_MAKE_U32(RTLOGGRPFLAGS_LEVEL_1, iLogGroup));133 PRTLOGGER pLogger = RTLogRelGetDefaultInstanceExWeak(RT_MAKE_U32(RTLOGGRPFLAGS_LEVEL_1, iLogGroup)); 134 134 if (pLogger) 135 RTLogLoggerEx (pLogger, RTLOGGRPFLAGS_LEVEL_1, iLogGroup, "RTErrInfoAdd(%Rrc): %s\n", rc, pszMsg);135 RTLogLoggerExWeak(pLogger, RTLOGGRPFLAGS_LEVEL_1, iLogGroup, "RTErrInfoAdd(%Rrc): %s\n", rc, pszMsg); 136 136 } 137 137 138 PRTLOGGER pLogger = RTLogGetDefaultInstanceEx (RT_MAKE_U32(RTLOGGRPFLAGS_LEVEL_1, iLogGroup));138 PRTLOGGER pLogger = RTLogGetDefaultInstanceExWeak(RT_MAKE_U32(RTLOGGRPFLAGS_LEVEL_1, iLogGroup)); 139 139 if (pLogger) 140 RTLogLoggerEx (pLogger, RTLOGGRPFLAGS_LEVEL_1, iLogGroup, "RTErrInfoAdd(%Rrc): %s\n", rc, pszMsg);140 RTLogLoggerExWeak(pLogger, RTLOGGRPFLAGS_LEVEL_1, iLogGroup, "RTErrInfoAdd(%Rrc): %s\n", rc, pszMsg); 141 141 142 142 return rc; … … 182 182 if (fFlags & RTERRINFO_LOG_F_RELEASE) 183 183 { 184 PRTLOGGER pLogger = RTLogRelGetDefaultInstanceEx (RT_MAKE_U32(RTLOGGRPFLAGS_LEVEL_1, iLogGroup));184 PRTLOGGER pLogger = RTLogRelGetDefaultInstanceExWeak(RT_MAKE_U32(RTLOGGRPFLAGS_LEVEL_1, iLogGroup)); 185 185 if (pLogger) 186 RTLogLoggerEx (pLogger, RTLOGGRPFLAGS_LEVEL_1, iLogGroup, "RTErrInfoAdd(%Rrc): %N\n", rc, pszFormat, &va);186 RTLogLoggerExWeak(pLogger, RTLOGGRPFLAGS_LEVEL_1, iLogGroup, "RTErrInfoAdd(%Rrc): %N\n", rc, pszFormat, &va); 187 187 } 188 188 189 PRTLOGGER pLogger = RTLogGetDefaultInstanceEx (RT_MAKE_U32(RTLOGGRPFLAGS_LEVEL_1, iLogGroup));189 PRTLOGGER pLogger = RTLogGetDefaultInstanceExWeak(RT_MAKE_U32(RTLOGGRPFLAGS_LEVEL_1, iLogGroup)); 190 190 if (pLogger) 191 RTLogLoggerEx (pLogger, RTLOGGRPFLAGS_LEVEL_1, iLogGroup, "RTErrInfoAdd(%Rrc): %N\n", rc, pszFormat, &va);191 RTLogLoggerExWeak(pLogger, RTLOGGRPFLAGS_LEVEL_1, iLogGroup, "RTErrInfoAdd(%Rrc): %N\n", rc, pszFormat, &va); 192 192 193 193 return rc; -
trunk/src/VBox/Runtime/common/log/log.cpp
r96407 r96448 600 600 RTDECL(PRTLOGGER) RTLogSetDefaultInstance(PRTLOGGER pLogger) 601 601 { 602 #if defined(IN_RING3) && (defined(IN_RT_STATIC) || defined(IPRT_NO_CRT)) 603 /* Set the pointers for emulating "weak symbols" the first time we're 604 called with something useful: */ 605 if (pLogger != NULL && g_pfnRTLogGetDefaultInstanceEx == NULL) 606 { 607 g_pfnRTLogGetDefaultInstance = RTLogGetDefaultInstance; 608 g_pfnRTLogGetDefaultInstanceEx = RTLogGetDefaultInstanceEx; 609 } 610 #endif 602 611 return ASMAtomicXchgPtrT(&g_pLogger, pLogger, PRTLOGGER); 603 612 } … … 717 726 RTDECL(PRTLOGGER) RTLogRelSetDefaultInstance(PRTLOGGER pLogger) 718 727 { 728 #if defined(IN_RING3) && (defined(IN_RT_STATIC) || defined(IPRT_NO_CRT)) 729 /* Set the pointers for emulating "weak symbols" the first time we're 730 called with something useful: */ 731 if (pLogger != NULL && g_pfnRTLogRelGetDefaultInstanceEx == NULL) 732 { 733 g_pfnRTLogRelGetDefaultInstance = RTLogRelGetDefaultInstance; 734 g_pfnRTLogRelGetDefaultInstanceEx = RTLogRelGetDefaultInstanceEx; 735 } 736 #endif 719 737 return ASMAtomicXchgPtrT(&g_pRelLogger, pLogger, PRTLOGGER); 720 738 } … … 1446 1464 pLoggerInt->fCreated = true; 1447 1465 *ppLogger = &pLoggerInt->Core; 1466 1467 # if defined(IN_RING3) && (defined(IN_RT_STATIC) || defined(IPRT_NO_CRT)) 1468 /* Make sure the weak symbol emulation bits are ready before returning. */ 1469 if (!g_pfnRTLogLoggerExV) 1470 g_pfnRTLogLoggerExV = RTLogLoggerExV; 1471 # endif 1448 1472 return VINF_SUCCESS; 1449 1473 } … … 4328 4352 RT_EXPORT_SYMBOL(RTLogDumpPrintfV); 4329 4353 4354 4355 RTDECL(void) RTLogAssert(const char *pszFormat, ...) 4356 { 4357 va_list va; 4358 va_start(va, pszFormat); 4359 RTLogAssertV(pszFormat,va); 4360 va_end(va); 4361 } 4362 4363 4364 RTDECL(void) RTLogAssertV(const char *pszFormat, va_list va) 4365 { 4366 /* 4367 * To the release log if we got one. 4368 */ 4369 PRTLOGGER pLogger = RTLogRelGetDefaultInstance(); 4370 if (pLogger) 4371 { 4372 va_list vaCopy; 4373 va_copy(vaCopy, va); 4374 RTLogLoggerExV(pLogger, 0 /*fFlags*/, ~0U /*uGroup*/, pszFormat, vaCopy); 4375 va_end(vaCopy); 4376 #ifndef IN_RC 4377 RTLogFlush(pLogger); 4378 #endif 4379 } 4380 4381 /* 4382 * To the debug log if we got one, however when LOG_ENABLE (debug builds and 4383 * such) we'll allow it to be created here. 4384 */ 4385 #ifdef LOG_ENABLED 4386 pLogger = RTLogDefaultInstance(); 4387 #else 4388 pLogger = RTLogGetDefaultInstance(); 4389 #endif 4390 if (pLogger) 4391 { 4392 RTLogLoggerExV(pLogger, 0 /*fFlags*/, ~0U /*uGroup*/, pszFormat, va); 4393 # ifndef IN_RC /* flushing is done automatically in RC */ 4394 RTLogFlush(pLogger); 4395 #endif 4396 } 4397 } 4398 4399 4400 #if defined(IN_RING3) && (defined(IN_RT_STATIC) || defined(IPRT_NO_CRT)) 4401 /** 4402 * "Weak symbol" emulation to prevent dragging in log.cpp and all its friends 4403 * just because some code is using Assert() in a statically linked binary. 4404 * 4405 * The pointers are in log-assert-pfn.cpp, so users only drag in that file and 4406 * they remain NULL unless this file is also linked into the binary. 4407 */ 4408 class RTLogAssertWeakSymbolEmulator 4409 { 4410 public: 4411 RTLogAssertWeakSymbolEmulator(void) 4412 { 4413 g_pfnRTLogAssert = RTLogAssert; 4414 g_pfnRTLogAssertV = RTLogAssertV; 4415 } 4416 }; 4417 static RTLogAssertWeakSymbolEmulator rtLogInitWeakSymbolPointers; 4418 #endif 4419 4420 4330 4421 #ifdef IN_RING3 4331 4422 -
trunk/src/VBox/Runtime/common/misc/assert.cpp
r96407 r96448 186 186 187 187 #else /* !IN_RING0 */ 188 # if !defined(IN_RING3) && !defined(LOG_NO_COM) 189 # if 0 /* Enable this iff you have a COM port and really want this debug info. */ 190 RTLogComPrintf("\n!!Assertion Failed!!\n" 191 "Expression: %s\n" 192 "Location : %s(%d) %s\n", 193 pszExpr, pszFile, uLine, pszFunction); 194 # endif 195 # endif 196 197 PRTLOGGER pLog = RTLogRelGetDefaultInstance(); 198 if (pLog) 199 { 200 RTLogRelPrintf("\n!!Assertion Failed!!\n" 201 "Expression: %s\n" 202 "Location : %s(%d) %s\n", 203 pszExpr, pszFile, uLine, pszFunction); 188 189 190 # if defined(IN_RING3) && (defined(IN_RT_STATIC) || defined(IPRT_NO_CRT)) /* ugly */ 191 if (g_pfnRTLogAssert) 192 g_pfnRTLogAssert( 193 # else 194 RTLogAssert( 195 # endif 196 "\n!!Assertion Failed!!\n" 197 "Expression: %s\n" 198 "Location : %s(%d) %s\n" 204 199 # ifdef IPRT_WITH_ASSERT_STACK 205 RTLogRelPrintf("Stack :\n%s\n", szStack); 206 # endif 207 # ifndef IN_RC /* flushing is done automatically in RC */ 208 RTLogFlush(pLog); 209 # endif 210 } 211 212 # ifndef LOG_ENABLED 213 if (!pLog) 214 # endif 215 { 216 pLog = RTLogDefaultInstance(); 217 if (pLog) 218 { 219 RTLogPrintf("\n!!Assertion Failed!!\n" 220 "Expression: %s\n" 221 "Location : %s(%d) %s\n", 222 pszExpr, pszFile, uLine, pszFunction); 200 "Stack :\n%s\n" 201 # endif 202 , pszExpr, pszFile, uLine, pszFunction 223 203 # ifdef IPRT_WITH_ASSERT_STACK 224 RTLogPrintf("Stack :\n%s\n", szStack); 225 # endif 226 # ifndef IN_RC /* flushing is done automatically in RC */ 227 RTLogFlush(pLog); 228 # endif 229 } 230 } 204 , szStack 205 # endif 206 ); 231 207 232 208 # ifdef IN_RING3 … … 323 299 324 300 #else /* !IN_RING0 */ 325 # if !defined(IN_RING3) && !defined(LOG_NO_COM) 326 # if 0 /* Enable this iff you have a COM port and really want this debug info. */ 327 va_copy(vaCopy, va); 328 RTLogComPrintfV(pszFormat, vaCopy); 329 va_end(vaCopy); 330 # endif 331 # endif 332 333 PRTLOGGER pLog = RTLogRelGetDefaultInstance(); 334 if (pLog) 301 302 # if defined(IN_RING3) && (defined(IN_RT_STATIC) || defined(IPRT_NO_CRT)) 303 if (g_pfnRTLogAssert) 304 # endif 335 305 { 336 306 va_copy(vaCopy, va); 337 RTLogRelPrintfV(pszFormat, vaCopy); 307 # if defined(IN_RING3) && (defined(IN_RT_STATIC) || defined(IPRT_NO_CRT)) 308 g_pfnRTLogAssertV(pszFormat, vaCopy); 309 # else 310 RTLogAssertV(pszFormat, vaCopy); 311 # endif 338 312 va_end(vaCopy); 339 # ifndef IN_RC /* flushing is done automatically in RC */340 RTLogFlush(pLog);341 # endif342 }343 344 pLog = RTLogDefaultInstance();345 if (pLog)346 {347 va_copy(vaCopy, va);348 RTLogPrintfV(pszFormat, vaCopy);349 va_end(vaCopy);350 # ifndef IN_RC /* flushing is done automatically in RC */351 RTLogFlush(pLog);352 #endif353 313 } 354 314 -
trunk/src/VBox/Runtime/r3/win/init-win.cpp
r96407 r96448 576 576 * Try get the logger and log exception details. 577 577 * 578 * Note! We'll be using RTLogLogger for now, though we should probably add578 * Note! We'll be using RTLogLoggerWeak for now, though we should probably add 579 579 * a less deadlock prone API here and gives up pretty fast if it 580 580 * cannot get the lock... 581 581 */ 582 PRTLOGGER pLogger = RTLogRelGetDefaultInstance ();582 PRTLOGGER pLogger = RTLogRelGetDefaultInstanceWeak(); 583 583 if (!pLogger) 584 pLogger = RTLogGetDefaultInstance ();584 pLogger = RTLogGetDefaultInstanceWeak(); 585 585 if (pLogger) 586 586 { 587 RTLogLogger (pLogger, NULL, "\n!!! rtR3WinUnhandledXcptFilter caught an exception on thread %p in %u !!!\n",588 RTThreadNativeSelf(), RTProcSelf());587 RTLogLoggerWeak(pLogger, NULL, "\n!!! rtR3WinUnhandledXcptFilter caught an exception on thread %p in %u !!!\n", 588 RTThreadNativeSelf(), RTProcSelf()); 589 589 590 590 /* … … 595 595 if (pXcptRec) 596 596 { 597 RTLogLogger (pLogger, NULL, "\nExceptionCode=%#010x ExceptionFlags=%#010x ExceptionAddress=%p\n",598 pXcptRec->ExceptionCode, pXcptRec->ExceptionFlags, pXcptRec->ExceptionAddress);597 RTLogLoggerWeak(pLogger, NULL, "\nExceptionCode=%#010x ExceptionFlags=%#010x ExceptionAddress=%p\n", 598 pXcptRec->ExceptionCode, pXcptRec->ExceptionFlags, pXcptRec->ExceptionAddress); 599 599 for (uint32_t i = 0; i < RT_MIN(pXcptRec->NumberParameters, EXCEPTION_MAXIMUM_PARAMETERS); i++) 600 RTLogLogger (pLogger, NULL, "ExceptionInformation[%d]=%p\n", i, pXcptRec->ExceptionInformation[i]);600 RTLogLoggerWeak(pLogger, NULL, "ExceptionInformation[%d]=%p\n", i, pXcptRec->ExceptionInformation[i]); 601 601 uXcptPC = (uintptr_t)pXcptRec->ExceptionAddress; 602 602 … … 605 605 if (RT_VALID_PTR(pNestedRec)) 606 606 { 607 RTLogLogger (pLogger, NULL, "Nested: ExceptionCode=%#010x ExceptionFlags=%#010x ExceptionAddress=%p (nested %p)\n",608 pNestedRec->ExceptionCode, pNestedRec->ExceptionFlags, pNestedRec->ExceptionAddress,609 pNestedRec->ExceptionRecord);607 RTLogLoggerWeak(pLogger, NULL, "Nested: ExceptionCode=%#010x ExceptionFlags=%#010x ExceptionAddress=%p (nested %p)\n", 608 pNestedRec->ExceptionCode, pNestedRec->ExceptionFlags, pNestedRec->ExceptionAddress, 609 pNestedRec->ExceptionRecord); 610 610 for (uint32_t i = 0; i < RT_MIN(pNestedRec->NumberParameters, EXCEPTION_MAXIMUM_PARAMETERS); i++) 611 RTLogLogger (pLogger, NULL, "Nested: ExceptionInformation[%d]=%p\n", i, pNestedRec->ExceptionInformation[i]);611 RTLogLoggerWeak(pLogger, NULL, "Nested: ExceptionInformation[%d]=%p\n", i, pNestedRec->ExceptionInformation[i]); 612 612 uXcptPC = (uintptr_t)pNestedRec->ExceptionAddress; 613 613 } … … 623 623 { 624 624 #ifdef RT_ARCH_AMD64 625 RTLogLogger (pLogger, NULL, "\ncs:rip=%04x:%016RX64\n", pXcptCtx->SegCs, pXcptCtx->Rip);626 RTLogLogger (pLogger, NULL, "ss:rsp=%04x:%016RX64 rbp=%016RX64\n", pXcptCtx->SegSs, pXcptCtx->Rsp, pXcptCtx->Rbp);627 RTLogLogger (pLogger, NULL, "rax=%016RX64 rcx=%016RX64 rdx=%016RX64 rbx=%016RX64\n",628 pXcptCtx->Rax, pXcptCtx->Rcx, pXcptCtx->Rdx, pXcptCtx->Rbx);629 RTLogLogger (pLogger, NULL, "rsi=%016RX64 rdi=%016RX64 rsp=%016RX64 rbp=%016RX64\n",630 pXcptCtx->Rsi, pXcptCtx->Rdi, pXcptCtx->Rsp, pXcptCtx->Rbp);631 RTLogLogger (pLogger, NULL, "r8 =%016RX64 r9 =%016RX64 r10=%016RX64 r11=%016RX64\n",632 pXcptCtx->R8, pXcptCtx->R9, pXcptCtx->R10, pXcptCtx->R11);633 RTLogLogger (pLogger, NULL, "r12=%016RX64 r13=%016RX64 r14=%016RX64 r15=%016RX64\n",634 pXcptCtx->R12, pXcptCtx->R13, pXcptCtx->R14, pXcptCtx->R15);635 RTLogLogger (pLogger, NULL, "ds=%04x es=%04x fs=%04x gs=%04x eflags=%08x\n",636 pXcptCtx->SegDs, pXcptCtx->SegEs, pXcptCtx->SegFs, pXcptCtx->SegGs, pXcptCtx->EFlags);637 RTLogLogger (pLogger, NULL, "p1home=%016RX64 p2home=%016RX64 pe3home=%016RX64\n",638 pXcptCtx->P1Home, pXcptCtx->P2Home, pXcptCtx->P3Home);639 RTLogLogger (pLogger, NULL, "p4home=%016RX64 p5home=%016RX64 pe6home=%016RX64\n",640 pXcptCtx->P4Home, pXcptCtx->P5Home, pXcptCtx->P6Home);641 RTLogLogger (pLogger, NULL, " LastBranchToRip=%016RX64 LastBranchFromRip=%016RX64\n",642 pXcptCtx->LastBranchToRip, pXcptCtx->LastBranchFromRip);643 RTLogLogger (pLogger, NULL, "LastExceptionToRip=%016RX64 LastExceptionFromRip=%016RX64\n",644 pXcptCtx->LastExceptionToRip, pXcptCtx->LastExceptionFromRip);625 RTLogLoggerWeak(pLogger, NULL, "\ncs:rip=%04x:%016RX64\n", pXcptCtx->SegCs, pXcptCtx->Rip); 626 RTLogLoggerWeak(pLogger, NULL, "ss:rsp=%04x:%016RX64 rbp=%016RX64\n", pXcptCtx->SegSs, pXcptCtx->Rsp, pXcptCtx->Rbp); 627 RTLogLoggerWeak(pLogger, NULL, "rax=%016RX64 rcx=%016RX64 rdx=%016RX64 rbx=%016RX64\n", 628 pXcptCtx->Rax, pXcptCtx->Rcx, pXcptCtx->Rdx, pXcptCtx->Rbx); 629 RTLogLoggerWeak(pLogger, NULL, "rsi=%016RX64 rdi=%016RX64 rsp=%016RX64 rbp=%016RX64\n", 630 pXcptCtx->Rsi, pXcptCtx->Rdi, pXcptCtx->Rsp, pXcptCtx->Rbp); 631 RTLogLoggerWeak(pLogger, NULL, "r8 =%016RX64 r9 =%016RX64 r10=%016RX64 r11=%016RX64\n", 632 pXcptCtx->R8, pXcptCtx->R9, pXcptCtx->R10, pXcptCtx->R11); 633 RTLogLoggerWeak(pLogger, NULL, "r12=%016RX64 r13=%016RX64 r14=%016RX64 r15=%016RX64\n", 634 pXcptCtx->R12, pXcptCtx->R13, pXcptCtx->R14, pXcptCtx->R15); 635 RTLogLoggerWeak(pLogger, NULL, "ds=%04x es=%04x fs=%04x gs=%04x eflags=%08x\n", 636 pXcptCtx->SegDs, pXcptCtx->SegEs, pXcptCtx->SegFs, pXcptCtx->SegGs, pXcptCtx->EFlags); 637 RTLogLoggerWeak(pLogger, NULL, "p1home=%016RX64 p2home=%016RX64 pe3home=%016RX64\n", 638 pXcptCtx->P1Home, pXcptCtx->P2Home, pXcptCtx->P3Home); 639 RTLogLoggerWeak(pLogger, NULL, "p4home=%016RX64 p5home=%016RX64 pe6home=%016RX64\n", 640 pXcptCtx->P4Home, pXcptCtx->P5Home, pXcptCtx->P6Home); 641 RTLogLoggerWeak(pLogger, NULL, " LastBranchToRip=%016RX64 LastBranchFromRip=%016RX64\n", 642 pXcptCtx->LastBranchToRip, pXcptCtx->LastBranchFromRip); 643 RTLogLoggerWeak(pLogger, NULL, "LastExceptionToRip=%016RX64 LastExceptionFromRip=%016RX64\n", 644 pXcptCtx->LastExceptionToRip, pXcptCtx->LastExceptionFromRip); 645 645 uXcptSP = pXcptCtx->Rsp; 646 646 uXcptPC = pXcptCtx->Rip; 647 647 648 648 #elif defined(RT_ARCH_X86) 649 RTLogLogger (pLogger, NULL, "\ncs:eip=%04x:%08RX32\n", pXcptCtx->SegCs, pXcptCtx->Eip);650 RTLogLogger (pLogger, NULL, "ss:esp=%04x:%08RX32 ebp=%08RX32\n", pXcptCtx->SegSs, pXcptCtx->Esp, pXcptCtx->Ebp);651 RTLogLogger (pLogger, NULL, "eax=%08RX32 ecx=%08RX32 edx=%08RX32 ebx=%08RX32\n",652 pXcptCtx->Eax, pXcptCtx->Ecx, pXcptCtx->Edx, pXcptCtx->Ebx);653 RTLogLogger (pLogger, NULL, "esi=%08RX32 edi=%08RX32 esp=%08RX32 ebp=%08RX32\n",654 pXcptCtx->Esi, pXcptCtx->Edi, pXcptCtx->Esp, pXcptCtx->Ebp);655 RTLogLogger (pLogger, NULL, "ds=%04x es=%04x fs=%04x gs=%04x eflags=%08x\n",656 pXcptCtx->SegDs, pXcptCtx->SegEs, pXcptCtx->SegFs, pXcptCtx->SegGs, pXcptCtx->EFlags);649 RTLogLoggerWeak(pLogger, NULL, "\ncs:eip=%04x:%08RX32\n", pXcptCtx->SegCs, pXcptCtx->Eip); 650 RTLogLoggerWeak(pLogger, NULL, "ss:esp=%04x:%08RX32 ebp=%08RX32\n", pXcptCtx->SegSs, pXcptCtx->Esp, pXcptCtx->Ebp); 651 RTLogLoggerWeak(pLogger, NULL, "eax=%08RX32 ecx=%08RX32 edx=%08RX32 ebx=%08RX32\n", 652 pXcptCtx->Eax, pXcptCtx->Ecx, pXcptCtx->Edx, pXcptCtx->Ebx); 653 RTLogLoggerWeak(pLogger, NULL, "esi=%08RX32 edi=%08RX32 esp=%08RX32 ebp=%08RX32\n", 654 pXcptCtx->Esi, pXcptCtx->Edi, pXcptCtx->Esp, pXcptCtx->Ebp); 655 RTLogLoggerWeak(pLogger, NULL, "ds=%04x es=%04x fs=%04x gs=%04x eflags=%08x\n", 656 pXcptCtx->SegDs, pXcptCtx->SegEs, pXcptCtx->SegFs, pXcptCtx->SegGs, pXcptCtx->EFlags); 657 657 uXcptSP = pXcptCtx->Esp; 658 658 uXcptPC = pXcptCtx->Eip; … … 682 682 } 683 683 684 RTLogLogger (pLogger, NULL, "\nStack %p, dumping %#x bytes (low=%p, high=%p)\n", uStack, cbToDump, uLow, uHigh);685 RTLogLogger (pLogger, NULL, "%.*RhxD\n", cbToDump, uStack);684 RTLogLoggerWeak(pLogger, NULL, "\nStack %p, dumping %#x bytes (low=%p, high=%p)\n", uStack, cbToDump, uLow, uHigh); 685 RTLogLoggerWeak(pLogger, NULL, "%.*RhxD\n", cbToDump, uStack); 686 686 687 687 /* … … 691 691 * is why it's at the end. 692 692 */ 693 RTLogLogger (pLogger, NULL, "Thread ID: %p\n", RTThreadNativeSelf());694 RTLogLogger (pLogger, NULL, "Thread name: %s\n", RTThreadSelfName());695 RTLogLogger (pLogger, NULL, "Thread IPRT: %p\n", RTThreadSelf());693 RTLogLoggerWeak(pLogger, NULL, "Thread ID: %p\n", RTThreadNativeSelf()); 694 RTLogLoggerWeak(pLogger, NULL, "Thread name: %s\n", RTThreadSelfName()); 695 RTLogLoggerWeak(pLogger, NULL, "Thread IPRT: %p\n", RTThreadSelf()); 696 696 697 697 /* … … 708 708 LIST_ENTRY *pListEntry = pList->Flink; 709 709 uint32_t cLoops = 0; 710 RTLogLogger (pLogger, NULL,711 "\nLoaded Modules:\n"712 "%-*s[*] Timestamp Path\n", sizeof(void *) * 4 + 2 - 1, "Address range"713 );710 RTLogLoggerWeak(pLogger, NULL, 711 "\nLoaded Modules:\n" 712 "%-*s[*] Timestamp Path\n", sizeof(void *) * 4 + 2 - 1, "Address range" 713 ); 714 714 while (pListEntry != pList && RT_VALID_PTR(pListEntry) && cLoops < 1024) 715 715 { … … 728 728 && (pLdrEntry->FullDllName.Length & 1) == 0 729 729 && pLdrEntry->FullDllName.Length <= pLdrEntry->FullDllName.MaximumLength) 730 RTLogLogger (pLogger, NULL, "%p..%p%c %08RX32 %.*ls\n",731 pLdrEntry->DllBase, (uintptr_t)pLdrEntry->DllBase + cbLength - 1, chInd,732 pLdrEntry->TimeDateStamp, pLdrEntry->FullDllName.Length / sizeof(RTUTF16),733 pLdrEntry->FullDllName.Buffer);730 RTLogLoggerWeak(pLogger, NULL, "%p..%p%c %08RX32 %.*ls\n", 731 pLdrEntry->DllBase, (uintptr_t)pLdrEntry->DllBase + cbLength - 1, chInd, 732 pLdrEntry->TimeDateStamp, pLdrEntry->FullDllName.Length / sizeof(RTUTF16), 733 pLdrEntry->FullDllName.Buffer); 734 734 else 735 RTLogLogger (pLogger, NULL, "%p..%p%c %08RX32 <bad or missing: %p LB %#x max %#x\n",736 pLdrEntry->DllBase, (uintptr_t)pLdrEntry->DllBase + cbLength - 1, chInd,737 pLdrEntry->TimeDateStamp, pLdrEntry->FullDllName.Buffer, pLdrEntry->FullDllName.Length,738 pLdrEntry->FullDllName.MaximumLength);735 RTLogLoggerWeak(pLogger, NULL, "%p..%p%c %08RX32 <bad or missing: %p LB %#x max %#x\n", 736 pLdrEntry->DllBase, (uintptr_t)pLdrEntry->DllBase + cbLength - 1, chInd, 737 pLdrEntry->TimeDateStamp, pLdrEntry->FullDllName.Buffer, pLdrEntry->FullDllName.Length, 738 pLdrEntry->FullDllName.MaximumLength); 739 739 740 740 /* advance */ … … 749 749 && uXcptSP - uStack < cbToDump) 750 750 { 751 RTLogLogger (pLogger, NULL, "\nPotential code addresses on the stack:\n");751 RTLogLoggerWeak(pLogger, NULL, "\nPotential code addresses on the stack:\n"); 752 752 if (pFound) 753 753 { … … 757 757 && (pFound->FullDllName.Length & 1) == 0 758 758 && pFound->FullDllName.Length <= pFound->FullDllName.MaximumLength) 759 RTLogLogger (pLogger, NULL, "%-*s: %p - %#010RX32 bytes into %.*ls\n",760 sizeof(void *) * 2, "Xcpt PC", uXcptPC, (uint32_t)(uXcptPC - (uintptr_t)pFound->DllBase),761 pFound->FullDllName.Length / sizeof(RTUTF16), pFound->FullDllName.Buffer);759 RTLogLoggerWeak(pLogger, NULL, "%-*s: %p - %#010RX32 bytes into %.*ls\n", 760 sizeof(void *) * 2, "Xcpt PC", uXcptPC, (uint32_t)(uXcptPC - (uintptr_t)pFound->DllBase), 761 pFound->FullDllName.Length / sizeof(RTUTF16), pFound->FullDllName.Buffer); 762 762 else 763 RTLogLogger (pLogger, NULL, "%-*s: %p - %08RX32 into module at %p\n",764 sizeof(void *) * 2, "Xcpt PC", uXcptPC, (uint32_t)(uXcptPC - (uintptr_t)pFound->DllBase),765 pFound->DllBase);763 RTLogLoggerWeak(pLogger, NULL, "%-*s: %p - %08RX32 into module at %p\n", 764 sizeof(void *) * 2, "Xcpt PC", uXcptPC, (uint32_t)(uXcptPC - (uintptr_t)pFound->DllBase), 765 pFound->DllBase); 766 766 } 767 767 … … 799 799 && (pFound->FullDllName.Length & 1) == 0 800 800 && pFound->FullDllName.Length <= pFound->FullDllName.MaximumLength) 801 RTLogLogger (pLogger, NULL, "%p: %p - %#010RX32 bytes into %.*ls\n",802 puStack, uPtr, (uint32_t)(uPtr - (uintptr_t)pFound->DllBase),803 pFound->FullDllName.Length / sizeof(RTUTF16), pFound->FullDllName.Buffer);801 RTLogLoggerWeak(pLogger, NULL, "%p: %p - %#010RX32 bytes into %.*ls\n", 802 puStack, uPtr, (uint32_t)(uPtr - (uintptr_t)pFound->DllBase), 803 pFound->FullDllName.Length / sizeof(RTUTF16), pFound->FullDllName.Buffer); 804 804 else 805 RTLogLogger (pLogger, NULL, "%p: %p - %08RX32 into module at %p\n",806 puStack, uPtr, (uint32_t)(uPtr - (uintptr_t)pFound->DllBase), pFound->DllBase);805 RTLogLoggerWeak(pLogger, NULL, "%p: %p - %08RX32 into module at %p\n", 806 puStack, uPtr, (uint32_t)(uPtr - (uintptr_t)pFound->DllBase), pFound->DllBase); 807 807 } 808 808 } … … 824 824 && !(pProcParams->CommandLine.Length & 1) 825 825 && !(pProcParams->CommandLine.MaximumLength & 1)) 826 RTLogLogger (pLogger, NULL, "PEB/CommandLine: %.*ls\n",827 pProcParams->CommandLine.Length / sizeof(RTUTF16), pProcParams->CommandLine.Buffer);826 RTLogLoggerWeak(pLogger, NULL, "PEB/CommandLine: %.*ls\n", 827 pProcParams->CommandLine.Length / sizeof(RTUTF16), pProcParams->CommandLine.Buffer); 828 828 } 829 829 }
Note:
See TracChangeset
for help on using the changeset viewer.