From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23843 invoked by alias); 6 Jun 2002 19:02:22 -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 23829 invoked from network); 6 Jun 2002 19:02:21 -0000 Received: from unknown (HELO cygnus.com) (205.180.83.203) by sources.redhat.com with SMTP; 6 Jun 2002 19:02:21 -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 MAA03149 for ; Thu, 6 Jun 2002 12:02:20 -0700 (PDT) Received: from localhost (localhost.fidalgo.net [127.0.0.1]) by theotherone.redhat-remotie.org (Postfix) with ESMTP id 970F0BB47D for ; Thu, 6 Jun 2002 12:02:13 -0700 (PDT) Date: Thu, 06 Jun 2002 12:02:00 -0000 From: Don Howard X-X-Sender: To: Subject: 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/msg00095.txt.bz2 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. 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