From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32359 invoked by alias); 4 Sep 2014 19:57:48 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 32348 invoked by uid 89); 4 Sep 2014 19:57:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.0 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 04 Sep 2014 19:57:46 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s84Jvgpn021374 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 4 Sep 2014 15:57:42 -0400 Received: from localhost (dhcp-10-15-16-169.yyz.redhat.com [10.15.16.169]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s84JvfSd002448 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Thu, 4 Sep 2014 15:57:42 -0400 From: Sergio Durigan Junior To: Gabriel Krisman Bertazi Cc: Pedro Alves , gdb-patches@sourceware.org Subject: Re: [PATCH] Fix PR gdb/17035: "show user" doesn't list user-defined commands that have empty bodies. References: <1408515134-31165-1-git-send-email-gabriel@krisman.be> <53F615D8.5000901@redhat.com> <878umgaqjk.fsf@krisman.be> <53FDC751.3000902@redhat.com> <87sikc1p8z.fsf@anubis.Home> <5405BD6E.9080000@redhat.com> <87a96frxu5.fsf@anubis.Home> X-URL: http://www.redhat.com Date: Thu, 04 Sep 2014 19:57:00 -0000 In-Reply-To: <87a96frxu5.fsf@anubis.Home> (Gabriel Krisman Bertazi's message of "Thu, 04 Sep 2014 16:26:42 -0300") Message-ID: <874mwn9n0q.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2014-09/txt/msg00132.txt.bz2 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/