This is the mail archive of the gdb-patches@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: [RFC - Python Scripting] New method Objfile.symtabs () - docs included


>>>>> "Siva" == Siva Chandra <sivachandra@google.com> writes:

Siva> For the memory problem you point out, do you think something like
Siva> Objfile.symtabs (regex, [symbol_type]) would be good?  REGEX is a file
Siva> name matcher to specify that only those symtabs whose source file
Siva> names match the REGEX should be loaded, and SYMBOL_TYPE is to specify
Siva> that only symbols of this kind should be loaded.  This can still be
Siva> abused to match everything and load everything, but it is at the
Siva> user's own peril.

I think this proposed API mixes symtab- and symbol-level operations.
The file name is a property of a symtab, but the symbol type is a
property of the symbol.

There's presently no way in gdb to load just part of a symtab.
CUs are always fully instantiated.  This could be changed -- I think it
is a good idea with more than one concrete benefit -- but it doesn't
exist now.

How about just the plain Objfile.iterator(REGEX)?
It would return an iterator that lazily instantiates symtabs.
(Or, at least conceptually lazily instantiates them, as it isn't clear
that this is efficiently implementable with the current
quick_symbol_functions API.)

Tom


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