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: Fri, 03 Aug 2012 17:35:00 -0000 [thread overview]
Message-ID: <87zk6bnakg.fsf@fleche.redhat.com> (raw)
In-Reply-To: <1343992904-9375-2-git-send-email-yao@codesourcery.com> (Yao Qi's message of "Fri, 3 Aug 2012 19:21:42 +0800")
>>>>> "Yao" == Yao Qi <yao@codesourcery.com> writes:
Yao> +static struct cmd_list_element *
Yao> +lookup_cmd_for_prefixlist (struct cmd_list_element **key,
Yao> + struct cmd_list_element *list)
It seems to me that this function relies on add_prefix_cmd being invoked
before any of the sub-commands are added.
But, I think this is not guaranteed by gdb's order-agnostic
initialization approach. This, IIUC, is why the prefix list variables
are global rather than being stored in the prefix command itself.
If that is correct, then I think a different approach is needed.
Yao> + if (notify_command_param_changed_p (option_changed, c))
Yao> {
Yao> + char name[64];
It is better not to have a statically-sized buffer.
This can easily be overrun by making new parameters from Python.
Yao> + /* Assume that the number of command option is less than 6. */
Yao> + struct cmd_list_element *cmds[6];
Likewise.
The rest looks good. Thanks for changing it to report all options.
Tom
next prev parent reply other threads:[~2012-08-03 17:35 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 1/3] new observer command_param_changed Yao Qi
2012-08-03 17:35 ` Tom Tromey [this message]
2012-08-06 15:44 ` Yao Qi
2012-08-06 20:21 ` Tom Tromey
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-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-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=87zk6bnakg.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