From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8734 invoked by alias); 12 Mar 2006 07:58:28 -0000 Received: (qmail 8726 invoked by uid 22791); 12 Mar 2006 07:58:27 -0000 X-Spam-Check-By: sourceware.org Received: from viper.snap.net.nz (HELO viper.snap.net.nz) (202.37.101.8) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 12 Mar 2006 07:58:25 +0000 Received: from kahikatea.snap.net.nz (p202-124-114-31.snap.net.nz [202.124.114.31]) by viper.snap.net.nz (Postfix) with ESMTP id C9624748C0A for ; Sun, 12 Mar 2006 20:58:13 +1300 (NZDT) Received: by kahikatea.snap.net.nz (Postfix, from userid 500) id 5B15C88DD; Sun, 12 Mar 2006 20:56:46 +1300 (NZDT) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17427.54333.236860.258115@kahikatea.snap.net.nz> Date: Mon, 13 Mar 2006 02:44:00 -0000 To: gdb-patches@sources.redhat.com Subject: Re: MI: type prefixes for values In-Reply-To: References: Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-03/txt/msg00173.txt.bz2 > Also, I note that gdb is currently inconsitent even within itself: > > (gdb) > -thread-select 2 > ^done,new-thread-id="2",frame={level="0",func="thread", > args=[{name="p",value="0x0"}],.......... > (gdb) > -stack-list-arguments 1 0 0 > ^done,stack-args=[frame={level="0", > args=[{name="p",value="(void *) 0x0"}]}] > > Note that first output has "0x0" as value of 'p', and the second has > "(void *)0x0". Here's a patch that doesn't print the type with the value for -stack-list-arguments and -stack-list-list-locals (they both use list_args_or_locals). The screenshot http://www.inet.net.nz/~nickrob/gdb-ui.png shows the duplication that arises from the current code (in the upper right hand window (locals of emacs) of the Emacs frame). Nick 2006-03-12 Nick Roberts * mi/mi-cmd-stack.c (list_args_or_locals): Use common_val_print instead of print_variable_value so that type doesn't get printed with value. *** mi-cmd-stack.c 05 Jan 2006 10:56:18 +1300 1.29 --- mi-cmd-stack.c 12 Mar 2006 19:44:08 +1300 *************** list_args_or_locals (int locals, int val *** 278,283 **** --- 278,284 ---- { struct cleanup *cleanup_tuple = NULL; struct symbol *sym2; + struct value *val; if (values != PRINT_NO_VALUES) cleanup_tuple = make_cleanup_ui_out_tuple_begin_end (uiout, NULL); *************** list_args_or_locals (int locals, int val *** 300,312 **** && TYPE_CODE (type) != TYPE_CODE_STRUCT && TYPE_CODE (type) != TYPE_CODE_UNION) { ! print_variable_value (sym2, fi, stb->stream); ui_out_field_stream (uiout, "value", stb); } do_cleanups (cleanup_tuple); break; case PRINT_ALL_VALUES: ! print_variable_value (sym2, fi, stb->stream); ui_out_field_stream (uiout, "value", stb); do_cleanups (cleanup_tuple); break; --- 301,317 ---- && TYPE_CODE (type) != TYPE_CODE_STRUCT && TYPE_CODE (type) != TYPE_CODE_UNION) { ! val = read_var_value (sym2, fi); ! common_val_print ! (val, stb->stream, 0, 0, 2, Val_no_prettyprint); ui_out_field_stream (uiout, "value", stb); } do_cleanups (cleanup_tuple); break; case PRINT_ALL_VALUES: ! val = read_var_value (sym2, fi); ! common_val_print ! (val, stb->stream, 0, 0, 2, Val_no_prettyprint); ui_out_field_stream (uiout, "value", stb); do_cleanups (cleanup_tuple); break;