This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: can pahole print a struct definition in a given CU?


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]