From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15247 invoked by alias); 5 Jun 2008 15:41:43 -0000 Received: (qmail 15228 invoked by uid 22791); 5 Jun 2008 15:41:42 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 05 Jun 2008 15:41:14 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 6C268983F8; Thu, 5 Jun 2008 15:41:12 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 214F49809F; Thu, 5 Jun 2008 15:41:12 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1K4HaR-00086P-E6; Thu, 05 Jun 2008 11:41:11 -0400 Date: Thu, 05 Jun 2008 15:41:00 -0000 From: Daniel Jacobowitz To: Vladimir Prus Cc: Joel Brobecker , gdb-patches@sources.redhat.com Subject: Re: [RFA] Use observers to report stop events. Message-ID: <20080605154111.GA29085@caradoc.them.org> Mail-Followup-To: Vladimir Prus , Joel Brobecker , gdb-patches@sources.redhat.com References: <200804112145.58456.vladimir@codesourcery.com> <200804292210.31614.vladimir@codesourcery.com> <20080501195758.GL22218@caradoc.them.org> <200805041225.54416.vladimir@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200805041225.54416.vladimir@codesourcery.com> User-Agent: Mutt/1.5.17 (2008-05-11) 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-06/txt/msg00031.txt.bz2 On Sun, May 04, 2008 at 12:25:54PM +0400, Vladimir Prus wrote: > Are those two new patches, together with the previously posted one > (changing stop_observer not to always fire) OK? For this patch, if an error occurs during proceed (i.e. if the cleanup restoring suppress_normal_stop_observer is run), will the normal_stop observer ever be called? Is that a problem? > + If the argument is pointer to allocated memory, then you need to is a pointer > struct cleanup * > -make_my_cleanup (struct cleanup **pmy_chain, make_cleanup_ftype *function, > - void *arg) > +make_cleanup_restore_integer (int *variable, int value) > +{ > + struct restore_integer_closure *c = > + xmalloc (sizeof (struct restore_integer_closure)); > + struct cleanup *cleanup = make_cleanup (restore_integer, (void *) c); > + c->variable = variable; > + c->value = *variable; > + *variable = value; > + cleanup_chain->free_arg = xfree; > + return cleanup; > +} Could you use make_my_cleanup2 here to avoid poking around in cleanup_chain, please? Also, the only thing value is used for is to set *variable. I suggest not setting the variable in a function named "make_cleanup_restore_integer", which doesn't say anything about setting. So I would prefer this: old_cleanup = make_cleanup_restore_integer (some_var); some_var = 0; > * infrun.c (finish_command): Don't pass cleanup > to continuation. > (finish_command_continuation): Don't grab cleanup from > the passed data, as we don't use, and cannot, use it anyway. OK. -- Daniel Jacobowitz CodeSourcery