public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug mi/14607] New: -var-list-children reports wrong numchild count
@ 2012-09-22  9:19 niko.sams at gmail dot com
  2012-09-22  9:21 ` [Bug mi/14607] " niko.sams at gmail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: niko.sams at gmail dot com @ 2012-09-22  9:19 UTC (permalink / raw)
  To: gdb-prs


http://sourceware.org/bugzilla/show_bug.cgi?id=14607

             Bug #: 14607
           Summary: -var-list-children reports wrong numchild count
           Product: gdb
           Version: 7.5
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mi
        AssignedTo: unassigned@sourceware.org
        ReportedBy: niko.sams@gmail.com
    Classification: Unclassified


To reproduce see this example debug session:

cat main.cpp
#include <vector>

int main()
{
    struct {
        std::vector<int> a;
    } struct1;

    struct1.a.push_back(10);
    struct1.a.push_back(100);

    return 0;
}


gdb --interpreter=mi2 testdebugee

-enable-pretty-printing
break main.cpp:12
-exec-run

-var-create struct1 @ struct1

-var-list-children --all-values struct1
^done,numchild="1",children=[child={name="struct1.public",exp="public",numchild="1",value="",thread-id="1"}],has_more="0"

-var-list-children --all-values struct1.public
^done,numchild="1",children=[child={name="struct1.public.a",exp="a",numchild="0",value="{...}",type="std::vector<int,
std::allocator<int>
>",thread-id="1",displayhint="array",dynamic="1"}],has_more="0"
                                                                            
^^^^ should be "2"

#correct:
-var-list-children --all-values struct1.public.a
^done,numchild="2",displayhint="array",children=[child={name="struct1.public.a.[0]",exp="[0]",numchild="0",value="10",type="int",thread-id="1"},child={name="struct1.public.a.[1]",exp="[1]",numchild="0",value="100",type="int",thread-id="1"}],ha

#correct:
-var-info-num-children struct1.public.a
^done,numchild="2"

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug mi/14607] -var-list-children reports wrong numchild count
  2012-09-22  9:19 [Bug mi/14607] New: -var-list-children reports wrong numchild count niko.sams at gmail dot com
@ 2012-09-22  9:21 ` niko.sams at gmail dot com
  2012-09-22  9:24 ` niko.sams at gmail dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: niko.sams at gmail dot com @ 2012-09-22  9:21 UTC (permalink / raw)
  To: gdb-prs


http://sourceware.org/bugzilla/show_bug.cgi?id=14607

--- Comment #1 from Niko Sams <niko.sams at gmail dot com> 2012-09-22 09:21:48 UTC ---
ok the ^^^^ doesn't point where I wanted it to. To be more clear:
Current output:
{name="struct1.public.a",exp="a",numchild="0"

Expected output:
{name="struct1.public.a",exp="a",numchild="2"

(after -var-list-children --all-values struct1.public)

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug mi/14607] -var-list-children reports wrong numchild count
  2012-09-22  9:19 [Bug mi/14607] New: -var-list-children reports wrong numchild count niko.sams at gmail dot com
  2012-09-22  9:21 ` [Bug mi/14607] " niko.sams at gmail dot com
@ 2012-09-22  9:24 ` niko.sams at gmail dot com
  2022-05-25 19:00 ` tromey at sourceware dot org
  2023-08-31 17:29 ` tromey at sourceware dot org
  3 siblings, 0 replies; 5+ messages in thread
From: niko.sams at gmail dot com @ 2012-09-22  9:24 UTC (permalink / raw)
  To: gdb-prs


http://sourceware.org/bugzilla/show_bug.cgi?id=14607

Niko Sams <niko.sams at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |niko.sams at gmail dot com

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug mi/14607] -var-list-children reports wrong numchild count
  2012-09-22  9:19 [Bug mi/14607] New: -var-list-children reports wrong numchild count niko.sams at gmail dot com
  2012-09-22  9:21 ` [Bug mi/14607] " niko.sams at gmail dot com
  2012-09-22  9:24 ` niko.sams at gmail dot com
@ 2022-05-25 19:00 ` tromey at sourceware dot org
  2023-08-31 17:29 ` tromey at sourceware dot org
  3 siblings, 0 replies; 5+ messages in thread
From: tromey at sourceware dot org @ 2022-05-25 19:00 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=14607

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org

--- Comment #2 from Tom Tromey <tromey at sourceware dot org> ---
'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="1",children=[child={name="struct1.public.a",exp="a",numchild="0",value="{...}",type="std::vector<int,
std::allocator<int> >",displayhint="array",dynamic="1"}],has_more="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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug mi/14607] -var-list-children reports wrong numchild count
  2012-09-22  9:19 [Bug mi/14607] New: -var-list-children reports wrong numchild count niko.sams at gmail dot com
                   ` (2 preceding siblings ...)
  2022-05-25 19:00 ` tromey at sourceware dot org
@ 2023-08-31 17:29 ` tromey at sourceware dot org
  3 siblings, 0 replies; 5+ messages in thread
From: tromey at sourceware dot org @ 2023-08-31 17:29 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=14607

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|NEW                         |RESOLVED

--- Comment #3 from Tom Tromey <tromey at sourceware dot org> ---
Finally came back around to this.
I think it isn't a bug.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-08-31 17:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-22  9:19 [Bug mi/14607] New: -var-list-children reports wrong numchild count niko.sams at gmail dot com
2012-09-22  9:21 ` [Bug mi/14607] " niko.sams at gmail dot com
2012-09-22  9:24 ` niko.sams at gmail dot com
2022-05-25 19:00 ` tromey at sourceware dot org
2023-08-31 17:29 ` tromey at sourceware dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).