Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: gdb-patches@sources.redhat.com
Subject: [rfc] Bug fixes for CLI "show" command
Date: Mon, 19 Apr 2004 20:00:00 -0000	[thread overview]
Message-ID: <20040419200005.GA16011@nevyn.them.org> (raw)

There are two problems with the current "show" command.  One is that
prefixes get doubled.  Type "show" at a GDB prompt:

trust-readonly-sections:  Mode for reading from readonly sections is off.
tui tui active-border-mode:  The attribute mode to use for the active TUI window border is
    "bold-standout".
tui border-kind:  The kind of border for TUI windows is "acs".
tui border-mode:  The attribute mode to use for the TUI window borders is "normal".

See the doubled "tui" in the second line?

The other problem is that it assumes the first five characters of the prefix
are "show ".  I wanted to add a submenu to "maintenance show", so I needed
to use strstr here.

I've committed this to the intercu branch.  If no one has comments I'll
commit it to mainline in a day or two.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

2004-04-19  Daniel Jacobowitz  <drow@mvista.com>

	* cli/cli-setshow.c (cmd_show_list): Check for "show" in the middle
	of prefixes.  Don't print the prefix twice in the CLI.

Index: cli/cli-setshow.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-setshow.c,v
retrieving revision 1.13.12.1
diff -u -p -r1.13.12.1 cli-setshow.c
--- cli/cli-setshow.c	27 Mar 2004 17:37:55 -0000	1.13.12.1
+++ cli/cli-setshow.c	19 Apr 2004 19:55:47 -0000
@@ -364,8 +364,10 @@ cmd_show_list (struct cmd_list_element *
 	{
 	  struct cleanup *optionlist_chain
 	    = make_cleanup_ui_out_tuple_begin_end (uiout, "optionlist");
-	  ui_out_field_string (uiout, "prefix", list->prefixname + 5);
-	  cmd_show_list (*list->prefixlist, from_tty, list->prefixname + 5);
+	  char *new_prefix = strstr (list->prefixname, "show ") + 5;
+	  if (ui_out_is_mi_like_p (uiout))
+	    ui_out_field_string (uiout, "prefix", new_prefix);
+	  cmd_show_list (*list->prefixlist, from_tty, new_prefix);
 	  /* Close the tuple.  */
 	  do_cleanups (optionlist_chain);
 	}


             reply	other threads:[~2004-04-19 20:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-19 20:00 Daniel Jacobowitz [this message]
2004-04-21 14:55 ` Andrew Cagney
2004-04-21 14:59   ` Daniel Jacobowitz
2004-04-21 15:49     ` Andrew Cagney
2004-04-21 15:53       ` Daniel Jacobowitz
2004-04-21 18:39         ` Eli Zaretskii
2004-04-21 19:26           ` Andrew Cagney
2004-04-21 21:48   ` Jason Molenda
2004-04-21 22:22     ` Andrew Cagney
2004-05-10 18:17 ` Daniel Jacobowitz

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=20040419200005.GA16011@nevyn.them.org \
    --to=drow@false.org \
    --cc=gdb-patches@sources.redhat.com \
    /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