Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Paul Koning <paulkoning@comcast.net>
To: gdb-patches@sourceware.org, Phil Muldoon <pmuldoon@redhat.com>,
	Li Yu <raise.sail@gmail.com>
Subject: Re: [PATCH v4] gdb/python: add missing handling for anonymous members of struct and union
Date: Tue, 18 Oct 2011 19:31:00 -0000	[thread overview]
Message-ID: <5BD625B1-6FBB-4640-801F-62C73D4F15EF@comcast.net> (raw)
In-Reply-To: <09787EF419216C41A903FD14EE5506DD030CB90864@AUSX7MCPC103.AMER.DELL.COM>


On Oct 18, 2011, at 10:21 AM, <Paul_Koning@Dell.com> wrote:

> 
> 
> -----Original Message-----
> From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-owner@sourceware.org] On Behalf Of Phil Muldoon
> Sent: Tuesday, October 18, 2011 9:58 AM
> To: Li Yu
> Cc: gdb-patches@sourceware.org; Paul Koning; Tom Tromey
> Subject: Re: [PATCH v4] gdb/python: add missing handling for anonymous members of struct and union
> 
> Li Yu <raise.sail@gmail.com> writes:
> 
>> gdb.Type.fields() missed handling for anonymous members.
>> 
>> This patch fix it, below are details:
> 
> Sorry I missed this patch.  I have some questions.
> 
> Given this functionality, do you have any use-cases in mind for it? Do we really want to include anonymous members in field () output? I ask because I cannot decide if the additional anonymous field information constitutes an API break.  If so we may have to reconstitute this functionality from fields() so that it takes a keyword to turn this behavior on and off.

I raised a related question two weeks ago: http://sourceware.org/ml/gdb-patches/2011-10/msg00118.html .

It would seem logical for things to be consistent.  That's quite a lot more work than this one patch, but it can certainly be handled as a collection of independent changes.  

Another possible approach is to leave gdb.Type.fields() alone, but supply a little bit of Python code for the gdb python library that implements a recursive iterator.  It's quite easy to do that:

def deepitems (t):
    for k, v in t.iteritems ():
        if k:
            yield k, v
        else:
            for i in deepitems (v.type):
                yield i



	paul


  parent reply	other threads:[~2011-10-18 19:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-08  5:35 Li Yu
2011-10-18  1:48 ` Li Yu
2011-10-18  2:46 ` Yao Qi
2011-10-18 14:03 ` Phil Muldoon
     [not found]   ` <09787EF419216C41A903FD14EE5506DD030CB90864@AUSX7MCPC103.AMER.DELL.COM>
2011-10-18 19:31     ` Paul Koning [this message]
2011-10-19  8:28   ` Li Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5BD625B1-6FBB-4640-801F-62C73D4F15EF@comcast.net \
    --to=paulkoning@comcast.net \
    --cc=gdb-patches@sourceware.org \
    --cc=pmuldoon@redhat.com \
    --cc=raise.sail@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox