From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6572 invoked by alias); 4 May 2006 15:12:37 -0000 Received: (qmail 6560 invoked by uid 22791); 4 May 2006 15:12:35 -0000 X-Spam-Check-By: sourceware.org Received: from zigzag.lvk.cs.msu.su (HELO zigzag.lvk.cs.msu.su) (158.250.17.23) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 04 May 2006 15:12:30 +0000 Received: from Debian-exim by zigzag.lvk.cs.msu.su with spam-scanned (Exim 4.50) id 1FbfV8-0001UR-KA for gdb@sources.redhat.com; Thu, 04 May 2006 19:12:28 +0400 Received: from zigzag.lvk.cs.msu.su ([158.250.17.23]) by zigzag.lvk.cs.msu.su with esmtp (Exim 4.50) id 1FbfUe-0001M0-5b; Thu, 04 May 2006 19:11:52 +0400 From: Vladimir Prus To: Daniel Jacobowitz Subject: Re: -var-update and address changes Date: Thu, 04 May 2006 15:12:00 -0000 User-Agent: KMail/1.7.2 Cc: Jim Ingham , Nick Roberts , gdb@sources.redhat.com References: <200605031002.21910.ghost@cs.msu.su> <20060504145046.GA32605@nevyn.them.org> In-Reply-To: <20060504145046.GA32605@nevyn.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200605041911.48045.ghost@cs.msu.su> Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-05/txt/msg00026.txt.bz2 On Thursday 04 May 2006 18:50, Daniel Jacobowitz wrote: > On Wed, May 03, 2006 at 10:02:21AM +0400, Vladimir Prus wrote: > > On Tuesday 02 May 2006 21:22, Jim Ingham wrote: > > > Shouldn't the call to var->root->lang->value_of_root down at the > > > bottom of value_of_root take care of fetching the new value? > > > > Well, it fetches the new value, I believe. > > For the wrong frame. > > I've only lightly tested this; could you give it a try? If it works, I > think we should really get the "@" syntax added to the manual and > testsuite. This appears to work for a simple case of variable 'i' defined both in 'main' and in 'foo' called from main. For the case where I'm stepping into 'bar' that has no 'i', -var-update correctly says that 'i' has gone out of scope. However, after -exec-finish, -var-update does not say that 'i' is not back in scope -- which would be nice if "@-varobjs" are to be used for watches. Here's example I've used for testing: include int foo() { int i = 15; printf("foo\n"); } int bar() { } int main() { int i = 5; printf("hi 1\n"); foo(); bar(); } and example session: b 19 &"b 19\n" ~"Breakpoint 1 at 0x804849e: file s.cpp, line 19.\n" ^done (gdb) r &"r\n" ~"Starting program: /space/p2/ghost/build/mi-tests/a.out \n" hi 1 foo ~"\n" ~"Breakpoint 1, main () at s.cpp:19\n" ~"19\t bar();\n" ^done (gdb) -var-create I @ i ^done,name="I",numchild="0",type="int" (gdb) -exec-step ^running (gdb) *stopped,reason="end-stepping-range",thread-id="0",frame={addr="0x08048473",func="bar",args=[],file="s.cpp",fullname="/space/p2/ghost/build/mi-tests/s.cpp",line="12"} (gdb) -var-update * ^done,changelist=[{name="I",in_scope="false"}] (gdb) -exec-finish ^running (gdb) *stopped,reason="function-finished",thread-id="0",frame={addr="0x080484a3",func="main",args=[],file="s.cpp",fullname="/space/p2/ghost/build/mi-tests/s.cpp",line="20"},gdb-result-var="$1",return-value="4" (gdb) -var-update * ^done,changelist=[] (gdb) p i &"p i\n" ~"$2 = 5" ~"\n" ^done (gdb) - Volodya