Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PATCH 1/3] Expand "show disassembler-options" output
Date: Sat, 15 Sep 2018 02:55:00 -0000	[thread overview]
Message-ID: <20180915025522.18723-2-tom@tromey.com> (raw)
In-Reply-To: <20180915025522.18723-1-tom@tromey.com>

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  <tom@tromey.com>

	* 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;
+    }
 
   valid_options = &valid_options_and_args->options;
 
   fprintf_filtered (file, _("\n\
 The following disassembler options are supported for use with the\n\
-'set disassembler-options <option>[,<option>...]' command:\n"));
+'set disassembler-options OPTION [,OPTION]...' command:\n"));
 
   if (valid_options->description != NULL)
     {
-- 
2.17.1


  parent reply	other threads:[~2018-09-15  2:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-15  2:55 [PATCH 0/3] More use of GNU-style metasyntactic variables Tom Tromey
2018-09-15  2:55 ` [PATCH 3/3] Use GNU style for metasyntactic variables in gdbserver Tom Tromey
2018-09-16  3:17   ` Simon Marchi
2018-09-15  2:55 ` [PATCH 2/3] Use GNU style for metasyntactic variables in gdb Tom Tromey
2018-09-16  3:17   ` Simon Marchi
2018-09-16 12:13     ` Tom Tromey
2018-09-16  3:20   ` Simon Marchi
2018-09-16 12:16     ` Tom Tromey
2018-09-16 12:42     ` Tom Tromey
2018-09-15  2:55 ` Tom Tromey [this message]
2018-09-16  3:12   ` [PATCH 1/3] Expand "show disassembler-options" output Simon Marchi
2018-09-16 12:18     ` Tom Tromey

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=20180915025522.18723-2-tom@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    /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