From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11862 invoked by alias); 4 Oct 2011 20:24:10 -0000 Received: (qmail 11854 invoked by uid 22791); 4 Oct 2011 20:24:09 -0000 X-SWARE-Spam-Status: No, hits=-7.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,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; Tue, 04 Oct 2011 20:23:56 +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.14.4/8.14.4) with ESMTP id p94KNrZS005362 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 4 Oct 2011 16:23:53 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p94KNqVg009974; Tue, 4 Oct 2011 16:23:53 -0400 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p94KNpUt027934; Tue, 4 Oct 2011 16:23:51 -0400 From: Tom Tromey To: Paul Koning Cc: Li Yu , gdb-patches@sourceware.org Subject: Re: [PATCH v2] gdb/python: add missing handling for anonymous members of struct and union References: <4E8595F6.7080004@gmail.com> Date: Tue, 04 Oct 2011 20:24:00 -0000 In-Reply-To: (Paul Koning's message of "Tue, 4 Oct 2011 14:04:55 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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: 2011-10/txt/msg00117.txt.bz2 >>>>> "Paul" == Paul Koning writes: Tom> I don't understand why the iterator iterates into sub-objects. Why not Tom> just have a flat iterator? That is, return a field with no name whose Tom> type is some structure, and then let the caller iterate over that type Tom> if need be. Paul> That's the current behavior. Yu showed an example where he wanted Paul> to get all the field names so he could then use those to retrieve Paul> the fields in a gdb.Value object. Ok, I see. Thanks. Paul> (Value objects don't currently have iterators; I'll propose a Paul> patch for that shortly.) Thanks, after reading your other patch I was meaning to see if this was needed :) Paul> You can certainly do this in Python, for example: Why don't we do that, then, in some code in the gdb python library? Paul> (This could be done more elegantly if gdb.Type could be subclassed.) It seems reasonable to me. Tom