From: Tom Tromey <tom@tromey.com>
To: Tom Tromey <tom@tromey.com>
Cc: Simon Marchi <simark@simark.ca>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Remove 'if' from GDB_PY_HANDLE_EXCEPTION
Date: Thu, 14 Mar 2024 09:02:03 -0600 [thread overview]
Message-ID: <87bk7gluvo.fsf@tromey.com> (raw)
In-Reply-To: <87ttn3qyp8.fsf@tromey.com> (Tom Tromey's message of "Tue, 23 Jan 2024 18:58:43 -0700")
Simon> In infpy_write_memory for instance, GDB_PY_HANDLE_EXCEPTION is not
Simon> called within the catch block. Is it normal?
> Nope, oops. Here's v2, that fixes this and also removes an unnecessary
> return -- which is kind of the main motivation of this change, the 'if'
> sometimes results in the compiler thinking the macro doesn't return,
> whereas it does.
> Remove 'if' from GDB_PY_HANDLE_EXCEPTION
> This removes the embedded 'if' from GDB_PY_HANDLE_EXCEPTION and
> GDB_PY_SET_HANDLE_EXCEPTION. I believe this 'if' was necessary with
> the old gdb try/catch macros, but it no longer is: these should only
> ever be called from a 'catch' block, where it's already known that an
> exception was thrown.
> Simon pointed out, though, that in a few spots, these were in facts
> called outside of 'catch' blocks. This patch cleans up these spots.
> I also found one spot where a redundant 'return nullptr' could be
> removed.
I'm checking this in.
Tom
prev parent reply other threads:[~2024-03-14 15:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-22 18:44 Tom Tromey
2023-12-22 19:16 ` Simon Marchi
2024-01-24 1:58 ` Tom Tromey
2024-03-14 15:02 ` Tom Tromey [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=87bk7gluvo.fsf@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
--cc=simark@simark.ca \
/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).