From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32226 invoked by alias); 24 Feb 2004 20:36:01 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 32172 invoked from network); 24 Feb 2004 20:36:00 -0000 Received: from unknown (HELO localhost.redhat.com) (216.129.200.20) by sources.redhat.com with SMTP; 24 Feb 2004 20:36:00 -0000 Received: from gnu.org (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 9840B2B92; Tue, 24 Feb 2004 15:35:57 -0500 (EST) Message-ID: <403BB5AD.9040502@gnu.org> Date: Tue, 24 Feb 2004 20:36:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.4.1) Gecko/20040217 MIME-Version: 1.0 To: David Allan Cc: GDB patches Subject: Re: make execute_control_command conform to docs References: <1077640948.1311.61.camel@hasufel.egenera.com> In-Reply-To: <1077640948.1311.61.camel@hasufel.egenera.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-02/txt/msg00697.txt.bz2 > > Index: cli-script.c > =================================================================== > RCS file: /cvs/src/src/gdb/cli/cli-script.c,v > retrieving revision 1.21 > diff -u -r1.21 cli-script.c > --- cli-script.c 22 Dec 2003 03:43:19 -0000 1.21 > +++ cli-script.c 24 Feb 2004 15:55:06 -0000 > @@ -294,7 +294,7 @@ > { > struct expression *expr; > struct command_line *current; > - struct cleanup *old_chain = 0; > + struct cleanup *old_chain = make_cleanup (null_cleanup, 0); > struct value *val; > struct value *val_mark; > int loop; > @@ -427,8 +427,7 @@ > return invalid_control; > } > > - if (old_chain) > - do_cleanups (old_chain); > + do_cleanups (old_chain); > > return ret; > } Close, Paths where the function explicitly does a "return" such as this: default: warning ("Invalid control type in command structure."); return invalid_control; should cleanup (or better? let things flow to the end), and this: struct cleanup *old_chain = make_cleanup (null_cleanup, 0); ... old_chain = make_cleanup (free_current_contents, &new_line); leaves a dangling cleanup (it is eventually processed but I'm not sure where). I'll re-arange the relevant code. Andrew PS: Remember to include a ChangeLog entry in patches.