Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [rfc] Bug fixes for CLI "show" command
@ 2004-04-19 20:00 Daniel Jacobowitz
  2004-04-21 14:55 ` Andrew Cagney
  2004-05-10 18:17 ` Daniel Jacobowitz
  0 siblings, 2 replies; 10+ messages in thread
From: Daniel Jacobowitz @ 2004-04-19 20:00 UTC (permalink / raw)
  To: gdb-patches

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);
 	}


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2004-05-10 18:17 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-19 20:00 [rfc] Bug fixes for CLI "show" command Daniel Jacobowitz
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox