This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC - Python Scripting] New method Objfile.symtabs () - docs included
Tom> How about just the plain Objfile.iterator(REGEX)?
Tom> It would return an iterator that lazily instantiates symtabs.
Tom> (Or, at least conceptually lazily instantiates them, as it isn't clear
Tom> that this is efficiently implementable with the current
Tom> quick_symbol_functions API.)
Is this equivalent to what Paul Koning suggests and has the same
problem which Doug Evans points out (source file matching with a REGEX
aside)?
Paul> How about having symtabs() return the iterator instead?
Doug> In a nutshell: If "list (objfile.symtabs())" can increase gdb's memory
Doug> usage by gigabytes, then it's a non-starter (IMO).
Doug> Before we provide anything along these lines, we need to fix the
Doug> underlying problem.
Doug> I can think of a simple(quick) solution: create the symtab object when
Doug> the psymtab object is created (suitably modified to clean up anything
Doug> obvious), but not expand it. ?[btw, Psymtabs at the moment aren't as
Doug> much of an implementation detail as we want them to be (IMO).] It's
Doug> not perfect: Depending on what you want from the symtab you may
Doug> ultimately end up expanding everything anyway. ?But it's a step. ?One
Doug> way to go would be to build into gdb the ability to discard the
Doug> expansion say when memory gets tight. ?I think there's room for
Doug> improvement before we get to that though.
I am OK to think through this proposal. I will need some time to
understand and come up with something.
Thanks,
Siva Chandra