From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10791 invoked by alias); 19 Apr 2004 20:00:07 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 10781 invoked from network); 19 Apr 2004 20:00:05 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 19 Apr 2004 20:00:05 -0000 Received: from drow by nevyn.them.org with local (Exim 4.32 #1 (Debian)) id 1BFew1-0004IW-AX for ; Mon, 19 Apr 2004 16:00:05 -0400 Date: Mon, 19 Apr 2004 20:00:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sources.redhat.com Subject: [rfc] Bug fixes for CLI "show" command Message-ID: <20040419200005.GA16011@nevyn.them.org> Mail-Followup-To: gdb-patches@sources.redhat.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.5.1+cvs20040105i X-SW-Source: 2004-04/txt/msg00446.txt.bz2 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 * 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); }