Re: [PATCH] Allow user-defined as a category for python gdb macros (resend)

Phil Muldoon
2012-02-14T12:48:56Z

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