From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15192 invoked by alias); 23 Apr 2008 17:48:15 -0000 Received: (qmail 15181 invoked by uid 22791); 23 Apr 2008 17:48:15 -0000 X-Spam-Check-By: sourceware.org Received: from mtaout6.012.net.il (HELO mtaout6.012.net.il) (84.95.2.16) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 23 Apr 2008 17:47:51 +0000 Received: from HOME-C4E4A596F7 ([83.130.1.82]) by i-mtaout6.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0JZS004D0I1BGSO1@i-mtaout6.012.net.il> for gdb-patches@sourceware.org; Wed, 23 Apr 2008 21:00:48 +0300 (IDT) Date: Wed, 23 Apr 2008 18:00:00 -0000 From: Eli Zaretskii Subject: Re: [RFA] Document fixed/floating variable objects and thread-id. In-reply-to: X-012-Sender: halo1@inter.net.il To: Vladimir Prus Cc: gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: References: <200804041320.00361.vladimir@codesourcery.com> <200804092147.37085.ghost@cs.msu.su> <200804100105.31748.ghost@cs.msu.su> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-04/txt/msg00524.txt.bz2 > From: Vladimir Prus > Date: Wed, 23 Apr 2008 14:26:14 +0400 > > > void foo (int i) > > { > > ... > > } > > > > void bar (int i) > > { > > ... > > } > > > > > > If you create a fixed varobj in 'bar', then each time you updating, new value of > > bar's i will be read. If you create a floating varobj in 'bar', then if you update > > it while still in bar, new value of bar's i will be read. If you update it in foo, > > then the value of foo's i will be used. > > > > So while for fixed varobj's update fetches new value of 'i', for floating varobjs > > we also decide which 'i' to use each time. > > Eli, > does the above make the code behaviour clear enough for you to suggest better doc > working, or you want something else clarified? Sorry, I somehow was certain I replied to you back then, but I see now that I didn't. More to the point, I cannot say that I have a clear understanding of the issue. In what other situations will fixed and floating varobjs behave differently? Are we talking about any situation where identically named variables have different binding to memory addresses, depending on scope and context? Like, for example, identically named members of different C++ classes? Or are we talking about something else? Also, why does such behavior make sense? That is, why would I want an object whose value depends on semi-random factors? E.g., if the inferior stopped at a watchpoint, the context is unpredictable, and then so is the value of a floating varobj, if I understand you correctly. How is this helpful?