public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [pushed+RFC] C++ exception during command triggers stale cleanup internal-warning
Date: Tue, 22 May 2018 15:48:00 -0000	[thread overview]
Message-ID: <20180522145832.lfjva34lztffr36y@adacore.com> (raw)
In-Reply-To: <87lgcbg2yu.fsf@tromey.com>

> Joel> But at the same time, this leads me to believe we may have a weakness
> Joel> top.c::execute_command, which installs a cleanup, and "forgets" to
> Joel> discard it when C++ exceptions are raised.
> 
> My view was always that dangling cleanups are nearly always bugs; with
> the exceptions being functions that either mention "cleanup" in the name
> or return a cleanup.

Completely agreed. My question is: Should the function catch C++
exceptions in order to take care of the cleanup before re-throwing?
Thinking things further, I am realizing that this function is most
likely not alone in that situation. So there is no clear reason
to be treating that function specifically.

> I'm still hoping that we can just remove all cleanups and not have to
> deal with the issue any more.

Agree on the goal. To say that I am not a fan of cleanups would be
an understatement (I used to like them, until I realized how tricky
they are to maintain).

-- 
Joel

  reply	other threads:[~2018-05-22 14:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-19 20:37 [RFA 0/3] More Ada cleanup removal Tom Tromey
2018-05-19 16:06 ` [RFA 2/3] Remove cleanup from ada_collect_symbol_completion_matches Tom Tromey
2018-05-21  0:09   ` Simon Marchi
2018-05-19 16:06 ` [RFA 3/3] Change ada_catchpoint::excep_string to be a std::string Tom Tromey
2018-05-21  1:12   ` Simon Marchi
2018-05-22 14:49     ` [pushed+RFC] C++ exception during command triggers stale cleanup internal-warning Joel Brobecker
2018-05-22 14:50       ` [pushed/Ada] fix "stale cleanup" internal-warning when using "catch assert" command Joel Brobecker
2018-05-22 14:58       ` [pushed+RFC] C++ exception during command triggers stale cleanup internal-warning Tom Tromey
2018-05-22 15:48         ` Joel Brobecker [this message]
2018-05-19 20:37 ` [RFA 1/3] Remove cleanup from ada-lang.c Tom Tromey
2018-05-21  0:06   ` Simon Marchi

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=20180522145832.lfjva34lztffr36y@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.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).