public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@redhat.com>
To: Tom Kacvinsky <tkacvins@gmail.com>, gdb@sourceware.org
Subject: Re: "catch throw" vs. "b __cxa_throw"
Date: Mon, 15 Aug 2022 12:10:44 +0100	[thread overview]
Message-ID: <87mtc5zrrf.fsf@redhat.com> (raw)
In-Reply-To: <CAG_eJLfUEMtrie5w+uB42m40MuP4qc0Rx+w4puv_AG73H42m3Q@mail.gmail.com>

Tom Kacvinsky via Gdb <gdb@sourceware.org> writes:

> We happened to notice that with gdb 7.6.1, "catch throw" caught an exception
> (a logic_error exception from initializing a std::string with nullptr).
> However, with
> GDB 11.1 and 12.1 (I have not tested earlier versions than that), we did
> not break
> on the exception when using "catch throw".  However, I was able to break
> when
> I used "b __cxa_throw"
>
> I looked in sourceware's bugzilla for a report on this, but I didn't see
> anything.
> I also perused the code and from what I could gather, "catch throw"
> basically
> mapped to setting a breakpoint on __cxa_throw.  I did not figure out the
> logic
> for "catch throw" in the GDB 12.1 source.
>
> What is really odd is that "catch throw" works fine for some small examples,
> but the use case I have where it is not working is our full blown project
> (a mix
> of C, C++ and Ada) and I wouldn't know where to begin constructing an MRE.
>
> Any ideas as to what is going on with this?

No clue what's going wrong here, but you could use 'maint info
breakpoints' to discover the exact address where the 'catch throw' has
placed a breakpoint.

From that you might be able to figure out why you're hitting your
breakpoint, but not the 'catch throw' breakpoint.

Thanks,
Andrew


      reply	other threads:[~2022-08-15 11:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-12 20:51 Tom Kacvinsky
2022-08-15 11:10 ` Andrew Burgess [this message]

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=87mtc5zrrf.fsf@redhat.com \
    --to=aburgess@redhat.com \
    --cc=gdb@sourceware.org \
    --cc=tkacvins@gmail.com \
    /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).