This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
really really slow lookup_symtabs() - some obversations
- From: Roland Schwingel <Roland dot Schwingel at onevision dot de>
- To: gdb <gdb at sources dot redhat dot com>
- Date: Fri, 20 Jun 2003 10:47:34 +0200
- Subject: really really slow lookup_symtabs() - some obversations
- Organization: OneVision Software AG
Hi...
A while ago I posted a patch for gdbtk to avoid lookup_symtab() calls
because they appear to be
***very*** expensive in my environment. The patch made gdb more usable
again, but there are
still frequent calls to lookup_symtab() causing *heavy* slowdowns
(waiting 1 minute for one
lookup_symtab on a P4 1.5GHz is very common for me).
So I started out a new round. I found out that calling lookup_symtab
gets desperately slow
when the following 2 circumstances are met:
1. A lot of files involved in the executable (in my case >6000)
2. Calls to lookup_symtab with fully qualified name
I added some printfs in lookup_symtab for debugging:
.....
got_symtab:
/* First, search for an exact match */
printf ("lookup_symtab: ALL_SYMTABS\n");
ALL_SYMTABS (objfile, s)
{
if (FILENAME_CMP (name, s->filename) == 0)
{
printf ("lookup_symtab: found Case1\n");
return s;
}
....
}
printf ("lookup_symtab: After ALL_SYMTABS\n");
/* Now, search for a matching tail (only if name doesn't have any dirs) */
....
When called with a fully qualifed name I get a cascade of my printf
(at least hundreds mabe thousands) and I takes ages to complete
(as menitioned above) when called with a short name eg "foo.m"
I just get 3 to 8 of my printfs....
Does anyone know why all this is done for fully qualified names?
And maybe what can be done against?
Thanks for any infos,
Roland
PS: All stuff here mentioned concerns gdb 5.3 (to which I have to stick
until 6.0 is released)