From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8499 invoked by alias); 25 Sep 2008 11:47:42 -0000 Received: (qmail 8490 invoked by uid 22791); 25 Sep 2008 11:47:42 -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; Thu, 25 Sep 2008 11:47:03 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id D2A2D10CF0 for ; Thu, 25 Sep 2008 11:47:00 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id B2A8D104BB for ; Thu, 25 Sep 2008 11:47:00 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1KipJD-00082a-Hz for gdb-patches@sourceware.org; Thu, 25 Sep 2008 07:46:59 -0400 Date: Thu, 25 Sep 2008 11:47:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sourceware.org Subject: Re: [rfc] expose gdb values to python Message-ID: <20080925114659.GA30878@caradoc.them.org> Mail-Followup-To: gdb-patches@sourceware.org References: <1221199426.24580.26.camel@localhost.localdomain> <20080921042657.GB29631@caradoc.them.org> 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-09/txt/msg00500.txt.bz2 On Thu, Sep 25, 2008 at 01:32:57AM -0300, Thiago Jung Bauermann wrote: > My reasoning was that if a value comes from a C context (for example), > at least at first I'd expect it to always be printed in C syntax. But > I see your point. And I have no preference, really. > > So leaving current_language in valpy_str is acceptable? Then one FIXME > can be just dropped. IMO, yes - or else we can pass it the language somehow, later. > Is it useful to provide a casting mechanism, to enable for instance access > to elements from a specific type in the inheritance hierarchy? I think so. This reminds me of another reason why length is a peculiar concept here: GDB should (though I think does not, at present) support "v->D::x" and "v->C::x". So v['C::x'] would make sense, but you can't iterate over things like that. So maybe length should be the number of direct fields? Or the number of fields + base classes? Either way, I suggest it match what iterators do if you support iteration. > But I'd leave type casting to the (still to be written) patch exposing the > type system to python. Sure. -- Daniel Jacobowitz CodeSourcery