This is the mail archive of the gdb-patches@sources.redhat.com 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]

Re: {commit: gdb/mi] -stack-list-locals and -var-list-children


On Tue, Jan 20, 2004 at 12:49:32AM -0500, Daniel Jacobowitz wrote:
> On Tue, Jan 20, 2004 at 01:18:52AM +0000, Nick Roberts wrote:
> > 
> > I've comitted the patches below. Testcases don't work for me but I've kept the
> > status quo so they should work for others. Diff's have been made with Emacs
> > backup files - sorry, should have made the patches before committing, done
> > off-line - 64k modem, family to feed etc. I hope they work... Well they
> > compile anyway.
> 
> No, you've added a failing testcase:
> 
> -var-list-children --all-values struct_declarations.long_array
> ^done,numchild="10",children=[child={name="struct_declarations.long_array.0",exp="0",numchild="0",value=
> "1234",type="long
> int"},child={name="struct_declarations.long_array.1",exp="1",numchild="0",value="2345"
> ,type="long
> int"},child={name="struct_declarations.long_array.2",exp="2",numchild="0",value="3456",type=
> "long
> int"},child={name="struct_declarations.long_array.3",exp="3",numchild="0",value="28281",type="long
>  int"},child={name="struct_declarations.long_array.4",exp="4",numchild="0",value="0",type="long
> int"},ch
> ild={name="struct_declarations.long_array.5",exp="5",numchild="0",value="0",type="long
> int"},child={name
> ="struct_declarations.long_array.6",exp="6",numchild="0",value="0",type="long
> int"},child={name="struct_
> declarations.long_array.7",exp="7",numchild="0",value="0",type="long
> int"},child={name="struct_declarati
> ons.long_array.8",exp="8",numchild="0",value="0",type="long
> int"},child={name="struct_declarations.long_
> array.9",exp="9",numchild="0",value="0",type="long int"}]
> (gdb) 
> FAIL: gdb.mi/mi-var-child.exp: listing of names and values of children
> 
> I'll look at the problem in the morning.

I believe that this is a problem in the patch, not in the testcase.  If
I step to the same PC in a non-MI GDB, the values are correct, but
above only the first few are initialized.

If I execute this silly little command sequence:

b do_children_tests
b 208
run
-var-create struct_declarations * struct_declarations
-var-list-children struct_declarations
-var-list-children --all-values struct_declarations.long_array
continue
-var-list-children --all-values struct_declarations.long_array
print struct_declarations.long_array


I get this output:
~"GNU gdb 2004-01-23-cvs\n"
~"Copyright 2004 Free Software Foundation, Inc.\n"
~"GDB is free software, covered by the GNU General Public License, and you are\n"
~"welcome to change it and/or distribute copies of it under certain conditions.\n"
~"Type \"show copying\" to see the conditions.\n"
~"There is absolutely no warranty for GDB.  Type \"show warranty\" for details.\n"
~"This GDB was configured as \"i686-pc-linux-gnu\"..."
~"Using host libthread_db library \"/lib/tls/i686/cmov/libthread_db.so.1\".\n"
~"\n"
(gdb) 
&"b do_children_tests\n"
^done
(gdb) 
&"b 208\n"
^done
(gdb) 
&"run\n"
^done,reason="breakpoint-hit",bkptno="1",thread-id="0",frame={addr="0x080484d0",func="do_children_tests",args=[],file="/opt/src/gdb/src/gdb/testsuite/gdb.mi/var-cmd.c",line="190"}
(gdb) 
^done,name="struct_declarations",numchild="11",type="struct _struct_decl"
(gdb) 
^done,numchild="11",children=[child={name="struct_declarations.integer",exp="integer",numchild="0",type="int"},child={name="struct_declarations.character",exp="character",numchild="0",type="char"},child={name="struct_declarations.char_ptr",exp="char_ptr",numchild="1",type="char *"},child={name="struct_declarations.long_int",exp="long_int",numchild="0",type="long int"},child={name="struct_declarations.int_ptr_ptr",exp="int_ptr_ptr",numchild="1",type="int **"},child={name="struct_declarations.long_array",exp="long_array",numchild="10",type="long int [10]"},child={name="struct_declarations.func_ptr",exp="func_ptr",numchild="0",type="void (*)(void)"},child={name="struct_declarations.func_ptr_struct",exp="func_ptr_struct",numchild="0",type="struct _struct_decl (*)(int, char *, long int)"},child={name="struct_declarations.func_ptr_ptr",exp="func_ptr_ptr",numchild="0",type="struct _struct_decl *(*)(int, char *, long int)"},child={name="struct_declarations.u1",exp="u1",numchild="4",type="union {...}"},child={name="struct_declarations.s2",exp="s2",numchild="4",type="struct {...}"}]
(gdb) 
^done,numchild="10",children=[child={name="struct_declarations.long_array.0",exp="0",numchild="0",value="0",type="long int"},child={name="struct_declarations.long_array.1",exp="1",numchild="0",value="0",type="long int"},child={name="struct_declarations.long_array.2",exp="2",numchild="0",value="1986358784",type="long int"},child={name="struct_declarations.long_array.3",exp="3",numchild="0",value="28281",type="long int"},child={name="struct_declarations.long_array.4",exp="4",numchild="0",value="0",type="long int"},child={name="struct_declarations.long_array.5",exp="5",numchild="0",value="0",type="long int"},child={name="struct_declarations.long_array.6",exp="6",numchild="0",value="0",type="long int"},child={name="struct_declarations.long_array.7",exp="7",numchild="0",value="0",type="long int"},child={name="struct_declarations.long_array.8",exp="8",numchild="0",value="0",type="long int"},child={name="struct_declarations.long_array.9",exp="9",numchild="0",value="0",type="long int"}]
(gdb) 
&"continue\n"
^done,reason="breakpoint-hit",bkptno="2",thread-id="0",frame={addr="0x08048573",func="do_children_tests",args=[],file="/opt/src/gdb/src/gdb/testsuite/gdb.mi/var-cmd.c",line="208"}
(gdb) 
^done,numchild="10",children=[child={name="struct_declarations.long_array.0",exp="0",numchild="0",value="0",type="long int"},child={name="struct_declarations.long_array.1",exp="1",numchild="0",value="0",type="long int"},child={name="struct_declarations.long_array.2",exp="2",numchild="0",value="1986358784",type="long int"},child={name="struct_declarations.long_array.3",exp="3",numchild="0",value="28281",type="long int"},child={name="struct_declarations.long_array.4",exp="4",numchild="0",value="0",type="long int"},child={name="struct_declarations.long_array.5",exp="5",numchild="0",value="0",type="long int"},child={name="struct_declarations.long_array.6",exp="6",numchild="0",value="0",type="long int"},child={name="struct_declarations.long_array.7",exp="7",numchild="0",value="0",type="long int"},child={name="struct_declarations.long_array.8",exp="8",numchild="0",value="0",type="long int"},child={name="struct_declarations.long_array.9",exp="9",numchild="0",value="0",type="long int"}]
(gdb) 
&"print struct_declarations.long_array\n"
~"$1 = {"
~"1234, "
~"2345, "
~"3456, "
~"4567, "
~"5678, "
~"6789, "
~"7890, "
~"8901, "
~"9012, "
~"1234}\n"
^done
(gdb) 


Note that the varobj is out of date.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


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