This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Use observers to report stop events.
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Cc: Daniel Jacobowitz <drow at false dot org>, Vladimir Prus <vladimir at codesourcery dot com>, Joel Brobecker <brobecker at adacore dot com>
- Date: Thu, 1 May 2008 21:11:04 +0100
- Subject: Re: [RFA] Use observers to report stop events.
- References: <200804112145.58456.vladimir@codesourcery.com> <200804292210.31614.vladimir@codesourcery.com> <20080501195758.GL22218@caradoc.them.org>
A Thursday 01 May 2008 20:57:58, Daniel Jacobowitz wrote:
> Am I correct that the cleanup for finish_command is never supposed to
> survive the function returning? It's run on error and discarded on
> normal return. So you could put the closure in a local variable,
> maybe.
>
> struct foo_closure my_closure = { &my_global, my_global };
> make_cleanup (restore_integer, &my_closure);
Humm, I notice that a cleanup is being passed around to
finish_command_continuation, but it isn't being used inside -- and
it shoud not be. With continuations per thread, and and non-stop, we
can have more than one simultaneous finish command. The cleanup
chains are not per-thread, so it is not safe to run cleanups like that.
Either we have to use some other form of cleanup in this continuation,
or revert to having exec_cleanups, but this time, per thread.
--
Pedro Alves