From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10220 invoked by alias); 19 Feb 2010 19:52:10 -0000 Received: (qmail 10209 invoked by uid 22791); 19 Feb 2010 19:52:08 -0000 X-SWARE-Spam-Status: No, hits=-8.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 19 Feb 2010 19:52:03 +0000 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o1JJpe8W006740 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 19 Feb 2010 14:51:40 -0500 Received: from qcore.mollernet.net (vpn-234-207.phx2.redhat.com [10.3.234.207]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o1JJpaak022082; Fri, 19 Feb 2010 14:51:38 -0500 Message-ID: <4B7EEBC8.7060206@redhat.com> Date: Fri, 19 Feb 2010 19:52:00 -0000 From: Chris Moller User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Thunderbird/3.0b2 MIME-Version: 1.0 To: Jan Kratochvil CC: Joel Brobecker , gdb-patches@sourceware.org Subject: Re: pr 11067 patch References: <4B737180.4050802@redhat.com> <20100211092950.GC2907@adacore.com> <20100212041137.GE2907@adacore.com> <4B75783D.6050103@redhat.com> <20100213114933.GA595@host0.dyn.jankratochvil.net> <4B76F5CE.30704@redhat.com> <20100219142846.GC2779@adacore.com> <20100219143609.GA1210@host0.dyn.jankratochvil.net> <4B7EA5F9.6030001@redhat.com> <20100219185004.GA23504@host0.dyn.jankratochvil.net> In-Reply-To: <20100219185004.GA23504@host0.dyn.jankratochvil.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 2010-02/txt/msg00503.txt.bz2 On 02/19/10 13:50, Jan Kratochvil wrote: > On Fri, 19 Feb 2010 15:53:45 +0100, Chris Moller wrote: > >> The problem is that I don't know any way to change the enum >> formatting for CLI but leave it alone for MI-. >> > ... > >> some way to distinguish between running under CLI vs. MI if that's the right >> thing to do. >> > > After I wrote the patch below according to Tom Tromey the Python pretty > printing applies even to the MI protocol values, therefore IMO it should also > apply to this new enum printing which is also some form of pretty printing. > > Therefore my MI / CLI suggestion has been already rejected by the Python > pretty printing precedence and the patch below should be dropped. > How about this: The existing patch contains a test if (options->summary || recurse != 0) fputs_filtered (TYPE_FIELD_NAME (type, i), stream); else { /* new formatting stuff */ } That limited the format change to unsummarised top-level "p " 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? Chris