From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 120319 invoked by alias); 23 May 2019 19:13:16 -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 120311 invoked by uid 89); 23 May 2019 19:13:16 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= 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 ESMTP; Thu, 23 May 2019 19:13:15 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6222D81E15 for ; Thu, 23 May 2019 19:13:14 +0000 (UTC) Received: from localhost (unused-10-15-17-196.yyz.redhat.com [10.15.17.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id 37DEC183D4; Thu, 23 May 2019 19:13:14 +0000 (UTC) From: Sergio Durigan Junior To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 06/24] Fix "set enum-command value garbage" References: <20190522205327.2568-1-palves@redhat.com> <20190522205327.2568-7-palves@redhat.com> Date: Thu, 23 May 2019 19:13:00 -0000 In-Reply-To: <20190522205327.2568-7-palves@redhat.com> (Pedro Alves's message of "Wed, 22 May 2019 21:53:09 +0100") Message-ID: <8736l5ougm.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2019-05/txt/msg00541.txt.bz2 On Wednesday, May 22 2019, Pedro Alves wrote: > With enum commands, we currently fail to notice garbage after the > value. > > Currently: > > (gdb) set print entry-values compact foo > (gdb) show print entry-values foo > Printing of function arguments at function entry is "compact". > > After this fix: > > (gdb) set print entry-values compact foo > Garbage after item: "foo" I think it would be clearer to specify which item here, otherwise the user might think that the item is "foo". Maybe: Invalid data after item "compact": "foo" What do you think? Otherwise, LGTM. Thanks. > gdb/ChangeLog: > yyyy-mm-dd Pedro Alves > > * cli/cli-setshow.c (do_set_command) : Detect garbage > after item. > --- > gdb/cli/cli-setshow.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c > index 96d7bf5c3c0..9d6479ffca2 100644 > --- a/gdb/cli/cli-setshow.c > +++ b/gdb/cli/cli-setshow.c > @@ -413,6 +413,10 @@ do_set_command (const char *arg, int from_tty, struct cmd_list_element *c) > if (nmatches > 1) > error (_("Ambiguous item \"%s\"."), arg); > > + arg = skip_spaces (arg + len); > + if (*arg != '\0') > + error (_("Garbage after item: \"%s\""), arg); > + > if (*(const char **) c->var != match) > { > *(const char **) c->var = match; > -- > 2.14.5 -- Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/