From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9599 invoked by alias); 11 Mar 2010 17:15:37 -0000 Received: (qmail 9591 invoked by uid 22791); 11 Mar 2010 17:15:37 -0000 X-SWARE-Spam-Status: No, hits=-7.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 11 Mar 2010 17:15:33 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2BHFOjd015523 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 11 Mar 2010 12:15:25 -0500 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o2BHFMJT025575; Thu, 11 Mar 2010 12:15:23 -0500 Message-ID: <4B99252A.1070103@redhat.com> Date: Thu, 11 Mar 2010 17:15:00 -0000 From: Phil Muldoon User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.8) Gecko/20100301 Fedora/3.0.3-1.fc12 Lightning/1.0b2pre Thunderbird/3.0.3 MIME-Version: 1.0 To: Tom Tromey CC: Chris Johns , gdb@sourceware.org Subject: Re: Reading a static variable in Python References: <4B971421.8080006@contemporary.net.au> <4B984C19.80407@contemporary.net.au> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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: 2010-03/txt/msg00073.txt.bz2 On 03/11/2010 04:53 PM, Tom Tromey wrote: >>>>>> "Chris" == Chris Johns writes: > > Tom> Use gdb.parse_and_eval. > > Chris> Nice. This is an excellent solution. I suppose being an expression it > Chris> can do the pointer maths as well. I was looking at ways to construct a > Chris> gdb.Value with a gdb.Symbol as an argument. > > Yes, strangely there doesn't seem to be a way to do that. > If you want this, feel free to file a bug report for it... Frame's read_var function creates a gdb.Value from a given gdb.Symbol, but obviously one needs the frame and the symbol for that. There was a stub in the gdb.Symbol code to do this without a frame, but it was very limited so I removed it. Frame's function read_var uses read_var_value which needs a frame (well, for some reads - symbol_read_needs_frame returns a mixed bag of results). Not sure if it is possible to construct a value from a symbol without the frame in all cases? Cheers, Phil