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: Vladimir Prus <vladimir at codesourcery dot com>
- To: Pedro Alves <pedro at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org, Daniel Jacobowitz <drow at false dot org>, Joel Brobecker <brobecker at adacore dot com>
- Date: Fri, 2 May 2008 00:17:29 +0400
- Subject: Re: [RFA] Use observers to report stop events.
- References: <200804112145.58456.vladimir@codesourcery.com> <20080501195758.GL22218@caradoc.them.org> <200805012111.04430.pedro@codesourcery.com>
On Friday 02 May 2008 00:11:04 Pedro Alves wrote:
> 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.
We just should not pass cleanup to continuation -- as it's not used and
should not be. I've missed that bit in previous patches.
- Volodya