This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: can pahole print a struct definition in a given CU?
- From: Tom Tromey <tromey at redhat dot com>
- To: Tristan Su <sooqing at gmail dot com>
- Cc: gdb at sourceware dot org
- Date: Wed, 02 Jan 2013 10:31:57 -0700
- Subject: Re: can pahole print a struct definition in a given CU?
- References: <CA+sbV4jqL=6=MV891x8tL0SvFAJno5x7PxRxTULtmsb0tVkZPA@mail.gmail.com>
>>>>> "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