This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Allow user-defined as a category for python gdb macros (resend)
- From: Doug Evans <dje at google dot com>
- To: Scott Goldman <scottjg at vmware dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Mon, 13 Feb 2012 19:12:38 -0800
- Subject: Re: [PATCH] Allow user-defined as a category for python gdb macros (resend)
- References: <03E840D17E263A48A5766AD576E0423A03D72B653F@exch-mbx-111.vmware.com>
On Mon, Feb 13, 2012 at 4:48 PM, Scott Goldman <scottjg@vmware.com> wrote:
> --- a/gdb/top.c
> +++ b/gdb/top.c
> @@ -470,7 +470,7 @@ execute_command (char *p, int from_tty)
> ? ? ? if (c->flags & DEPRECATED_WARN_USER)
> ? ? ? ?deprecated_cmd_warning (&line);
>
> - ? ? ?if (c->class == class_user)
> + ? ? ?if (c->class == class_user && c->user_commands)
> ? ? ? ?execute_user_command (c, arg);
> ? ? ? else if (c->type == set_cmd || c->type == show_cmd)
> ? ? ? ?do_setshow_command (arg, from_tty, c);
This change is a bit obscure.
At the very least, I think this requires a proper comment explaining
why one needs to test c->user_commands.
Also, this patch feels like it's incomplete.
If I can see "user" python "macros" [sic] then happens if I do "show
user foo"? (a user may reasonably ask)
And given that that won't work, we'll have to explain(document) why.
Plus one now needs to explain that "document" and
"max-user-call-depth" don't apply to these commands (it may seem
obvious, but they show up in "apropos user-defined", and thus to not
document these things means the patch is incomplete).
I wonder if any more unforeseen changes will be needed.