diff options
author | thegeorg <thegeorg@yandex-team.com> | 2025-02-26 19:56:20 +0300 |
---|---|---|
committer | thegeorg <thegeorg@yandex-team.com> | 2025-02-26 20:24:26 +0300 |
commit | 725f044263c17a834658ee8bc14d2839d829914b (patch) | |
tree | 1accbbf9a5b654f0fed80d5833e1b98cf5cf6598 | |
parent | d4e39fa00b2b2b5065ce3cbe60baa8f1a700cf18 (diff) | |
download | ydb-725f044263c17a834658ee8bc14d2839d829914b.tar.gz |
Split fix_trace_format.patch for a cleaner diff.
This reverts commit 4358151e7723e37a39cf6f5478bfa336aa687fd4,
reversing changes made to ad7618a2219d22bcd89a67fe082f290b4a9656ef.
commit_hash:abd312d0c2cdc5ee542823f99f8f57a7bcd29f9c
-rw-r--r-- | contrib/libs/cxxsupp/libcxxrt/exception.cc | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/contrib/libs/cxxsupp/libcxxrt/exception.cc b/contrib/libs/cxxsupp/libcxxrt/exception.cc index ea19474857..7c34bd9cbe 100644 --- a/contrib/libs/cxxsupp/libcxxrt/exception.cc +++ b/contrib/libs/cxxsupp/libcxxrt/exception.cc @@ -287,6 +287,31 @@ namespace std using namespace ABI_NAMESPACE; +/** + * Callback function used with _Unwind_Backtrace(). + * + * Prints a stack trace. Used only for debugging help. + * + * Note: As of FreeBSD 8.1, dladd() still doesn't work properly, so this only + * correctly prints function names from public, relocatable, symbols. + */ +static _Unwind_Reason_Code trace(struct _Unwind_Context *context, void *c) +{ + Dl_info myinfo; + int mylookup = + dladdr(reinterpret_cast<void *>(__cxa_current_exception_type), &myinfo); + void *ip = reinterpret_cast<void*>(_Unwind_GetIP(context)); + Dl_info info; + if (dladdr(ip, &info) != 0) + { + if (mylookup == 0 || strcmp(info.dli_fname, myinfo.dli_fname) != 0) + { + printf("%p:%s() in %s\n", ip, info.dli_sname, info.dli_fname); + } + } + return _URC_CONTINUE_UNWIND; +} + static void bt_terminate_handler() { __cxa_eh_globals* globals = __cxa_get_globals(); __cxa_exception* thrown_exception = globals->caughtExceptions; @@ -760,31 +785,6 @@ void __cxa_free_dependent_exception(void *thrown_exception) } /** - * Callback function used with _Unwind_Backtrace(). - * - * Prints a stack trace. Used only for debugging help. - * - * Note: As of FreeBSD 8.1, dladd() still doesn't work properly, so this only - * correctly prints function names from public, relocatable, symbols. - */ -static _Unwind_Reason_Code trace(struct _Unwind_Context *context, void *c) -{ - Dl_info myinfo; - int mylookup = - dladdr(reinterpret_cast<void *>(__cxa_current_exception_type), &myinfo); - void *ip = reinterpret_cast<void*>(_Unwind_GetIP(context)); - Dl_info info; - if (dladdr(ip, &info) != 0) - { - if (mylookup == 0 || strcmp(info.dli_fname, myinfo.dli_fname) != 0) - { - printf("%p:%s() in %s\n", ip, info.dli_sname, info.dli_fname); - } - } - return _URC_CONTINUE_UNWIND; -} - -/** * Report a failure that occurred when attempting to throw an exception. * * If the failure happened by falling off the end of the stack without finding |