From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26660 invoked by alias); 10 Mar 2009 16:45:05 -0000 Received: (qmail 26607 invoked by uid 22791); 10 Mar 2009 16:45:03 -0000 X-SWARE-Spam-Status: No, hits=-2.4 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; Tue, 10 Mar 2009 16:44:54 +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 n2AGiksR018948; Tue, 10 Mar 2009 12:44:46 -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 n2AGijwg022314; Tue, 10 Mar 2009 12:44:46 -0400 Received: from freie.oliva.athome.lsd.ic.unicamp.br (sebastian-int.corp.redhat.com [172.16.52.221]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n2AGifWo028468; Tue, 10 Mar 2009 12:44:42 -0400 Received: from localhost.localdomain (frit.oliva.athome.lsd.ic.unicamp.br [172.31.160.7]) by freie.oliva.athome.lsd.ic.unicamp.br (8.14.3/8.14.3) with ESMTP id n2AGieDv009306; Tue, 10 Mar 2009 13:44:40 -0300 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.14.3/8.14.3) with ESMTP id n2AGidwR031921; Tue, 10 Mar 2009 13:44:39 -0300 Received: (from aoliva@localhost) by localhost.localdomain (8.14.3/8.14.3/Submit) id n2AGic6A031920; Tue, 10 Mar 2009 13:44:38 -0300 To: Thiago Jung Bauermann Cc: Daniel Jacobowitz , gdb@sourceware.org Subject: Re: any expression to tell whether a variable was optimized out? References: <20090310125945.GA4376@caradoc.them.org> <1236700079.11106.1.camel@localhost.localdomain> From: Alexandre Oliva Date: Tue, 10 Mar 2009 16:45:00 -0000 In-Reply-To: <1236700079.11106.1.camel@localhost.localdomain> (Thiago Jung Bauermann's message of "Tue\, 10 Mar 2009 12\:47\:58 -0300") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: 2009-03/txt/msg00079.txt.bz2 On Mar 10, 2009, Thiago Jung Bauermann wrote: > El mar, 10-03-2009 a las 08:59 -0400, Daniel Jacobowitz escribi=C3=B3: >> On Tue, Mar 10, 2009 at 06:48:28AM -0300, Alexandre Oliva wrote: >> > Is there really no way to set a gdb variable to something equivalent to >> > the boolean result of valprint.c:value_optimized_out()? Any reason for >> > that, other than that nobody needed it before? >>=20 >> Nope, there's no way to do it. Really, unavailable ought to propogate >> through the expression evaluator, and give errors at some points, I >> expect... > It would be easy enough to add a method to the gdb.Value Python class > exposing this boolean. Would it help you? Maybe. I was hoping for something already widely deployed, but failing that, I guess it's ok to rely on future features ;-) As for whether it would help, I can only assume it would, but I'm not quite up to speed on how to use such Python interfaces. If the feature can be exercised from the GDB textual interactive interface, as part of normal expression evaluation, it will indeed help. Otherwise, I may have to look into it further to tell whether it will help. Thanks, --=20 Alexandre Oliva http://www.lsd.ic.unicamp.br/~oliva/ You must be the change you wish to see in the world. -- Gandhi Be Free! -- http://FSFLA.org/ FSF Latin America board member Free Software Evangelist Red Hat Brazil Compiler Engineer