From: Daniel Jacobowitz <drow@mvista.com>
To: Nick Roberts <nick@nick.uklinux.net>, gdb-patches@sources.redhat.com
Subject: Re: {commit: gdb/mi] -stack-list-locals and -var-list-children
Date: Fri, 23 Jan 2004 17:05:00 -0000 [thread overview]
Message-ID: <20040123170509.GA31156@nevyn.them.org> (raw)
In-Reply-To: <20040120054932.GB23548@nevyn.them.org>
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
next prev parent reply other threads:[~2004-01-23 17:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-20 1:27 Nick Roberts
2004-01-20 5:49 ` Daniel Jacobowitz
2004-01-23 17:05 ` Daniel Jacobowitz [this message]
2004-01-23 21:27 ` Nick Roberts
2004-01-23 22:46 ` Daniel Jacobowitz
[not found] <1074880622.7069.ezmlm@sources.redhat.com>
2004-01-23 19:02 ` Jim Ingham
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040123170509.GA31156@nevyn.them.org \
--to=drow@mvista.com \
--cc=gdb-patches@sources.redhat.com \
--cc=nick@nick.uklinux.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox