This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug mi/14607] New: -var-list-children reports wrong numchild count


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]