can pahole print a struct definition in a given CU?

Tristan Su sooqing@gmail.com
Mon Dec 24 14:15:00 GMT 2012


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



More information about the Gdb mailing list