From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18723 invoked by alias); 19 Jan 2008 11:06:24 -0000 Received: (qmail 18714 invoked by uid 22791); 19 Jan 2008 11:06:24 -0000 X-Spam-Check-By: sourceware.org Received: from zigzag.lvk.cs.msu.su (HELO zigzag.lvk.cs.msu.su) (158.250.17.23) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 19 Jan 2008 11:06:06 +0000 Received: from Debian-exim by zigzag.lvk.cs.msu.su with spam-scanned (Exim 4.50) id 1JGBWQ-0003Wq-32 for gdb@sources.redhat.com; Sat, 19 Jan 2008 14:06:03 +0300 Received: from localhost ([127.0.0.1] helo=ip6-localhost) by zigzag.lvk.cs.msu.su with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.50) id 1JGBWC-0003We-Rq; Sat, 19 Jan 2008 14:05:45 +0300 From: Vladimir Prus To: Nick Roberts Subject: Re: -var-update using formatted value Date: Sat, 19 Jan 2008 11:06:00 -0000 User-Agent: KMail/1.9.6 (enterprise 0.20070907.709405) Cc: gdb@sources.redhat.com References: <18319.57428.969644.640540@kahikatea.snap.net.nz> In-Reply-To: <18319.57428.969644.640540@kahikatea.snap.net.nz> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200801191405.20336.ghost@cs.msu.su> Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-01/txt/msg00190.txt.bz2 On Friday 18 January 2008 02:10:12 Nick Roberts wrote: > > Update stored value when format changes. > > > > * varobj.c (varobj_set_display_format): Recomputed > > print_value. > > (c_value_of_variable): Return print_value. > > > > diff --git a/gdb/varobj.c b/gdb/varobj.c > > index d078bef..b0eb11a 100644 > > --- a/gdb/varobj.c > > +++ b/gdb/varobj.c > > @@ -677,6 +677,13 @@ varobj_set_display_format (struct varobj *var, > > var->format = variable_default_display (var); > > } > > > > + if (varobj_value_is_changeable_p (var) > > + && var->value && !value_lazy (var->value)) > > + { > > + free (var->print_value); > > + var->print_value = value_get_print_value (var->value, var->format); > > + } > > + > > return var->format; > > } > > > > @@ -2260,7 +2267,7 @@ c_value_of_variable (struct varobj *var) > > > > gdb_assert (varobj_value_is_changeable_p (var)); > > gdb_assert (!value_lazy (var->value)); > > - return value_get_print_value (var->value, var->format); > > + return strdup (var->print_value); > > } > > } > > } > > I don't like this change. If I change the format to hexadecimal, 11 -> 0xb > say, the display should change, so I would like GDB to report it through > -var-update. Why? It seems to me that if user does "change format" in UI, then UI should: 1. Change format 2. Display the value shown according to the new format I cannot imagine any usecase where the frontend would: 1. Change format 2. Step program 3. Issue -var-update - Volodya >