From: Sergio Durigan Junior <sergiodj@redhat.com>
To: Gabriel Krisman Bertazi <gabriel@krisman.be>
Cc: Pedro Alves <palves@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Fix PR gdb/17035: "show user" doesn't list user-defined commands that have empty bodies.
Date: Thu, 04 Sep 2014 19:57:00 -0000 [thread overview]
Message-ID: <874mwn9n0q.fsf@redhat.com> (raw)
In-Reply-To: <87a96frxu5.fsf@anubis.Home> (Gabriel Krisman Bertazi's message of "Thu, 04 Sep 2014 16:26:42 -0300")
On Thursday, September 04 2014, Gabriel Krisman Bertazi wrote:
> diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c
> index c409d9c..914a8e3 100644
> --- a/gdb/cli/cli-decode.c
> +++ b/gdb/cli/cli-decode.c
> @@ -1884,3 +1884,10 @@ cmd_func (struct cmd_list_element *cmd, char *args, int from_tty)
> else
> error (_("Invalid command"));
> }
> +
> +int
> +cli_user_command_p (struct cmd_list_element *cmd)
> +{
> + return (cmd->class == class_user
> + && (cmd->func == do_cfunc || cmd->func == do_sfunc));
> +}
Thanks for the patch.
You correctly commented the function prototype on cli/cli-decode.h, but
it is also a good practice to put a comment in the function definition
as well, like:
/* See declaration on cli/cli-decode.h. */
int
cli_user_command_p (struct cmd_list_element *cmd)
...
Other than that, looks OK.
Cheers,
--
Sergio
GPG key ID: 0x65FC5E36
Please send encrypted e-mail if possible
http://sergiodj.net/
next prev parent reply other threads:[~2014-09-04 19:57 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-20 6:12 Gabriel Krisman Bertazi
2014-08-21 15:53 ` Pedro Alves
2014-08-23 2:27 ` Gabriel Krisman Bertazi
2014-08-27 11:56 ` Pedro Alves
2014-08-31 18:35 ` Gabriel Krisman Bertazi
2014-09-02 12:52 ` Pedro Alves
2014-09-04 19:26 ` Gabriel Krisman Bertazi
2014-09-04 19:57 ` Sergio Durigan Junior [this message]
2014-09-05 13:12 ` Pedro Alves
2014-09-08 0:44 ` Gabriel Krisman Bertazi
2014-09-09 21:19 ` Sergio Durigan Junior
2014-08-21 21:20 ` Sergio Durigan Junior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874mwn9n0q.fsf@redhat.com \
--to=sergiodj@redhat.com \
--cc=gabriel@krisman.be \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox