From: Tom Tromey <tromey@redhat.com>
To: Yao Qi <yao@codesourcery.com>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [PATCH 1/3] new observer command_param_changed.
Date: Mon, 06 Aug 2012 20:21:00 -0000 [thread overview]
Message-ID: <87lihrixgg.fsf@fleche.redhat.com> (raw)
In-Reply-To: <1445113.LnrSLk2Yru@qiyao.dyndns.org> (Yao Qi's message of "Mon, 6 Aug 2012 23:44:14 +0800")
>>>>> "Yao" == Yao Qi <yao@codesourcery.com> writes:
Yao> They are switched to dynamic array.
Thanks.
Yao> + /* Update the field 'prefix' of each cmd_list_element in *PREFIXLIST. */
Yao> + for (p = *prefixlist; p != NULL; p = p->next)
Yao> + p->prefix = c;
Super.
Yao> {
Yao> + char *name;
Yao> +
Yao> + /* Compute the whole multi-word command options. If user types command
Yao> + 'set foo bar baz on', c->name is 'baz', and GDB can't pass "bar" to
Yao> + command option change notification, because it is confusing. We can
Yao> + trace back through field 'prefix' to compute the whole options,
Yao> + and pass "foo bar baz" to notification. */
Yao> + {
Two blocks separated only by a declaration seems unusual.
I would suggest just a single block.
Yao> + /* Skip the command 'set' in CMDS. */
Yao> + i--;
Yao> + gdb_assert (cmds[i]->prefixlist == &setlist);
I wonder if this can trigger somehow. For example, if a Python
programmer makes a Parameter under 'maint set' that is in an unexpected
command class.
I think it would be safer perhaps to just avoid the notification if the
prefixlist is not setlist.
Tom
next prev parent reply other threads:[~2012-08-06 20:21 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-03 11:22 [RCF 0/3 V3] MI notification of command parameter change Yao Qi
2012-08-03 11:22 ` [PATCH 3/3] test case Yao Qi
2012-08-03 17:37 ` Tom Tromey
2012-08-06 15:48 ` Yao Qi
2012-08-06 20:21 ` Tom Tromey
2012-08-03 11:22 ` [PATCH 1/3] new observer command_param_changed Yao Qi
2012-08-03 17:35 ` Tom Tromey
2012-08-06 15:44 ` Yao Qi
2012-08-06 20:21 ` Tom Tromey [this message]
2012-08-07 2:58 ` Yao Qi
2012-08-08 18:11 ` Tom Tromey
2012-08-03 11:22 ` [PATCH 2/3] attach to command_param_changed observer Yao Qi
2012-08-03 11:30 ` Eli Zaretskii
2012-08-03 17:36 ` Tom Tromey
2012-08-10 0:57 ` [committed]: [RCF 0/3 V3] MI notification of command parameter change Yao Qi
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=87lihrixgg.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=yao@codesourcery.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