public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: "François Dumont" <frs.dumont@gmail.com>
To: Jonathan Wakely <jwakely@redhat.com>
Cc: "Björn Schäpers" <gcc@hazardy.de>,
	libstdc++@gcc.gnu.org, "gcc Patches" <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] libstdc++: Add error handler for <stacktrace>
Date: Wed, 30 Nov 2022 19:00:11 +0100	[thread overview]
Message-ID: <830aca53-fd19-2556-28b0-30ebff17df8c@gmail.com> (raw)
In-Reply-To: <CACb0b4=Q68rqxPus-mSxD6MyxTuX_T_5M5=oxgEy_rGozKFbvA@mail.gmail.com>

On 30/11/22 14:07, Jonathan Wakely wrote:
> On Wed, 30 Nov 2022 at 11:57, Jonathan Wakely <jwakely@redhat.com> wrote:
>>
>>
>> On Wed, 30 Nov 2022 at 11:54, Jonathan Wakely <jwakely@redhat.com> wrote:
>>>
>>>
>>> On Wed, 30 Nov 2022 at 06:04, François Dumont via Libstdc++ <libstdc++@gcc.gnu.org> wrote:
>>>> Good catch, then we also need this patch.
>>>
>>> Is it worth printing an error? If we can't show the backtrace because of an error, we can just print nothing there.

No strong opinion on that but if we do not print anything the output 
will be:

Backtrace:

Error: ...

I just considered that it did not cost much to report the issue to the 
user that defined _GLIBCXX_DEBUG_BACKTRACE and so is expecting a backtrace.

Maybe printing "Backtrace:\n" could be done in the normal callback 
leaving the user with the feeling that _GLIBCXX_DEBUG_BACKTRACE does not 
work.

>>>
>>> We also need to pass an error handler to the __glibcxx_backtrace_create_state call in formatter.h.
>>>
>>> Now that I look at this code again, why do we need the _M_backtrace_full member? It's always set to the same thing, why can't we just call that function directly?
>>
>> Oh right, I remember now ... because otherwise the libstdc++.so library needs the definition of __glibcxx_backtrace_full.
> I'm testing the attached patch.
>
>
>>> And I think we should use threaded=1 for the __glibcxx_backtrace_create_state call.
>>>
>>> So like the attached patch.
>>>
>>>


  reply	other threads:[~2022-11-30 18:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-29 21:41 Björn Schäpers
2022-11-30  6:04 ` François Dumont
2022-11-30 11:54   ` Jonathan Wakely
2022-11-30 11:57     ` Jonathan Wakely
2022-11-30 13:07       ` Jonathan Wakely
2022-11-30 18:00         ` François Dumont [this message]
2022-12-06 21:44           ` Jonathan Wakely
2022-12-07 17:58             ` François Dumont
2022-12-07 20:06               ` Jonathan Wakely
2022-11-30 18:17         ` François Dumont
2022-11-30 19:20   ` Björn Schäpers
2022-11-30 12:31 ` Jonathan Wakely
2022-11-30 13:05   ` 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=830aca53-fd19-2556-28b0-30ebff17df8c@gmail.com \
    --to=frs.dumont@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gcc@hazardy.de \
    --cc=jwakely@redhat.com \
    --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).