From: Joel Brobecker <brobecker@adacore.com>
To: Tom Tromey <tromey@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: RFA: fix PR 1815
Date: Tue, 09 Dec 2008 10:39:00 -0000 [thread overview]
Message-ID: <20081209103827.GM3823@adacore.com> (raw)
In-Reply-To: <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:
next prev parent reply other threads:[~2008-12-09 10:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-10 20:22 Tom Tromey
2008-12-09 10:39 ` Joel Brobecker [this message]
2008-12-09 19:49 ` Tom Tromey
2008-12-09 20:23 ` Joel Brobecker
2008-12-09 20:33 ` Tom Tromey
2008-12-09 22:06 ` Tom Tromey
2008-12-09 22:13 ` Joel Brobecker
2008-12-10 1:06 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081209103827.GM3823@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=tromey@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox