Changeset 96448 in vbox
- Timestamp:
- Aug 23, 2022 10:35:23 PM (2 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/formats/pecoff.h
r96407 r96448 741 741 * @{ */ 742 742 /** No handler. 743 * @note A slo know as UNW_FLAG_NHANDLER. */743 * @note Also know as UNW_FLAG_NHANDLER. */ 744 744 #define IMAGE_UNW_FLAGS_NHANDLER 0 745 745 /** Have exception handler (RVA after codes, dword aligned.) 746 * @note A slo know as UNW_FLAG_NHANDLER. */746 * @note Also know as UNW_FLAG_NHANDLER. */ 747 747 #define IMAGE_UNW_FLAGS_EHANDLER 1 748 748 /** Have unwind handler (RVA after codes, dword aligned.) 749 * @note A slo know as UNW_FLAG_NHANDLER. */749 * @note Also know as UNW_FLAG_NHANDLER. */ 750 750 #define IMAGE_UNW_FLAGS_UHANDLER 2 751 751 /** Set if not primary unwind info for a function. An -
trunk/include/iprt/log.h
r96407 r96448 1352 1352 * Checks whether the specified release logging group is enabled or not. 1353 1353 */ 1354 #define LogRelIsItEnabled(a_fFlags, a_iGroup) ( RTLogRelGetDefaultInstanceEx (RT_MAKE_U32(a_fFlags, a_iGroup)) != NULL )1354 #define LogRelIsItEnabled(a_fFlags, a_iGroup) ( RTLogRelGetDefaultInstanceExWeak(RT_MAKE_U32(a_fFlags, a_iGroup)) != NULL ) 1355 1355 1356 1356 /** @def LogRelIsEnabled … … 1442 1442 do \ 1443 1443 { \ 1444 PRTLOGGER LogRelIt_pLogger = RTLogRelGetDefaultInstanceEx (RT_MAKE_U32(a_fFlags, a_iGroup)); \1444 PRTLOGGER LogRelIt_pLogger = RTLogRelGetDefaultInstanceExWeak(RT_MAKE_U32(a_fFlags, a_iGroup)); \ 1445 1445 if (RT_LIKELY(!LogRelIt_pLogger)) \ 1446 1446 { /* likely */ } \ 1447 1447 else \ 1448 RTLogLoggerEx (LogRelIt_pLogger, a_fFlags, a_iGroup, __VA_ARGS__); \1448 RTLogLoggerExWeak(LogRelIt_pLogger, a_fFlags, a_iGroup, __VA_ARGS__); \ 1449 1449 _LogIt(a_fFlags, a_iGroup, __VA_ARGS__); \ 1450 1450 } while (0) … … 1454 1454 do \ 1455 1455 { \ 1456 PRTLOGGER LogRelIt_pLogger = RTLogRelGetDefaultInstanceEx (RT_MAKE_U32(a_fFlags, a_iGroup)); \1456 PRTLOGGER LogRelIt_pLogger = RTLogRelGetDefaultInstanceExWeak(RT_MAKE_U32(a_fFlags, a_iGroup)); \ 1457 1457 if (LogRelIt_pLogger) \ 1458 RTLogLoggerEx (LogRelIt_pLogger, a_fFlags, a_iGroup, __VA_ARGS__); \1458 RTLogLoggerExWeak(LogRelIt_pLogger, a_fFlags, a_iGroup, __VA_ARGS__); \ 1459 1459 _LogIt(a_fFlags, a_iGroup, __VA_ARGS__); \ 1460 1460 } while (0) … … 1464 1464 do \ 1465 1465 { \ 1466 PRTLOGGER LogRelIt_pLogger = RTLogRelGetDefaultInstanceEx (RT_MAKE_U32(a_fFlags, a_iGroup)); \1466 PRTLOGGER LogRelIt_pLogger = RTLogRelGetDefaultInstanceExWeak(RT_MAKE_U32(a_fFlags, a_iGroup)); \ 1467 1467 if (LogRelIt_pLogger) \ 1468 1468 { \ … … 1471 1471 { \ 1472 1472 s_LogRelMaxIt_cLogged++; \ 1473 RTLogLoggerEx (LogRelIt_pLogger, a_fFlags, a_iGroup, __VA_ARGS__); \1473 RTLogLoggerExWeak(LogRelIt_pLogger, a_fFlags, a_iGroup, __VA_ARGS__); \ 1474 1474 } \ 1475 1475 } \ … … 1482 1482 do \ 1483 1483 { \ 1484 PRTLOGGER LogRelIt_pLogger = RTLogRelGetDefaultInstanceEx (RT_MAKE_U32(a_fFlags, a_iGroup)); \1484 PRTLOGGER LogRelIt_pLogger = RTLogRelGetDefaultInstanceExWeak(RT_MAKE_U32(a_fFlags, a_iGroup)); \ 1485 1485 if (LogRelIt_pLogger) \ 1486 1486 { \ … … 1492 1492 do \ 1493 1493 { \ 1494 PRTLOGGER LogRelIt_pLogger = RTLogRelGetDefaultInstanceEx (RT_MAKE_U32(a_fFlags, a_iGroup)); \1494 PRTLOGGER LogRelIt_pLogger = RTLogRelGetDefaultInstanceExWeak(RT_MAKE_U32(a_fFlags, a_iGroup)); \ 1495 1495 if (RT_LIKELY(!LogRelIt_pLogger)) \ 1496 1496 { /* likely */ } \ … … 1504 1504 do \ 1505 1505 { \ 1506 PRTLOGGER LogRelIt_pLogger = RTLogRelGetDefaultInstanceEx (RT_MAKE_U32(a_fFlags, a_iGroup)); \1506 PRTLOGGER LogRelIt_pLogger = RTLogRelGetDefaultInstanceExWeak(RT_MAKE_U32(a_fFlags, a_iGroup)); \ 1507 1507 if (LogRelIt_pLogger) \ 1508 1508 { \ … … 1808 1808 RTDECL(PRTLOGGER) RTLogRelGetDefaultInstance(void); 1809 1809 1810 /** @copydoc RTLogRelGetDefaultInstance */ 1811 typedef DECLCALLBACKTYPE(PRTLOGGER, FNLOGRELGETDEFAULTINSTANCE,(void)); 1812 /** Pointer to RTLogRelGetDefaultInstance. */ 1813 typedef FNLOGRELGETDEFAULTINSTANCE *PFNLOGRELGETDEFAULTINSTANCE; 1814 1815 /** "Weak symbol" emulation for RTLogRelGetDefaultInstance. 1816 * @note This is first set when RTLogRelSetDefaultInstance is called. */ 1817 extern RTDATADECL(PFNLOGRELGETDEFAULTINSTANCE) g_pfnRTLogRelGetDefaultInstance; 1818 1819 /** "Weak symbol" wrapper for RTLogRelGetDefaultInstance. */ 1820 DECL_FORCE_INLINE(PRTLOGGER) RTLogRelGetDefaultInstanceWeak(void) 1821 { 1822 #if defined(IN_RING3) && (defined(IN_RT_STATIC) || defined(IPRT_NO_CRT)) 1823 if (g_pfnRTLogRelGetDefaultInstance) 1824 return g_pfnRTLogRelGetDefaultInstance(); 1825 return NULL; 1826 #else 1827 return RTLogRelGetDefaultInstance(); 1828 #endif 1829 } 1830 1810 1831 /** 1811 1832 * Gets the default release logger instance. … … 1816 1837 */ 1817 1838 RTDECL(PRTLOGGER) RTLogRelGetDefaultInstanceEx(uint32_t fFlagsAndGroup); 1839 1840 /** @copydoc RTLogRelGetDefaultInstanceEx */ 1841 typedef DECLCALLBACKTYPE(PRTLOGGER, FNLOGRELGETDEFAULTINSTANCEEX,(uint32_t fFlagsAndGroup)); 1842 /** Pointer to RTLogRelGetDefaultInstanceEx. */ 1843 typedef FNLOGRELGETDEFAULTINSTANCEEX *PFNLOGRELGETDEFAULTINSTANCEEX; 1844 1845 /** "Weak symbol" emulation for RTLogRelGetDefaultInstanceEx. 1846 * @note This is first set when RTLogRelSetDefaultInstance is called. */ 1847 extern RTDATADECL(PFNLOGRELGETDEFAULTINSTANCEEX) g_pfnRTLogRelGetDefaultInstanceEx; 1848 1849 /** "Weak symbol" wrapper for RTLogRelGetDefaultInstanceEx. */ 1850 DECL_FORCE_INLINE(PRTLOGGER) RTLogRelGetDefaultInstanceExWeak(uint32_t fFlagsAndGroup) 1851 { 1852 #if defined(IN_RING3) && (defined(IN_RT_STATIC) || defined(IPRT_NO_CRT)) 1853 if (g_pfnRTLogRelGetDefaultInstanceEx) 1854 return g_pfnRTLogRelGetDefaultInstanceEx(fFlagsAndGroup); 1855 return NULL; 1856 #else 1857 return RTLogRelGetDefaultInstanceEx(fFlagsAndGroup); 1858 #endif 1859 } 1860 1818 1861 1819 1862 /** … … 2016 2059 RTDECL(PRTLOGGER) RTLogGetDefaultInstance(void); 2017 2060 2061 /** @copydoc RTLogGetDefaultInstance */ 2062 typedef DECLCALLBACKTYPE(PRTLOGGER, FNLOGGETDEFAULTINSTANCE,(void)); 2063 /** Pointer to RTLogGetDefaultInstance. */ 2064 typedef FNLOGGETDEFAULTINSTANCE *PFNLOGGETDEFAULTINSTANCE; 2065 2066 /** "Weak symbol" emulation for RTLogGetDefaultInstance. 2067 * @note This is first set when RTLogSetDefaultInstance is called. */ 2068 extern RTDATADECL(PFNLOGGETDEFAULTINSTANCE) g_pfnRTLogGetDefaultInstance; 2069 2070 /** "Weak symbol" wrapper for RTLogGetDefaultInstance. */ 2071 DECL_FORCE_INLINE(PRTLOGGER) RTLogGetDefaultInstanceWeak(void) 2072 { 2073 #if defined(IN_RING3) && (defined(IN_RT_STATIC) || defined(IPRT_NO_CRT)) 2074 if (g_pfnRTLogGetDefaultInstance) 2075 return g_pfnRTLogGetDefaultInstance(); 2076 return NULL; 2077 #else 2078 return RTLogGetDefaultInstance(); 2079 #endif 2080 } 2081 2018 2082 /** 2019 2083 * Gets the default logger instance if enabled (does not create one). … … 2025 2089 */ 2026 2090 RTDECL(PRTLOGGER) RTLogGetDefaultInstanceEx(uint32_t fFlagsAndGroup); 2091 2092 /** @copydoc RTLogGetDefaultInstanceEx */ 2093 typedef DECLCALLBACKTYPE(PRTLOGGER, FNLOGGETDEFAULTINSTANCEEX,(uint32_t fFlagsAndGroup)); 2094 /** Pointer to RTLogGetDefaultInstanceEx. */ 2095 typedef FNLOGGETDEFAULTINSTANCEEX *PFNLOGGETDEFAULTINSTANCEEX; 2096 2097 /** "Weak symbol" emulation for RTLogGetDefaultInstanceEx. 2098 * @note This is first set when RTLogSetDefaultInstance is called. */ 2099 extern RTDATADECL(PFNLOGGETDEFAULTINSTANCEEX) g_pfnRTLogGetDefaultInstanceEx; 2100 2101 /** "Weak symbol" wrapper for RTLogGetDefaultInstanceEx. */ 2102 DECL_FORCE_INLINE(PRTLOGGER) RTLogGetDefaultInstanceExWeak(uint32_t fFlagsAndGroup) 2103 { 2104 #if defined(IN_RING3) && (defined(IN_RT_STATIC) || defined(IPRT_NO_CRT)) 2105 if (g_pfnRTLogGetDefaultInstanceEx) 2106 return g_pfnRTLogGetDefaultInstanceEx(fFlagsAndGroup); 2107 return NULL; 2108 #else 2109 return RTLogGetDefaultInstanceEx(fFlagsAndGroup); 2110 #endif 2111 } 2027 2112 2028 2113 /** … … 2461 2546 2462 2547 /** 2548 * Write to a logger instance, weak version. 2549 * 2550 * @param pLogger Pointer to logger instance. 2551 * @param pvCallerRet Ignored. 2552 * @param pszFormat Format string. 2553 * @param ... Format arguments. 2554 */ 2555 #if defined(IN_RING3) && (defined(IN_RT_STATIC) || defined(IPRT_NO_CRT)) 2556 RTDECL(void) RTLogLoggerWeak(PRTLOGGER pLogger, void *pvCallerRet, const char *pszFormat, ...) RT_IPRT_FORMAT_ATTR(3, 4); 2557 #else /* Cannot use a DECL_FORCE_INLINE because older GCC versions doesn't support inlining va_start. */ 2558 # undef RTLogLoggerWeak /* in case of mangling */ 2559 # define RTLogLoggerWeak RTLogLogger 2560 #endif 2561 2562 /** 2463 2563 * Write to a logger instance. 2464 2564 * … … 2486 2586 RTDECL(void) RTLogLoggerEx(PRTLOGGER pLogger, unsigned fFlags, unsigned iGroup, 2487 2587 const char *pszFormat, ...) RT_IPRT_FORMAT_ATTR(4, 5); 2588 2589 /** 2590 * Write to a logger instance, weak version. 2591 * 2592 * This function will check whether the instance, group and flags makes up a 2593 * logging kind which is currently enabled before writing anything to the log. 2594 * 2595 * @param pLogger Pointer to logger instance. If NULL the default logger instance will be attempted. 2596 * @param fFlags The logging flags. 2597 * @param iGroup The group. 2598 * The value ~0U is reserved for compatibility with RTLogLogger[V] and is 2599 * only for internal usage! 2600 * @param pszFormat Format string. 2601 * @param ... Format arguments. 2602 * @remark This is a worker function of LogIt. 2603 */ 2604 #if defined(IN_RING3) && (defined(IN_RT_STATIC) || defined(IPRT_NO_CRT)) 2605 RTDECL(void) RTLogLoggerExWeak(PRTLOGGER pLogger, unsigned fFlags, unsigned iGroup, 2606 const char *pszFormat, ...) RT_IPRT_FORMAT_ATTR(4, 5); 2607 #else /* Cannot use a DECL_FORCE_INLINE because older GCC versions doesn't support inlining va_start. */ 2608 # undef RTLogLoggerExWeak /* in case of mangling */ 2609 # define RTLogLoggerExWeak RTLogLoggerEx 2610 #endif 2488 2611 2489 2612 /** … … 2506 2629 const char *pszFormat, va_list args) RT_IPRT_FORMAT_ATTR(4, 0); 2507 2630 2631 /** @copydoc RTLogLoggerExV */ 2632 typedef DECLCALLBACKTYPE(int, FNRTLOGLOGGEREXV,(PRTLOGGER pLogger, unsigned fFlags, unsigned iGroup, 2633 const char *pszFormat, va_list args)) RT_IPRT_FORMAT_ATTR(4, 0); 2634 /** Pointer to RTLogLoggerExV. */ 2635 typedef FNRTLOGLOGGEREXV *PFNRTLOGLOGGEREXV; 2636 /** "Weak symbol" emulation for RTLogLoggerExV. 2637 * @note This is first set when RTLogCreateEx or RTLogCreate is called. */ 2638 extern RTDATADECL(PFNRTLOGLOGGEREXV) g_pfnRTLogLoggerExV; 2639 2640 /** "Weak symbol" wrapper for RTLogLoggerExV. */ 2641 DECL_FORCE_INLINE(int) RTLogLoggerExVWeak(PRTLOGGER pLogger, unsigned fFlags, unsigned iGroup, 2642 const char *pszFormat, va_list args) /* RT_IPRT_FORMAT_ATTR(4, 0) */ 2643 { 2644 #if defined(IN_RING3) && (defined(IN_RT_STATIC) || defined(IPRT_NO_CRT)) 2645 if (g_pfnRTLogLoggerExV) 2646 return g_pfnRTLogLoggerExV(pLogger, fFlags, iGroup, pszFormat, args); 2647 return 22301; /* VINF_LOG_DISABLED, don't want err.h dependency here. */ 2648 #else 2649 return RTLogLoggerExV(pLogger, fFlags, iGroup, pszFormat, args); 2650 #endif 2651 } 2652 2508 2653 /** 2509 2654 * printf like function for writing to the default log. … … 2535 2680 */ 2536 2681 RTDECL(void) RTLogDumpPrintfV(void *pvUser, const char *pszFormat, va_list va) RT_IPRT_FORMAT_ATTR(2, 0); 2682 2683 /** 2684 * Used for logging assertions, debug and release log as appropriate. 2685 * 2686 * Implies flushing. 2687 * 2688 * @param pszFormat Format string. 2689 * @param ... Format arguments. 2690 */ 2691 typedef DECLCALLBACKTYPE(void, FNRTLOGASSERTION,(const char *pszFormat, ...)) RT_IPRT_FORMAT_ATTR(1, 2); 2692 /** Pointer to an assertion logger, ellipsis variant. */ 2693 typedef FNRTLOGASSERTION *PFNRTLOGASSERTION; 2694 2695 /** 2696 * Used for logging assertions, debug and release log as appropriate. 2697 * 2698 * Implies flushing. 2699 * 2700 * @param pszFormat Format string. 2701 * @param va Format arguments. 2702 */ 2703 typedef DECLCALLBACKTYPE(void, FNRTLOGASSERTIONV,(const char *pszFormat, va_list va)) RT_IPRT_FORMAT_ATTR(1, 0); 2704 /** Pointer to an assertion logger, va_list variant. */ 2705 typedef FNRTLOGASSERTIONV *PFNRTLOGASSERTIONV; 2706 2707 /** @copydoc FNRTLOGASSERTION */ 2708 RTDECL(void) RTLogAssert(const char *pszFormat, ...) RT_IPRT_FORMAT_ATTR(1, 2); 2709 /** @copydoc FNRTLOGASSERTIONV */ 2710 RTDECL(void) RTLogAssertV(const char *pszFormat, va_list va) RT_IPRT_FORMAT_ATTR(1, 0); 2711 2712 /** "Weak symbol" emulation for RTLogAssert. */ 2713 extern RTDATADECL(PFNRTLOGASSERTION) g_pfnRTLogAssert; 2714 /** "Weak symbol" emulation for RTLogAssertV. */ 2715 extern RTDATADECL(PFNRTLOGASSERTIONV) g_pfnRTLogAssertV; 2537 2716 2538 2717 -
trunk/include/iprt/mangling.h
r96407 r96448 1447 1447 # define RTLockValidatorWriteLockGetCount RT_MANGLER(RTLockValidatorWriteLockGetCount) 1448 1448 # define RTLockValidatorWriteLockInc RT_MANGLER(RTLockValidatorWriteLockInc) 1449 # define RTLogAssert RT_MANGLER(RTLogAssert) 1450 # define RTLogAssertV RT_MANGLER(RTLogAssertV) 1449 1451 # define RTLogBackdoorPrintf RT_MANGLER(RTLogBackdoorPrintf) /* r0drv-guest */ 1450 1452 # define RTLogBackdoorPrintfV RT_MANGLER(RTLogBackdoorPrintfV) /* r0drv-guest */ … … 1475 1477 # define RTLogGroupSettings RT_MANGLER(RTLogGroupSettings) 1476 1478 # define RTLogLogger RT_MANGLER(RTLogLogger) 1479 # define RTLogLoggerWeak RT_MANGLER(RTLogLoggerWeak) 1477 1480 # define RTLogLoggerEx RT_MANGLER(RTLogLoggerEx) 1481 # define RTLogLoggerExWeak RT_MANGLER(RTLogLoggerExWeak) 1478 1482 # define RTLogLoggerExV RT_MANGLER(RTLogLoggerExV) 1479 1483 # define RTLogLoggerV RT_MANGLER(RTLogLoggerV) … … 4241 4245 # define g_pStdIn RT_MANGLER(g_pStdIn) 4242 4246 # define g_pStdOut RT_MANGLER(g_pStdOut) 4247 # define g_pfnRTLogAssert RT_MANGLER(g_pfnRTLogAssert) 4248 # define g_pfnRTLogAssertV RT_MANGLER(g_pfnRTLogAssertV) 4249 # define g_pfnRTLogGetDefaultInstance RT_MANGLER(g_pfnRTLogGetDefaultInstance) 4250 # define g_pfnRTLogGetDefaultInstanceEx RT_MANGLER(g_pfnRTLogGetDefaultInstanceEx) 4251 # define g_pfnRTLogLoggerExV RT_MANGLER(g_pfnRTLogLoggerExV) 4252 # define g_pfnRTLogRelGetDefaultInstance RT_MANGLER(g_pfnRTLogRelGetDefaultInstance) 4253 # define g_pfnRTLogRelGetDefaultInstanceEx RT_MANGLER(g_pfnRTLogRelGetDefaultInstanceEx) 4243 4254 # define g_pszRTAssertExpr RT_MANGLER(g_pszRTAssertExpr) 4244 4255 # define g_pszRTAssertFile RT_MANGLER(g_pszRTAssertFile) -
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.