public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "tromey at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug python/11777] Strange behaviour of gdb.Type.fields
Date: Tue, 06 Jul 2010 19:52:00 -0000	[thread overview]
Message-ID: <20100706195210.17326.qmail@sourceware.org> (raw)
In-Reply-To: <20100701072012.11777.andre.poenitz@nokia.com>


------- Additional Comments From tromey at redhat dot com  2010-07-06 19:52 -------
(In reply to comment #2)

>     -ex 'python print gdb.parse_and_eval("x")["p"].dereference().type.fields()' \

I can make this work by adding a call to strip_typedefs:



(gdb) python print gdb.parse_and_eval ('x')['p'].dereference().type.fields()
[]
(gdb) python print gdb.parse_and_eval
('x')['p'].dereference().type.strip_typedefs().fields()
[<gdb.Field object at 0xb7dbc220>, <gdb.Field object at 0xb7dbc250>, <gdb.Field
object at 0xb7dbc280>, <gdb.Field object at 0xb7dbc2b0>]


Arguably the Python API should be doing this for you.
It seems useless to get the fields of a stub type.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=11777

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


  parent reply	other threads:[~2010-07-06 19:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-01  7:20 [Bug python/11777] New: " andre dot poenitz at nokia dot com
2010-07-01  7:35 ` [Bug python/11777] " andre dot poenitz at nokia dot com
2010-07-01  9:13 ` andre dot poenitz at nokia dot com
2010-07-06 19:52 ` tromey at redhat dot com [this message]
2010-08-20 18:27 ` tromey at redhat dot com

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=20100706195210.17326.qmail@sourceware.org \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).