public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@adacore.com>
To: Pedro Alves <pedro@palves.net>
Cc: gdb-patches@sourceware.org,  Kevin Buettner <kevinb@redhat.com>
Subject: Re: [PATCH] Simplify interp::exec / interp_exec - let exceptions propagate
Date: Mon, 30 Jan 2023 11:32:43 -0700	[thread overview]
Message-ID: <87ilgnootw.fsf@tromey.com> (raw)
In-Reply-To: <20230127230545.77750-1-pedro@palves.net> (Pedro Alves's message of "Fri, 27 Jan 2023 23:05:45 +0000")

>>>>> "Pedro" == Pedro Alves <pedro@palves.net> writes:

Pedro> This patch implements a simplication that I suggested here:
Pedro>   https://sourceware.org/pipermail/gdb-patches/2022-March/186320.html

Pedro> Currently, the interp::exec virtual method interface is such that
Pedro> subclass implementations must catch exceptions and then return them
Pedro> via normal function return.
...

Pedro> And, I can't see why we need to have interp_exec catch the exception
Pedro> and return it via the normal return path.  That's normally needed when
Pedro> we need to handle propagating exceptions across C code, like across
Pedro> readline or ncurses, but that's not the case here.

I think this is probably a leftover from the old libgdb idea.  I don't
really know much about it other than what I saw in comments, but I
gather the idea was to present a more ordinary C API, so return values
rather than longjmp exceptions.  Of course we gave up on that ages ago.

Pedro> It seems to me that we can simplify things by removing some
Pedro> try/catch-ing and just letting exceptions propagate normally.

Agreed.

Approved-By: Tom Tromey <tromey@adacore.com>

Tom

  reply	other threads:[~2023-01-30 18:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-27 23:05 Pedro Alves
2023-01-30 18:32 ` Tom Tromey [this message]
2023-01-31 19:54 ` Kevin Buettner

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=87ilgnootw.fsf@tromey.com \
    --to=tromey@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=kevinb@redhat.com \
    --cc=pedro@palves.net \
    /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).