From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27595 invoked by alias); 20 Nov 2008 14:00:37 -0000 Received: (qmail 27493 invoked by uid 22791); 20 Nov 2008 14:00:36 -0000 X-Spam-Check-By: sourceware.org Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 20 Nov 2008 13:59:41 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1L3A4H-0002cW-Kq for gdb@sources.redhat.com; Thu, 20 Nov 2008 13:59:38 +0000 Received: from 78.158.192.230 ([78.158.192.230]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 20 Nov 2008 13:59:37 +0000 Received: from vladimir by 78.158.192.230 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 20 Nov 2008 13:59:37 +0000 To: gdb@sources.redhat.com From: Vladimir Prus Subject: Re: Variables created with -var-create going out of scope unexpectedly? Date: Thu, 20 Nov 2008 14:00:00 -0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit User-Agent: KNode/0.10.9 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-11/txt/msg00126.txt.bz2 Srinath Avadhanula wrote: > Hi, > > I am trying to play around with GDB/MI recently, in particular with > the -var-create command. I see that a variable created with > -var-create goes out of scope too quickly. In particular, if I later > do -var-update, I see that in_scope="false"... The following is the > test program and the GDB session which illustrates my question. > > Basically, I put a breakpoint in the function foo below. This function > gets called 4 times with 2 different stacks. If I use "display a" the > first time I hit the breakpoint, the variable a gets displayed on all > subsequent hits. However, if I do instead "-var-create - * a" the > first time the breakpoint is hit and then do "-var-update 1 *" each > subsequent time the break-point is hit, I only see 'in_scope="true"' > the two times when foo() is reached with exactly the same stack. Is > this expected? Is there an equivalent of gdb's "display" command for > GDB/MI? GDB/MI documentation in CVS HEAD describes this. - Volodya