This is the mail archive of the gdb@sourceware.cygnus.com 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]

Re: problems with gdb


So, one of the problems that I've been having is that some large .so libraries
take forever to load.  One of the libraries is about 28 meg with debugging
symbols in it.  I've let it run for about 10 mins and it's never finished
loading.  Here's what gprof says for loading a reasonable sized library ( 5
meg or so ):

Flat profile:

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total           
 time   seconds   seconds    calls  ms/call  ms/call  name    
 70.98     19.47    19.47    11954     1.63     2.25  lookup_minimal_symbol
 27.12     26.91     7.44 33240213     0.00     0.00  strcmp_iw
  0.33     27.00     0.09        3    30.00  9038.95  read_dbx_symtab
  0.15     27.04     0.04    44554     0.00     0.00  hash
  0.11     27.07     0.03   337915     0.00     0.00  bfd_getl32
  0.11     27.10     0.03    44554     0.00     0.00  bcache
  0.11     27.13     0.03      150     0.20     0.20  end_psymtab

Uhh...that's 33 _million_ calls.  That looks like this chunk of code:

 for (objfile = object_files;
       objfile != NULL && found_symbol == NULL;
       objfile = objfile->next)
    {
      if (objf == NULL || objf == objfile)
	{
	  for (msymbol = objfile->msymbols;
	       msymbol != NULL && SYMBOL_NAME (msymbol) != NULL &&
	       found_symbol == NULL;
	       msymbol++)
	    {
	      if (SYMBOL_MATCHES_NAME (msymbol, name))
		{
		  switch (MSYMBOL_TYPE (msymbol))
		    {
		    case mst_file_text:

I'm sorry, is that looking over a linked list?  SYMBOL_MATCHES_NAME() is a
macro that does some mangling magic so we can't use a standard hash lookup
table but there has to be something we can do to speed that up.

--Chris

-- 
------------
Christopher Blizzard
http://people.redhat.com/blizzard/
A few years back, I saw a young child stuck in a tree.  Nowadays,
when I find myself in a troubling situation, I look back and wonder
if that kid saw me take that chocolate bar from his backpack on
the ground.
------------

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