From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12976 invoked by alias); 19 Aug 2009 06:12:16 -0000 Received: (qmail 12955 invoked by uid 22791); 19 Aug 2009 06:12:15 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 19 Aug 2009 06:12:06 +0000 Received: (qmail 17469 invoked from network); 19 Aug 2009 06:12:04 -0000 Received: from unknown (HELO wind.localnet) (vladimir@127.0.0.2) by mail.codesourcery.com with ESMTPA; 19 Aug 2009 06:12:04 -0000 From: Vladimir Prus To: Tom Tromey Subject: Re: MI & pretty-printing Date: Wed, 19 Aug 2009 06:51:00 -0000 User-Agent: KMail/1.11.90 (Linux/2.6.24-24-generic; KDE/4.2.90; i686; svn-979530; 2009-06-10) Cc: gdb@sources.redhat.com References: <200907132142.18043.vladimir@codesourcery.com> <200908180956.33876.vladimir@codesourcery.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <200908191012.02517.vladimir@codesourcery.com> 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: 2009-08/txt/msg00165.txt.bz2 On Tuesday 18 August 2009 Tom Tromey wrote: > >>>>> "Volodya" == Vladimir Prus writes: > > Tom> We discussed it but, IIRC, did not come to any agreement about it. > > Volodya> Hmm, I though we decided that some hint to pretty-printers is > Volodya> desirable. Anyway, let me repeat my point -- the descriptive > Volodya> string is rather long, so might not fit in variables > Volodya> window. Further, a frontend typically has some way to display > Volodya> variable type already, so "std::vector" part of the string is > Volodya> not helping either. So, I'd much rather have {...} for all > Volodya> composite types in MI. > > I suppose we could have dynamic varobjs with children print "{...}" here > always. That's clearly one possibility. > Or you could just do whatever you like in your GUI. Can I? How do I know if a varobj is dynamic? ;-) > I hesitate > to change this because it isn't clear to me that "{...}" is a > universally good choice for all GUIs and all printers. I guess the most important question is that of mechanism. Right now, we have one case (for a specific type/frontend combo) where the string rendering of a value with children is not suitable. There might be cases where it makes sense to use non-{...} rendering for a type with children. Do we have a mechanism how pretty-printer can use different string rendering for MI and CLI? If we don't have it now, then I'd still prefer to have all these change be merged to FSF HEAD, without waiting for such mechanism to be designed. But then, for now, it's better to have the most conservative behaviour, so that frontends do not start to depend on string rendering of varobjs with children. And {...} seems like the most conservative thing possible. Then, if we run into type that both have children and have string rendering that makes sense in MI, we can introduce some solution? > Volodya> I don't know either. The current behaviour *feels* strange, but then my > Volodya> WIP patch for kdevelop does not use this field at all, for incremental > Volodya> fetches. Maybe we can leave it as is, for now. > > Yeah, I'm not sure if you need to watch the length for an increment > -var-list-children. Well, I guess for consistency, it's best to either drop numchild from incremental -var-list-children response, or make it report the number of children that is actually contained in the 'children' field. > But, you definitely do for a -var-update. Agreed. - Volodya