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: Phil Muldoon <pmuldoon at redhat dot com>
- To: Scott Goldman <scottjg at vmware dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Tue, 14 Feb 2012 12:48:32 +0000
- Subject: Re: [PATCH] Allow user-defined as a category for python gdb macros (resend)
- References: <03E840D17E263A48A5766AD576E0423A03D72B653F@exch-mbx-111.vmware.com>
On 02/14/2012 12:48 AM, Scott Goldman wrote:
> This patch allows python macros to coexist with legacy gdb macros in
> user-defined category. This way, it's possible to organize your macros
> such that `help user` shows both legacy and python macros. I also
> modified the documentation to use the `user` category in the example
> python macro. It seemed like a more reasonable default category than
> `obscure`.
Thanks.
> 2012-02-13 Scott J. Goldman <scottjg@vmware.com>
>
> * gdb.texinfo: put example python macro in COMMAND_USER category
> rather than COMMAND_OBSCURE.
Documentation entries have their own ChangeLog in doc/. Also, you
should put the node in the () where that change occurs. Also,
ChangeLogs require complete sentences with punctuation/capitalization;
here, and other entries.
> * py-cmd.c (cmdpy_init): treat class_user as a valid class in error check
> (gdbpy_initialize_commands): Add COMMAND_USER as a constant in
> gdb python api.
Paths have to be complete in ChangeLogs relative to where the
ChangeLog is located, so in this case: python/py-cmd.c
> * top.c (execute_command): only execute a user-defined command as a
> legacy macro if c->user_commands is set.
I think this patch is generally fine, but I think it needs a
test-case. It should be fairly simple to write one. Any new feature,
or regression fix generally requires a test-case to catch any future
regression. This is especially relevant in the Python areas of GDB
which are under constant development.
Cheers,
Phil