This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cli/2563: redefining command causes hooks to be lost


>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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]