From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30815 invoked by alias); 6 Jun 2002 19:16:35 -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 30793 invoked from network); 6 Jun 2002 19:16:33 -0000 Received: from unknown (HELO cygnus.com) (205.180.83.203) by sources.redhat.com with SMTP; 6 Jun 2002 19:16:34 -0000 Received: from theotherone.redhat-remotie.org (romulus.sfbay.redhat.com [172.16.27.251]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id MAA04587 for ; Thu, 6 Jun 2002 12:16:32 -0700 (PDT) Received: from localhost (localhost.fidalgo.net [127.0.0.1]) by theotherone.redhat-remotie.org (Postfix) with ESMTP id 8262ABB47D for ; Thu, 6 Jun 2002 12:16:26 -0700 (PDT) Date: Thu, 06 Jun 2002 12:16:00 -0000 From: Don Howard X-X-Sender: To: Subject: Re: Disable redefinition of built-in commands. Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2002-06/txt/msg00097.txt.bz2 On Thu, 6 Jun 2002, Elena Zannoni wrote: > > > Don, > you forgot the ChangeLog. > > Elena > Woops - thanks, Elena. The following patch disables redefinition of built-in commands. This corrects two problems: Redefining a built-in command leaves the command's alias in an inconsistent state. Invoking the alias of a redefined command can cause gdb to crash. Once a built-in command has been redefined, there is no way to access that command's original functionality. 2002-06-06 Don Howard * cli/cli-script.c (define_command): Disable redefinition of built-in commands. Index: cli/cli-script.c =================================================================== RCS file: /cvs/src/src/gdb/cli/cli-script.c,v retrieving revision 1.12 diff -p -u -w -r1.12 cli-script.c --- cli/cli-script.c 12 Apr 2002 22:31:23 -0000 1.12 +++ cli/cli-script.c 6 Jun 2002 18:05:08 -0000 @@ -1070,9 +1070,7 @@ define_command (char *comname, int from_ if (c->class == class_user || c->class == class_alias) tem = "Redefine command \"%s\"? "; else - tem = "Really redefine built-in command \"%s\"? "; - if (!query (tem, c->name)) - error ("Command \"%s\" not redefined.", c->name); + error ("Redefinition of built-in commands is not supported."); } /* If this new command is a hook, then mark the command which it -- dhoward@redhat.com gdb engineering