This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
can pahole print a struct definition in a given CU?
- From: Tristan Su <sooqing at gmail dot com>
- To: gdb at sourceware dot org
- Date: Mon, 24 Dec 2012 22:15:41 +0800
- Subject: can pahole print a struct definition in a given CU?
Hi,
I found pahole (python api) quite useful but jusst could not have it
print a struct in a given compilation unit.
With the ptype command:
(gdb) ptype S
but we can also specify the CU because the struct may have different
define in different CUs.
(gdb) ptype 'foo.c'::S
but pahale doesn't seem to support this:
(gdb) pahole 'foo.c'::S
Traceback (most recent call last):
File "/usr/share/gdb/python/gdb/command/pahole.py", line 68, in invoke
type = gdb.lookup_type (arg)
RuntimeError: No type named 'foo.c'::S.
Error occurred in Python command: No type named 'foo.c'::S.
Is that possible/easy to make pahole support this?
I'm using gdb 7.2 on x86-64.
Thanks,
Tristan