This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix PR gdb/17035: "show user" doesn't list user-defined commands that have empty bodies.
- From: Pedro Alves <palves at redhat dot com>
- To: Gabriel Krisman Bertazi <gabriel at krisman dot be>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 05 Sep 2014 14:12:18 +0100
- Subject: Re: [PATCH] Fix PR gdb/17035: "show user" doesn't list user-defined commands that have empty bodies.
- Authentication-results: sourceware.org; auth=none
- References: <1408515134-31165-1-git-send-email-gabriel at krisman dot be> <53F615D8 dot 5000901 at redhat dot com> <878umgaqjk dot fsf at krisman dot be> <53FDC751 dot 3000902 at redhat dot com> <87sikc1p8z dot fsf at anubis dot Home> <5405BD6E dot 9080000 at redhat dot com> <87a96frxu5 dot fsf at anubis dot Home>
On 09/04/2014 08:26 PM, Gabriel Krisman Bertazi wrote:
> Pedro Alves <palves@redhat.com> writes:
>
>> Yeah. Close now. Only nits on the details.
>
> Guess I fixed all the things you pointed out.
Excellent!
>
>> cli_user_command_p (struct cmd_list_element *cmd)
>
> I implemented that as well. Thanks.
>
> Updated patch below. :)
Thanks!
Ideally you'd send a 'git am'able patch, with commit log
in place too. That is, treat the commit log as just
another part of the patch that gets updated/resent.
>
> gdb/
> 2014-08-20 Gabriel Krisman Bertazi <gabriel@krisman.be>
>
> * cli/cli-cmds.c (show_user): Use cli_user_command_p to
> decide whether we display the command on "show user".
Note that the "decide" should be indented with a tab only, under
the '*'.
> * cli/cli-script.c (show_user_1): Only verify cmdlines after
> printing command name.
> * cli/cli-decode.h (cli_user_command_p): Declare new function.
> * cli/cli-decode.c (cli_user_command_p): Create helper function
> to verify whether cmd_list_element is a user-defined command.
>
> gdb/testsuite/
> 2014-08-20 Gabriel Krisman Bertazi <gabriel@krisman.be>
>
> * gdb.base/commands.exp: Add tests to verify user-defined
> commands with empty bodies.
> * gdb.python/py-cmd.exp: Test that we don't show user-defined
> python commands in `show user command`.
> * gdb.python/scm-cmd.exp: Test that we don't show user-defined
> scheme commands in `show user command`.
Likewise everywhere else.
> extern const char * const auto_boolean_enums[];
>
> +/* Verify whether a given cmd_list_element is a user-defined command.
> + Return 1 if it is user-defined. Return 0 otherwise. */
> +
> +int cli_user_command_p (struct cmd_list_element *);
Note that every other declaration in the header uses explicit
"extern". Please add that for consistency. OK with these
little nits fixed. Please push.
Thanks!
Pedro Alves