From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29124 invoked by alias); 1 May 2008 20:17:47 -0000 Received: (qmail 29114 invoked by uid 22791); 1 May 2008 20:17:47 -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:17:30 +0000 Received: (qmail 32011 invoked from network); 1 May 2008 20:17:28 -0000 Received: from unknown (HELO localhost) (vladimir@127.0.0.2) by mail.codesourcery.com with ESMTPA; 1 May 2008 20:17:28 -0000 From: Vladimir Prus To: Pedro Alves Subject: Re: [RFA] Use observers to report stop events. Date: Thu, 01 May 2008 20:17:00 -0000 User-Agent: KMail/1.9.6 (enterprise 0.20070907.709405) Cc: gdb-patches@sourceware.org, Daniel Jacobowitz , Joel Brobecker References: <200804112145.58456.vladimir@codesourcery.com> <20080501195758.GL22218@caradoc.them.org> <200805012111.04430.pedro@codesourcery.com> In-Reply-To: <200805012111.04430.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200805020017.29542.vladimir@codesourcery.com> 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/msg00039.txt.bz2 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