This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [pushed+RFC] C++ exception during command triggers stale cleanup internal-warning
> 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