From: Jim Ingham <jingham@apple.com>
To: gdb-patches@sources.redhat.com
Subject: Re: {commit: gdb/mi] -stack-list-locals and -var-list-children
Date: Fri, 23 Jan 2004 19:02:00 -0000 [thread overview]
Message-ID: <3A0DE620-4DD7-11D8-9898-000A958F4C44@apple.com> (raw)
In-Reply-To: <1074880622.7069.ezmlm@sources.redhat.com>
Daniel,
>
> 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_declaration
> s.character",exp="character",numchild="0",type="char"},child={name="str
> uct_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",n
> umchild="1",type="int
> **"},child={name="struct_declarations.long_array",exp="long_array",numc
> hild="10",type="long int
> [10]"},child={name="struct_declarations.func_ptr",exp="func_ptr",numchi
> ld="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_arr
> ay.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_arr
> ay.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.
>
>
This is intended behavior. After continuing the target, you need to
explicitly call -var-update then -var-evaluate-expression (or
var-list-children) before you get new values. That way, if you want to
you can use varobj's to store historic values - like the $ variables in
gdb - or use them to represent the variables, depending on whether you
update them or not. This is the way it is described in the manual.
Jim
--
Jim Ingham jingham@apple.com
Developer Tools
Apple Computer
next parent reply other threads:[~2004-01-23 19:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1074880622.7069.ezmlm@sources.redhat.com>
2004-01-23 19:02 ` Jim Ingham [this message]
2004-01-20 1:27 Nick Roberts
2004-01-20 5:49 ` Daniel Jacobowitz
2004-01-23 17:05 ` Daniel Jacobowitz
2004-01-23 21:27 ` Nick Roberts
2004-01-23 22:46 ` Daniel Jacobowitz
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=3A0DE620-4DD7-11D8-9898-000A958F4C44@apple.com \
--to=jingham@apple.com \
--cc=gdb-patches@sources.redhat.com \
/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