This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/6] new observer command_option_changed.
On Wednesday, July 25, 2012 08:31:55 AM Tom Tromey wrote:
> Yao> + if (c->notify_observer_p)
> Yao> + observer_notify_command_option_changed (c->name, arg);
>
> Last night I realized that this does the wrong thing for multi-word
> parameters. E.g., for "set print elements", the MI client will just see
> "elements".
Right, we are unable to get the previous command instance "print" in command
instance "elements". So we have to move
'observer_notify_command_option_changed' out of do_setshow_command to its
caller, top.c:execute_command, where the full command option and value is
available. Then, we can change 'do_setshow_command' to return a boolean value
indicating option is changed or not, and call
observer_notify_command_option_changed if do_setshow_command returns true.
It works fine for me now. I'll post a patch.
--
Yao (éå)