public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* really really slow lookup_symtabs() - some obversations
@ 2003-06-20  9:00 Roland Schwingel
  0 siblings, 0 replies; only message in thread
From: Roland Schwingel @ 2003-06-20  9:00 UTC (permalink / raw)
  To: gdb

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)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-06-20  9:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-20  9:00 really really slow lookup_symtabs() - some obversations Roland Schwingel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).