This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Use observers to report stop events.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]