This is the mail archive of the gdb-patches@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]

Re: RFA: fix PR 1815


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


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