From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8518 invoked by alias); 5 Sep 2014 13:12:27 -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 8503 invoked by uid 89); 5 Sep 2014 13:12:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.8 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; Fri, 05 Sep 2014 13:12:25 +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 s85DCK7Q014023 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 5 Sep 2014 09:12:21 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s85DCIPk002293; Fri, 5 Sep 2014 09:12:19 -0400 Message-ID: <5409B6B2.9000202@redhat.com> Date: Fri, 05 Sep 2014 13:12:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0 MIME-Version: 1.0 To: Gabriel Krisman Bertazi CC: 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> In-Reply-To: <87a96frxu5.fsf@anubis.Home> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-09/txt/msg00145.txt.bz2 On 09/04/2014 08:26 PM, Gabriel Krisman Bertazi wrote: > Pedro Alves 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 > > * 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 > > * 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