From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8004 invoked by alias); 16 Sep 2018 03:12:53 -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 7067 invoked by uid 89); 16 Sep 2018 03:12:52 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 16 Sep 2018 03:12:51 +0000 Received: from [10.0.0.11] (unknown [192.222.164.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 0CC141E186; Sat, 15 Sep 2018 23:12:50 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=simark.ca; s=mail; t=1537067570; bh=X5XKfI3+L1rCjfhSxO7+HHWefkCZiJxPsG1SkYhBg+s=; h=Subject:To:References:From:Date:In-Reply-To:From; b=oT0/yGZMp1Hm9PkaRgLv5WNQ42mFi0RkIh241ZoMJy5iyDOYjXrWBw8CLKIUO3g5d eLJv1Ud8tiWC2v8GOCeVtbGzA//fe8Y2P68ZTCU8rd/WsXG6TZ+EcTAt/sVgRgrHJn U3X4OiPyVxtQf1al6dT4lKdWD2v3Gsp/MWSOEIlE= Subject: Re: [PATCH 1/3] Expand "show disassembler-options" output To: Tom Tromey , gdb-patches@sourceware.org References: <20180915025522.18723-1-tom@tromey.com> <20180915025522.18723-2-tom@tromey.com> From: Simon Marchi Message-ID: <7ebd9559-e2cc-bda5-3f6e-97f6e57ee769@simark.ca> Date: Sun, 16 Sep 2018 03:12:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <20180915025522.18723-2-tom@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-09/txt/msg00520.txt.bz2 On 2018-09-14 10:55 p.m., Tom Tromey wrote: > I typed this: > > (gdb) help set disassembler-options > Set the disassembler options. > Usage: set disassembler-options OPTION [,OPTION]... > > See: 'show disassembler-options' for valid option values. > > ... so I tried what it said and got: > > (gdb) show disassembler-options > The current disassembler options are '' > > This surprised me a little, so this patch adds some text to explain > the situation when an architecture does not have disassembler options. > > While there I noticed one more spot where gdb was not using the GNU > style for metasyntactic variables. This patch fixes this as well. > > gdb/ChangeLog > 2018-09-14 Tom Tromey > > * disasm.c (show_disassembler_options_sfunc): Use GNU style for > metasyntactic variables. Print message if no disassembler options > are available. > --- > gdb/ChangeLog | 6 ++++++ > gdb/disasm.c | 9 +++++++-- > 2 files changed, 13 insertions(+), 2 deletions(-) > > diff --git a/gdb/disasm.c b/gdb/disasm.c > index 11793df67c0..d908af3fb43 100644 > --- a/gdb/disasm.c > +++ b/gdb/disasm.c > @@ -1014,13 +1014,18 @@ show_disassembler_options_sfunc (struct ui_file *file, int from_tty, > valid_options_and_args = gdbarch_valid_disassembler_options (gdbarch); > > if (valid_options_and_args == NULL) > - return; > + { > + fputs_filtered (_("(There are no disassembler options available " > + "for this architecture.)\n"), > + file); > + return; > + } It's probably a matter of taste, but I would use the same format as the message shown when there are options available: no parenthesis and an empty line before. Otherwise, this LGTM. Simon