From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31313 invoked by alias); 23 Mar 2009 17:45:43 -0000 Received: (qmail 31291 invoked by uid 22791); 23 Mar 2009 17:45:42 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 23 Mar 2009 17:45:37 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n2NHjUuL008794; Mon, 23 Mar 2009 13:45:30 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n2NHjPNe004572; Mon, 23 Mar 2009 13:45:25 -0400 Received: from opsy.redhat.com (vpn-12-142.rdu.redhat.com [10.11.12.142]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n2NHjTt3014990; Mon, 23 Mar 2009 13:45:29 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id AE8ED3782B4; Mon, 23 Mar 2009 11:45:27 -0600 (MDT) To: Thiago Jung Bauermann Cc: Alexandre Oliva , gdb-patches@sourceware.org Subject: Re: [RFC][Python] Re: any expression to tell whether a variable was optimized out? References: <20090310125945.GA4376@caradoc.them.org> <1236700079.11106.1.camel@localhost.localdomain> <1236710732.11106.30.camel@localhost.localdomain> <1237771863.25721.17.camel@localhost.localdomain> From: Tom Tromey Reply-To: Tom Tromey Date: Mon, 23 Mar 2009 17:47:00 -0000 In-Reply-To: <1237771863.25721.17.camel@localhost.localdomain> (Thiago Jung Bauermann's message of "Sun\, 22 Mar 2009 22\:31\:02 -0300") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2009-03/txt/msg00500.txt.bz2 >>>>> "Thiago" == Thiago Jung Bauermann writes: Tom> I'm a little surprised that this is an attribute of values at all. Tom> Doesn't that seem weird? Is there anything useful that can be done Tom> with a value like this? Perhaps just fetching its type? Thiago> I guess Alexandre just found a use for the attribute. :-) :) Funnily enough, a couple of PRs related to this came in over the weekend. And, those make it clear that we actually do want this as an attribute of the value -- a future GCC may generate a value where some components are defined and some are not. In this case we would want to track the undefined bits and let value operations apply to defined ones but not undefined ones. I think. Thiago> This patch implements the attribute in gdb.Value, what do you think? The code bits are ok. Thiago> By the way, when writing this patch I realised that probably the Thiago> "address" method in Value would better be turned into an attribute. Do it :) Thiago> Also, in the python branch, the "type" method also could be converted to Thiago> an attribute. The type method is still funny because, due to memory management oddities, we always allocate a fresh Type. This has already bit a user, though, and we ought to figure out how to fix it. Tom