[RFC - Python Scripting] New method Objfile.symtabs () - docs included

Tom Tromey tromey@redhat.com
Thu Apr 5 18:41:00 GMT 2012


>>>>> "Paul" ==   <Paul_Koning@Dell.com> writes:

Paul> Those presumably live in a symtab but I didn't
Paul> see a gdb.Symtab method to get them.  (Is that the right approach?  I
Paul> can work on creating the machinery if this is the place for them, or
Paul> if someone can point me to where in the gdb.* class hierarchy to fit
Paul> this.)

Yes, I think adding the ability to iterate over symbols in a symtab is
the way to go.

Actually, what Siva said sounds good, aside from the lazy CU
instantiation issue:

Siva> The exploration of symbols to look for functions can happen in
Siva> this order: gdb.objfiles () => Objfile.symtabs () => Symtab.blocks
Siva> () => Block.symbol => Symbol.name.

Of course for your use, you won't care about lazy instantiation so much,
since you will be expanding them all anyway.

An extension to the earlier idea would be to make it possible to have
the iterator take a symbol name to search for as well.  This would let
you instantiate many fewer CUs.  This is more or less how the "quick"
symbol API works.

Tom



More information about the Gdb-patches mailing list