This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: RFA: fix PR 1815
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 9 Dec 2008 11:38:27 +0100
- Subject: Re: RFA: fix PR 1815
- References: <m3ej1jjrhl.fsf@fleche.redhat.com>
> This patch fixes the problem by tracking all aliases and fixing them
> up when a command is redefined.
This is consistent with the way command hooks are tracked.
There is a difference, however, in the fact that hooks are lost
when redifining a command. Your patch handles this case much better.
I'll open a PR for this problem, and hopefully someone will find the
time to fix it.
> 2008-11-10 Tom Tromey <tromey@redhat.com>
>
> PR gdb/1815:
> * cli/cli-decode.c (delete_cmd): Forward declare.
> (delete_cmd): Now static. Change return type. Remove command
> from alias chain. Rewrite.
> (add_cmd): Initialize new fields. Update cmd_pointer on all
> aliases.
> (add_alias_cmd): Put command on alias chain.
> * command.h (delete_cmd): Don't declare.
> * cli/cli-decode.h (delete_cmd): Don't declare.
> (struct cmd_list_element) <aliases, alias_chain>: New fields.
OK.
> 2008-11-10 Tom Tromey <tromey@redhat.com>
>
> * gdb.base/commands.exp (redefine_backtrace_test): New proc.
> Call it.
> @@ -616,40 +628,54 @@ add_setshow_zinteger_cmd (char *name, enum command_class class,
>
> /* Remove the command named NAME from the command list. */
>
> -void
> +static struct cmd_list_element *
Can you update the command to mention the fact that the function returns
the list of aliases to the command being deleted?
> + send_gdb "define backtrace\n"
> + gdb_expect {
> + -re "Really redefine built-in.*$" {
> + send_gdb "y\n"
> + }
> +
> + -re "End with" {
> + pass "define backtrace in redefine_backtrace_test"
> + }
> + default {
> + fail "(timeout or eof) define backtrace in redefine_backtrace_test"
> + }
I was wondering if this is something that can be implemented with
gdb_test_multiple instead of using gdb_expect/send_gdb. This particular
case seems a little more complex than usual, so this may not be possible...
Otherwise OK.
--
Joel
:REVIEWMAIL: