From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22976 invoked by alias); 1 May 2008 20:11:26 -0000 Received: (qmail 22968 invoked by uid 22791); 1 May 2008 20:11:25 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 01 May 2008 20:11:08 +0000 Received: (qmail 31692 invoked from network); 1 May 2008 20:11:06 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 1 May 2008 20:11:06 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [RFA] Use observers to report stop events. Date: Thu, 01 May 2008 20:11:00 -0000 User-Agent: KMail/1.9.9 Cc: Daniel Jacobowitz , Vladimir Prus , Joel Brobecker References: <200804112145.58456.vladimir@codesourcery.com> <200804292210.31614.vladimir@codesourcery.com> <20080501195758.GL22218@caradoc.them.org> In-Reply-To: <20080501195758.GL22218@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200805012111.04430.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-05/txt/msg00036.txt.bz2 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