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: [PATCH 1/3] new observer command_param_changed.


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


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