public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: "François Dumont" <frs.dumont@gmail.com>
Cc: "libstdc++@gcc.gnu.org" <libstdc++@gcc.gnu.org>,
	gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Add _GLIBCXX_DEBUG backtrace generation
Date: Mon, 8 Aug 2022 14:29:57 +0100	[thread overview]
Message-ID: <CACb0b4n2jTatPdLagmkX3MZgG5i=_ER=XFqQ1t6KLVBL-Ka3Zg@mail.gmail.com> (raw)
In-Reply-To: <a1afcbea-4657-d356-a3ec-519188298bb3@gmail.com>

On Wed, 13 Jul 2022 at 18:28, François Dumont via Libstdc++
<libstdc++@gcc.gnu.org> wrote:
>
> libstdc++: [_GLIBCXX_DEBUG] Add backtrace generation on demand
>
>    Add _GLIBCXX_DEBUG_BACKTRACE macro to activate backtrace generation
> on _GLIBCXX_DEBUG assertions. Prerequisite is to have configure the lib
> with:
>
>    --enable-libstdcxx-backtrace=yes
>
>    libstdc++-v3/ChangeLog:
>
>    * include/debug/formatter.h
>    [_GLIBCXX_HAVE_STACKTRACE](__glibcxx_backtrace_state): Declare.
>    [_GLIBCXX_HAVE_STACKTRACE](__glibcxx_backtrace_create_state): Declare.
>    [_GLIBCXX_HAVE_STACKTRACE](__glibcxx_backtrace_full_callback): Define.
>    [_GLIBCXX_HAVE_STACKTRACE](__glibcxx_backtrace_error_callback): Define.
>    [_GLIBCXX_HAVE_STACKTRACE](__glibcxx_backtrace_full_func): Define.
>    [_GLIBCXX_HAVE_STACKTRACE](__glibcxx_backtrace_full): Declare.
>    [_GLIBCXX_HAVE_STACKTRACE](_Error_formatter::_M_backtrace_state): New.
>    [_GLIBCXX_HAVE_STACKTRACE](_Error_formatter::_M_backtrace_full): New.
>    * src/c++11/debug.cc (pretty_print): Rename into...
>    (print_function): ...that.

This does more than just rename it, what are the other changes for?


>    [_GLIBCXX_HAVE_STACKTRACE](print_backtrace): New.
>    (_Error_formatter::_M_error()): Adapt.
>    * src/libbacktrace/Makefile.am: Add backtrace.c.
>    * src/libbacktrace/Makefile.in: Regenerate.
>    * src/libbacktrace/backtrace-rename.h (backtrace_full): New.
>    * testsuite/23_containers/vector/debug/assign4_neg.cc: Add backtrace
>      generation.
>    * doc/xml/manual/debug_mode.xml: Document _GLIBCXX_DEBUG_BACKTRACE.
>    * doc/xml/manual/using.xml: Likewise.
>
> Tested under Linux x86_64 normal and _GLIBCXX_DEBUG modes.
>
> Ok to commit ?


>--- a/libstdc++-v3/testsuite/23_containers/vector/debug/assign4_neg.cc
>+++ b/libstdc++-v3/testsuite/23_containers/vector/debug/assign4_neg.cc
>@@ -16,6 +16,7 @@
> // <http://www.gnu.org/licenses/>.
> //
> // { dg-do run { xfail *-*-* } }
>+// { dg-options "-D_GLIBCXX_DEBUG_BACKTRACE -lstdc++_libbacktrace" }
>
> #include <debug/vector>
> #include <debug/checks.h>

This will fail to link if the static lib isn't available.


  parent reply	other threads:[~2022-08-08 13:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-13 17:26 François Dumont
2022-08-04 20:46 ` François Dumont
2022-08-08 13:29 ` Jonathan Wakely [this message]
2022-08-09  8:07   ` François Dumont
2022-08-31  5:05     ` François Dumont
2022-08-31 10:11       ` Jonathan Wakely
2022-08-31 19:33         ` François Dumont
2022-08-31 20:07           ` Jonathan Wakely

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='CACb0b4n2jTatPdLagmkX3MZgG5i=_ER=XFqQ1t6KLVBL-Ka3Zg@mail.gmail.com' \
    --to=jwakely@redhat.com \
    --cc=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).