From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20677 invoked by alias); 19 Oct 2011 20:58:41 -0000 Received: (qmail 20666 invoked by uid 22791); 19 Oct 2011 20:58:40 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from qmta04.westchester.pa.mail.comcast.net (HELO qmta04.westchester.pa.mail.comcast.net) (76.96.62.40) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 19 Oct 2011 20:58:25 +0000 Received: from omta24.westchester.pa.mail.comcast.net ([76.96.62.76]) by qmta04.westchester.pa.mail.comcast.net with comcast id mk3e1h0061ei1Bg54kyRGo; Wed, 19 Oct 2011 20:58:25 +0000 Received: from [10.127.238.91] ([65.206.2.68]) by omta24.westchester.pa.mail.comcast.net with comcast id mkyD1h00T1U2a2h3kkyFWh; Wed, 19 Oct 2011 20:58:23 +0000 Subject: Re: [PATCH v2] gdb/python: add missing handling for anonymous members of struct and union Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Paul Koning In-Reply-To: Date: Wed, 19 Oct 2011 20:59:00 -0000 Cc: Li Yu , gdb-patches@sourceware.org Content-Transfer-Encoding: quoted-printable Message-Id: <2460DAAE-C437-469A-BA1A-47343C5DBB45@comcast.net> References: <4E8595F6.7080004@gmail.com> To: Tom Tromey 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/msg00545.txt.bz2 On Oct 19, 2011, at 4:49 PM, Tom Tromey wrote: >>>>>> "Paul" =3D=3D Paul Koning writes: >=20 > Paul> So we have: > Paul> 1. Type field lookup: flat > Paul> 2. Type iteration: flat > Paul> 3. Value field lookup: recursive > Paul> 4. [Value iteration: flat] (not submitted yet) >=20 > Paul> And Yu's proposed change makes #2 recursive (but does not change #1= ). >=20 > Paul> I think minimally things need to be pairwise the same (1 and 2, 3 a= nd > Paul> 4). It seems most logical for all four to be the same. My prefere= nce > Paul> would be all four recursive, but flat/flat, recursive/recursive is a > Paul> reasonable fallback especially if we add sample code for recursive > Paul> walk of gdb.Type to the gdb Python library. >=20 > I think making them all 'flat' is probably best. >=20 > My reason is that with the proposed patch, I don't think there is a way > to inspect a Type to discover that it has an anonymous field. But, this > seems like a reasonable thing to want to do. That is, I think accurate > introspection is more valuable than notational convenience. So I think that amounts to rejecting Yu's patch. Also, given my point 3, does that mean we should change val["foo"] so it do= esn't recurse down into anonymous fields as it does today? That would be a= change in behavior for an existing feature. > I would be in favor of helper functions in gdb.types, though. What did you have in mind? paul