From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16242 invoked by alias); 9 Dec 2008 10:48:02 -0000 Received: (qmail 16224 invoked by uid 71); 9 Dec 2008 10:48:02 -0000 Resent-Date: 9 Dec 2008 10:48:02 -0000 Resent-Message-ID: <20081209104802.16223.qmail@sourceware.org> Resent-From: gdb-gnats@sources.redhat.com (GNATS Filer) Resent-To: nobody@sources.redhat.com Resent-Cc: gdb-prs@sources.redhat.com Resent-Reply-To: gdb-gnats@sources.redhat.com, brobecker@gnat.com Received: (qmail 12453 invoked by uid 48); 9 Dec 2008 10:43:59 -0000 Message-Id: <20081209104359.12452.qmail@sourceware.org> Date: Tue, 09 Dec 2008 10:48:00 -0000 From: brobecker@gnat.com Reply-To: brobecker@gnat.com To: gdb-gnats@sources.redhat.com X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: cli/2563: redefining command causes hooks to be lost Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org X-SW-Source: 2008-q4/txt/msg00069.txt.bz2 >Number: 2563 >Category: cli >Synopsis: redefining command causes hooks to be lost >Confidential: no >Severity: non-critical >Priority: low >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Tue Dec 09 10:48:01 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Joel Brobecker >Release: 6.8 (reproduced with 6.8.50.20081205-cvs) >Organization: >Environment: >Description: When redefining a command that has a hook attached to it, the new command is missing the hook. For instance, consider the following: (gdb) define cmd Type commands for definition of "cmd". End with a line saying just "end". > echo cmd\n > end (gdb) define hook-cmd Type commands for definition of "hook-cmd". End with a line saying just "end". > echo hook-cmd\n > end Calling our new "cmd" causes "hook-cmd" to be called as well: (gdb) cmd hook-cmd cmd Now, if we redefine "cmd": (gdb) define cmd Redefine command "cmd"? (y or n) y Type commands for definition of "cmd". End with a line saying just "end". > echo cmd2\n > end Then calling "cmd" again shows that "hook-cmd" is no longer called: (gdb) cmd cmd2 >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: