From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 307 invoked by alias); 4 Oct 2008 22:21:37 -0000 Received: (qmail 32768 invoked by uid 22791); 4 Oct 2008 22:21:37 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 04 Oct 2008 22:20:57 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id EE6DE10D22; Sat, 4 Oct 2008 22:20:55 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id A9FA310CF4; Sat, 4 Oct 2008 22:20:55 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1KmFUd-0001xx-6N; Sat, 04 Oct 2008 18:20:55 -0400 Date: Sat, 04 Oct 2008 22:21:00 -0000 From: Daniel Jacobowitz To: Tom Tromey Cc: Joel Brobecker , Thiago Jung Bauermann , gdb-patches ml Subject: Re: [rfc] expose gdb values to python Message-ID: <20081004222055.GA7541@caradoc.them.org> Mail-Followup-To: Tom Tromey , Joel Brobecker , Thiago Jung Bauermann , gdb-patches ml References: <1221199426.24580.26.camel@localhost.localdomain> <20081001054741.GE3665@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2008-05-11) 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-10/txt/msg00118.txt.bz2 On Wed, Oct 01, 2008 at 09:09:36AM -0600, Tom Tromey wrote: > Joel> Better yet, I would love for the object to have one attribute > Joel> for each component that I could simply access using X.baz. > Joel> But I suspect that there is no way we can implement that without > Joel> having to compute the value of each component, which would be > Joel> quite wastful the vast majority of the time. Sigh, is it not > Joel> possible to lazy-initialize attributes? > > I think we can do this, but there is a cost, namely conflicts between > methods on Value and field names in the inferior will have to be > resolved in favor of the method. So, robust programs will always have > to use the [] syntax anyway. WDYT about making this work anyway - and using a documented namespace for any methods we add? Then the common case will be able to use the attributes safely. -- Daniel Jacobowitz CodeSourcery