From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9245 invoked by alias); 9 Dec 2008 10:39:21 -0000 Received: (qmail 9232 invoked by uid 22791); 9 Dec 2008 10:39:19 -0000 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 09 Dec 2008 10:38:31 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 173B22A967A; Tue, 9 Dec 2008 05:38:30 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id f2lbc9y8bhfs; Tue, 9 Dec 2008 05:38:30 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id CA35B2A963D; Tue, 9 Dec 2008 05:38:29 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 6AB25E7ACD; Tue, 9 Dec 2008 11:38:27 +0100 (CET) Date: Tue, 09 Dec 2008 10:39:00 -0000 From: Joel Brobecker To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: RFA: fix PR 1815 Message-ID: <20081209103827.GM3823@adacore.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.2i 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-12/txt/msg00167.txt.bz2 > This patch fixes the problem by tracking all aliases and fixing them > up when a command is redefined. This is consistent with the way command hooks are tracked. There is a difference, however, in the fact that hooks are lost when redifining a command. Your patch handles this case much better. I'll open a PR for this problem, and hopefully someone will find the time to fix it. > 2008-11-10 Tom Tromey > > PR gdb/1815: > * cli/cli-decode.c (delete_cmd): Forward declare. > (delete_cmd): Now static. Change return type. Remove command > from alias chain. Rewrite. > (add_cmd): Initialize new fields. Update cmd_pointer on all > aliases. > (add_alias_cmd): Put command on alias chain. > * command.h (delete_cmd): Don't declare. > * cli/cli-decode.h (delete_cmd): Don't declare. > (struct cmd_list_element) : New fields. OK. > 2008-11-10 Tom Tromey > > * gdb.base/commands.exp (redefine_backtrace_test): New proc. > Call it. > @@ -616,40 +628,54 @@ add_setshow_zinteger_cmd (char *name, enum command_class class, > > /* Remove the command named NAME from the command list. */ > > -void > +static struct cmd_list_element * Can you update the command to mention the fact that the function returns the list of aliases to the command being deleted? > + send_gdb "define backtrace\n" > + gdb_expect { > + -re "Really redefine built-in.*$" { > + send_gdb "y\n" > + } > + > + -re "End with" { > + pass "define backtrace in redefine_backtrace_test" > + } > + default { > + fail "(timeout or eof) define backtrace in redefine_backtrace_test" > + } I was wondering if this is something that can be implemented with gdb_test_multiple instead of using gdb_expect/send_gdb. This particular case seems a little more complex than usual, so this may not be possible... Otherwise OK. -- Joel :REVIEWMAIL: