From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1592 invoked by alias); 4 Feb 2008 21:40:25 -0000 Received: (qmail 1582 invoked by uid 22791); 4 Feb 2008 21:40:24 -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; Mon, 04 Feb 2008 21:39:55 +0000 Received: from kahikatea.snap.net.nz (136.62.255.123.dynamic.snap.net.nz [123.255.62.136]) by viper.snap.net.nz (Postfix) with ESMTP id 8A7AA3D9E62; Tue, 5 Feb 2008 10:39:52 +1300 (NZDT) Received: by kahikatea.snap.net.nz (Postfix, from userid 1000) id D8BE88FC6D; Tue, 5 Feb 2008 10:39:44 +1300 (NZDT) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18343.34335.642831.945359@kahikatea.snap.net.nz> Date: Mon, 04 Feb 2008 21:40:00 -0000 To: "Marc Khouzam" Cc: "Daniel Jacobowitz" , Subject: RE: [Patch] -var-evaluate-expression NAME [FORMAT] In-Reply-To: <6D19CA8D71C89C43A057926FE0D4ADAA04290E86@ecamlmw720.eamcs.ericsson.se> References: <20080203214530.GB12139@caradoc.them.org> <6D19CA8D71C89C43A057926FE0D4ADAA04290E86@ecamlmw720.eamcs.ericsson.se> X-Mailer: VM 7.19 under Emacs 22.1.50.23 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-02/txt/msg00089.txt.bz2 > My patch no longer works with the patch Vladimir applied > http://sourceware.org/ml/gdb/2008-02/msg00006.html > The reason is that Vladimir's patch has c_value_of_variable() > always use the stored print_value which is formatted based on the > current display format (and not the one specified as an option > to -var-evaluate-expression.) I think that is a good way to do it. > > One solution is to revert c_value_of_variable: > - return xstrdup (var->print_value); > + return value_get_print_value (var->value, var->format); > > Although this is very easy, personally, I don't like that too much. > > Another option is to not only temporarily set var->format > but also var->print_value (by calling varobj_set_display_format). > I like this even less. > > I think a solution based on > http://sourceware.org/ml/gdb-patches/2008-01/msg00531.html > is probably the cleanest. Can I have an educated opinion on > this decision? This also uses value_get_print_value in c_value_of_variable. I can't seem to apply your earlier patch as I get spurious characters when I save it (= -> =3D, \n -> =20\n, etc) but I wonder if we've made things too complicated. What happens if you just use value_get_print_value (var->value, var->format) directly in mi_cmd_var_evaluate_expression instead of varobj_get_value (var)? -- Nick http://www.inet.net.nz/~nickrob