From: "François Dumont" <frs.dumont@gmail.com>
To: "libstdc++@gcc.gnu.org" <libstdc++@gcc.gnu.org>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH][_GLIBCXX_DEBUG] libbacktrace integration
Date: Mon, 3 May 2021 22:17:02 +0200 [thread overview]
Message-ID: <b6b8955e-c624-0096-da13-bb2c833b5659@gmail.com> (raw)
In-Reply-To: <e24b9d01-863e-5fb3-7adb-c96053875b5c@gmail.com>
Is it too early to consider this patch ? Or just lack of time ?
Considering the patch I would really appreciate that, if validated, it
gets in as early as possible in next release.
Thanks,
François
On 24/04/21 3:46 pm, François Dumont wrote:
> Hi
>
> Here is the patch to add backtrace generation on _GLIBCXX_DEBUG
> assertions thanks to libbacktrace.
>
> In addition to this integration I am also improving the generation
> of the assertion message thanks to the "%.*s" printf format, it avoids
> an intermediate buffer most of the time. I am also removing the "__"
> used for uglification to get a nicer output. I can propose it in a
> dedicated patch if you prefer.
>
> I am adding GLIBCXX_3.4.30 abi version to properly export the 2
> new weak symbols. Let me know if it isn't necessary.
>
> libstdc++: [_GLIBCXX_DEBUG] Add backtrace generation thanks to
> libbacktrace
>
> Add _GLIBCXX_DEBUG_BACKTRACE macro to activate backtrace
> generation on
> _GLIBCXX_DEBUG assertions using libbacktrace.
>
> * config/abi/pre/gnu.ver: Add GLIBCXX_3.4.30 version and
> new exports.
> * include/debug/formatter.h [_GLIBCXX_DEBUG_BACKTRACE]:
> Include <backtrace-supported.h>.
> [_GLIBCXX_DEBUG_BACKTRACE && BACKTRACE_SUPPORTED]:
> Include <backtrace.h>.
> [(!_GLIBCXX_DEBUG_BACKTRACE || !BACKTRACE_SUPPORTED) &&
> _GLIBCXX_USE_C99_STDINT_TR1]: Include <stdint.h>.
> [_GLIBCXX_DEBUG_USE_LIBBACKTRACE]
> (__gnu_debug::__create_backtrace_state): New.
> [_GLIBCXX_DEBUG_USE_LIBBACKTRACE]
> (__gnu_debug::__render_backtrace): New.
> [_GLIBCXX_DEBUG_USE_LIBBACKTRACE](_Error_formatter::_M_print_backtrace):
> New.
> [_GLIBCXX_DEBUG_USE_LIBBACKTRACE](_Error_formatter::_M_backtrace_state):
> New.
> (_Error_formatter::_Error_formatter): Outline definition.
> * src/c++11/debug.cc: Include <cstring>.
> (_Print_func_t): New.
> (print_word): Use '%.*s' format in fprintf to render only
> expected
> number of chars.
> (print_raw(PrintContext&, const char*, ptrdiff_t)): New.
> (print_function(PrintContext&, const char*,
> _Print_func_t)): New.
> (print_type): Use latter.
> (print_string(PrintContext&, const char*, const
> _Parameter*, size_t)):
> Change signature to...
> (print_string(PrintContext&, const char*, ptrdiff_t, const
> _Parameter*,
> size_t)): ...this and adapt. Remove intermediate buffer to
> render input
> string.
> (print_string(PrintContext&, const char*, ptrdiff_t)): New.
> [_GLIBCXX_DEBUG_USE_LIBBACKTRACE]
> (print_backtrace(void*, uintptr_t, const char*, int, const
> char*)): New.
> (_Error_formatter::_M_error()): Adapt.
> [_GLIBCXX_DEBUG_USE_LIBBACKTRACE]
> (__gnu_debug::__create_backtrace_state): New, weak symbol.
> [_GLIBCXX_DEBUG_USE_LIBBACKTRACE]
> (__gnu_debug::__render_backtrace): New, weak symbol.
> * testsuite/util/testsuite_abi.cc: Add new symbol version.
> * doc/xml/manual/debug_mode.xml: Document
> _GLIBCXX_DEBUG_BACKTRACE.
> * doc/xml/manual/using.xml: Likewise.
>
> Tested under Linux x86_64.
>
> Ok to commit ?
>
> François
>
next prev parent reply other threads:[~2021-05-03 20:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-24 13:46 François Dumont
2021-05-03 20:17 ` François Dumont [this message]
2021-05-03 21:06 ` Jonathan Wakely
2021-05-04 6:03 ` François Dumont
2021-05-05 10:01 ` Jonathan Wakely
2021-05-05 11:33 ` Jonathan Wakely
2021-05-07 14:26 ` Jonathan Wakely
2021-05-09 15:03 ` François Dumont
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b6b8955e-c624-0096-da13-bb2c833b5659@gmail.com \
--to=frs.dumont@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=libstdc++@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).