This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[rfc] Bug fixes for CLI "show" command


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]