From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15192 invoked by alias); 16 May 2006 03:46:22 -0000 Received: (qmail 15183 invoked by uid 22791); 16 May 2006 03:46:21 -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; Tue, 16 May 2006 03:46:17 +0000 Received: from farnswood.snap.net.nz (p202-124-112-110.snap.net.nz [202.124.112.110]) by viper.snap.net.nz (Postfix) with ESMTP id D7FEB757CB1; Tue, 16 May 2006 15:46:15 +1200 (NZST) Received: by farnswood.snap.net.nz (Postfix, from userid 500) id 8BE6E627ED; Tue, 16 May 2006 04:45:42 +0100 (BST) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17513.19171.970773.431536@farnswood.snap.net.nz> Date: Tue, 16 May 2006 06:10:00 -0000 To: Daniel Jacobowitz Cc: Vladimir Prus , gdb-patches@sources.redhat.com Subject: Re: MI: type prefixes for values In-Reply-To: <20060515165354.GG28924@nevyn.them.org> References: <17427.54333.236860.258115@kahikatea.snap.net.nz> <20060317191207.GA19068@nevyn.them.org> <20060324030332.GB2853@nevyn.them.org> <20060324202056.GA26748@nevyn.them.org> <20060505192535.GM31029@nevyn.them.org> <20060515165354.GG28924@nevyn.them.org> X-Mailer: VM 7.19 under Emacs 22.0.50.52 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-05/txt/msg00350.txt.bz2 > > > This patch doesn't touch the issue of type prefixes, leaving that to > > > deal with separately. > > > > If I'm reading this right, I have since realised that my patch to use > > common_val_print was no good because it only prints address and not values > > for things like references > > Vladimir noticed that there's a deref_ref argument to common_val_print; > you passed zero, but if you pass one instead, it ought to do the right > thing. > > Would you like to try the patch again with that change? Yes, it works as you suggest. The testsuite is unchanged (-stack-list-locals only prints the type for integers and there are no tests for -stack-list-args). It might be a good idea to create a test for a reference variable. Previously I suggested that a test for your change to val_print could be done in mi-var-display.exp or mi-var-cmd.exp, but it needn't be as a variable object and it could presumably be combined with this test in mi-stack.exp. -- Nick http://www.inet.net.nz/~nickrob 2006-05-17 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 17 May 2006 15:00:29 +1200 *************** 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, 1, 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, 1, 2, Val_no_prettyprint); ui_out_field_stream (uiout, "value", stb); do_cleanups (cleanup_tuple); break;