From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20918 invoked by alias); 10 Jul 2009 18:46:35 -0000 Received: (qmail 20909 invoked by uid 22791); 10 Jul 2009 18:46:34 -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; Fri, 10 Jul 2009 18:46:28 +0000 Received: (qmail 3424 invoked from network); 10 Jul 2009 18:46:17 -0000 Received: from unknown (HELO wind.localnet) (vladimir@127.0.0.2) by mail.codesourcery.com with ESMTPA; 10 Jul 2009 18:46:17 -0000 From: Vladimir Prus To: Tom Tromey Subject: Re: Robustifying pretty-printers Date: Fri, 10 Jul 2009 18:46: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: <200906131411.34204.vladimir@codesourcery.com> <200907102040.34371.vladimir@codesourcery.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <200907102246.16291.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-07/txt/msg00074.txt.bz2 On Friday 10 July 2009 Tom Tromey wrote: > >>>>> "Vladimir" == Vladimir Prus writes: > > Tom> -var-set-child-range 10 20 > Tom> -var-list-children > > Vladimir> And what children with -var-update reevaluate? From 10 to > Vladimir> 20? Or from 0 to 20? If the former, it's not very useful. If > Vladimir> the latter, then it appears that low boundary is only used > Vladimir> for -var-list-children. > > Right. There is a separation between what the varobj code does > internally, and what MI reports to the FE. > > -var-set-child-range affects what is reported to the FE. Only > children in that range are reported. I was assuming the same would be > true even if this were done via arguments to -var-list-children. > > What happens in varobj is another matter. Currently we always fetch > children starting at 0, because the pretty-printers have a simple, > iterator-based design. > > Vladimir> Maybe, it's most useful to decouple setting the range for -var-update > Vladimir> and getting specific children. So, if frontend wants more children > Vladimir> now, it will do: > > Vladimir> -var-list-children 10 20 > > Vladimir> and if it wishes for 20 children to be fetched from now on, it will > Vladimir> explicitly do: > > Vladimir> -var-set-child-limit 20 > > What is the difference between this and "-var-list-children 0 20"? That frontend needs one command, not two. Let me try to explain this in a different way. Suppose we don't have -var-update at all. Then, we don't need any reason for varobj to remember a limit. FE will use -var-list-children to get whatever children it wants to display. With -var-update, we have two choices: 1. Either plugin emits -var-update for individual varobjs, with the desired range, or 2. Varobj remembers the number of children to fetch. 1 is cumbersome. 2 requires that varobj remember the upper limit only. That's why I am suggesting -var-set-child-limit with a single parameter. If I'm not making myself clear yet, maybe we should talk on IRC, say on Monday? - Volodya