From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4764 invoked by alias); 16 Sep 2009 05:45:10 -0000 Received: (qmail 4743 invoked by uid 22791); 16 Sep 2009 05:45:10 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_36,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from lo.gmane.org (HELO lo.gmane.org) (80.91.229.12) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 16 Sep 2009 05:45:06 +0000 Received: from list by lo.gmane.org with local (Exim 4.50) id 1MnnKC-0006d1-RR for gdb-patches@sources.redhat.com; Wed, 16 Sep 2009 07:45:04 +0200 Received: from h86-62-88-129.ln.rinet.ru ([86.62.88.129]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 16 Sep 2009 07:45:04 +0200 Received: from vladimir by h86-62-88-129.ln.rinet.ru with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 16 Sep 2009 07:45:04 +0200 To: gdb-patches@sources.redhat.com From: Vladimir Prus Subject: Re: Patch: implement new dynamic varobj spec Date: Wed, 16 Sep 2009 05:45:00 -0000 Message-ID: References: <19120.5383.874148.235514@totara.tehura.co.nz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit User-Agent: KNode/0.10.9 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: 2009-09/txt/msg00500.txt.bz2 Nick Roberts wrote: > > With a dynamic varobj you can tell if it has children by examining the > > has_more attribute. > > The field has_more tells you if it _currently_ has children. If you create a > variable object of a STL container immediately after declaring an empty > container, e.g. after > > map m; > > then has_more=0 yet the node for it would need to be expandable. In Emacs > this means there is a plus sign on the icon in the toolbar. Clicking on > it gives no immediate children but then as you proceed: > > l.push_back (1); > l.push_back (2); > > the additional children appear. With a string there are never any children > so you would not want an expandable node. AFAICS the only way the front end > can discriminate is through the displayhint field. Right, so for string you'll have numchildren=0, has_more=0, and no need to make anything expandable. For vector that is initially empty, you'll have the same, so it won't be expandable, but if things are pushed, -var-update will report has_more=1. You can detect that, and make the item expandable at this point. - Volodya