Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Tristan Su <sooqing@gmail.com>
Cc: gdb@sourceware.org
Subject: Re: can pahole print a struct definition in a given CU?
Date: Wed, 02 Jan 2013 17:32:00 -0000	[thread overview]
Message-ID: <87fw2j5w4y.fsf@fleche.redhat.com> (raw)
In-Reply-To: <CA+sbV4jqL=6=MV891x8tL0SvFAJno5x7PxRxTULtmsb0tVkZPA@mail.gmail.com>	(Tristan Su's message of "Mon, 24 Dec 2012 22:15:41 +0800")

>>>>> "Tristan" == Tristan Su <sooqing@gmail.com> writes:

Tristan> I found pahole (python api) quite useful but jusst could not have it
Tristan> print a struct in a given compilation unit.
Tristan> With the ptype command:
Tristan> (gdb) ptype S
Tristan> but we can also specify the CU because the struct may have different
Tristan> define in different CUs.
Tristan> (gdb) ptype 'foo.c'::S

Tristan> Is that possible/easy to make pahole support this?

I couldn't think of an easy way.  Though maybe that is just imagination
failure on my part :)

If I were doing this I would start by finding a way to expose
evaluate_type to Python, say via a flag to parse_and_eval.
Then I would make pahole use this.

Tom


  reply	other threads:[~2013-01-02 17:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-24 14:15 Tristan Su
2013-01-02 17:32 ` Tom Tromey [this message]
2013-01-02 18:56   ` Doug Evans
2013-01-02 19:05     ` Tom Tromey
2013-01-02 19:06     ` Doug Evans

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=87fw2j5w4y.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb@sourceware.org \
    --cc=sooqing@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