From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5349 invoked by alias); 22 Feb 2010 09:22:55 -0000 Received: (qmail 5331 invoked by uid 22791); 22 Feb 2010 09:22:54 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 22 Feb 2010 09:22:50 +0000 Received: (qmail 18488 invoked from network); 22 Feb 2010 09:22:48 -0000 Received: from unknown (HELO wind.localnet) (vladimir@127.0.0.2) by mail.codesourcery.com with ESMTPA; 22 Feb 2010 09:22:48 -0000 From: Vladimir Prus To: Jan Kratochvil Subject: Re: pr 11067 patch Date: Mon, 22 Feb 2010 09:22:00 -0000 User-Agent: KMail/1.12.2 (Linux/2.6.31-19-generic-pae; KDE/4.3.2; i686; ; ) Cc: Joel Brobecker , gdb-patches@sourceware.org, Chris Moller References: <4B7EEBC8.7060206@redhat.com> <20100219201105.GA30692@host0.dyn.jankratochvil.net> In-Reply-To: <20100219201105.GA30692@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <201002221222.46794.vladimir@codesourcery.com> 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: 2010-02/txt/msg00522.txt.bz2 On Friday 19 February 2010 23:11:05 Jan Kratochvil wrote: > On Fri, 19 Feb 2010 20:51:36 +0100, Chris Moller wrote: > > That limited the format change to unsummarised top-level "p > thingy>" circumstances. If I make that test > > > > if (options->summary || recurse != 0 || > > ui_out_is_mi_like_p (interp_ui_out > > (top_level_interpreter ()))) > > > > i.e., checking if the print is to an MI whatever-it-is, the MI tests > > that failed under the original patch (mi-var-display and > > mi2-var-display) run okay as they originally were, which suggests to > > me that MI will go on getting enums formatted the way it expects > > them. Will that work? > > I would prefer the value_print_options way but rather: > > > Vladimir, if CLI start print instead of > (gdb) p enum_var > $1 = enumerator2 > now: > (gdb) p enum_var > $1 = enumerator2 = (enum uenum) 2 > > should MI also print this "pretty printed" enum syntax or should it stick with > the original one? Therefore should be made this change? > > mi_gdb_test "-var-evaluate-expression anone" \ > - "\\^done,value=\"A\"" \ > + "\\^done,value=\"A = \\(enum \\)0\"" \ > "eval variable anone" Hi Jan, I am not 100% sure but I am concerned about the above output having 'enum uenum' -- which is essentially the type of the variable. And MI already reports type separately. I recall I've made some changed before to specifically stop GDB from including the type of variable inside value field when the type is function. So, I suggest that this output is not included for MI. It might be OK to output a separate field, e.g. "enum_integer_value" -- with the integer value as printed above -- but I don't have a feeling if frontends really need that at this point. Thanks, -- Vladimir Prus CodeSourcery vladimir@codesourcery.com (650) 331-3385 x722