From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 700623856DC4; Wed, 25 May 2022 19:00:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 700623856DC4 From: "tromey at sourceware dot org" To: gdb-prs@sourceware.org Subject: [Bug mi/14607] -var-list-children reports wrong numchild count Date: Wed, 25 May 2022 19:00:41 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: mi X-Bugzilla-Version: 7.5 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tromey at sourceware dot org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2022 19:00:41 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D14607 Tom Tromey changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tromey at sourceware dot o= rg --- Comment #2 from Tom Tromey --- 'numchild' isn't reliable for a dynamic varobj. This is documented in the MI docs: 'numchild' The number of children of the varobj. This number is not necessarily reliable for a dynamic varobj. Instead, you must examine the 'has_more' attribute. This is a little confusing because in this command: -var-list-children --all-values struct1.public ^done,numchild=3D"1",children=3D[child=3D{name=3D"struct1.public.a",exp=3D"= a",numchild=3D"0",value=3D"{...}",type=3D"std::vector >",displayhint=3D"array",dynamic=3D"1"}],has_more=3D"0" ... the has_more here refers to 'struct1.public' (which really only does have one child), and 'a' doesn't have a has_more here. Instead one must list the children of 'a' to find out. So, I'm somewhat inclined to mark this as not a bug. --=20 You are receiving this mail because: You are on the CC list for the bug.=