From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26773 invoked by alias); 23 Jan 2004 19:02:20 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 26652 invoked from network); 23 Jan 2004 19:02:18 -0000 Received: from unknown (HELO mail-out4.apple.com) (17.254.13.23) by sources.redhat.com with SMTP; 23 Jan 2004 19:02:18 -0000 Received: from mailgate1.apple.com (a17-128-100-225.apple.com [17.128.100.225]) by mail-out4.apple.com (8.12.10/8.12.9) with ESMTP id i0NJ2Hcb010435 for ; Fri, 23 Jan 2004 11:02:17 -0800 (PST) Received: from relay3.apple.com (relay3.apple.com) by mailgate1.apple.com (Content Technologies SMTPRS 4.3.6) with ESMTP id for ; Fri, 23 Jan 2004 11:02:18 -0800 Received: from [17.201.22.245] (inghji6.apple.com [17.201.22.245]) by relay3.apple.com (8.12.10/8.12.9) with ESMTP id i0NJ22N7006393 for ; Fri, 23 Jan 2004 19:02:02 GMT Mime-Version: 1.0 (Apple Message framework v609) In-Reply-To: <1074880622.7069.ezmlm@sources.redhat.com> References: <1074880622.7069.ezmlm@sources.redhat.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <3A0DE620-4DD7-11D8-9898-000A958F4C44@apple.com> Content-Transfer-Encoding: 7bit From: Jim Ingham Subject: Re: {commit: gdb/mi] -stack-list-locals and -var-list-children Date: Fri, 23 Jan 2004 19:02:00 -0000 To: gdb-patches@sources.redhat.com X-SW-Source: 2004-01/txt/msg00630.txt.bz2 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