This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
cli/2563: redefining command causes hooks to be lost
- From: brobecker at gnat dot com
- To: gdb-gnats at sources dot redhat dot com
- Date: 9 Dec 2008 10:43:59 -0000
- Subject: cli/2563: redefining command causes hooks to be lost
- Reply-to: brobecker at gnat dot com
>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: