symtab/2254: Symbol loading in GDB too slow

Daniel Jacobowitz
Mon Apr 16 15:08:00 GMT 2007

The following reply was made to PR symtab/2254; it has been noted by GNATS.

From: Daniel Jacobowitz <>
To: Thomas McGuire <>
Subject: Re: symtab/2254: Symbol loading in GDB too slow
Date: Mon, 16 Apr 2007 11:02:05 -0400

 On Mon, Apr 16, 2007 at 04:35:06PM +0200, Thomas McGuire wrote:
 > > Symbol table loading is already heavily optimized.  GDB can't give you
 > > miracles; how big are the libraries that you're trying to debug, 
 > Seems like the libraries are indeed quite big. After issuing ldd kmail (which gave me 100 different libraries), I used ls -l -h on some of them which I suspected to be the bigest:
 > 62M 2007-04-15 13:08 /media/kdedev/home/build/KDE/kdepim/lib/
 > 7.6M 2007-04-10 22:36 /media/kdedev/home/kde/lib/
 > 21M 2007-04-10 22:35 /media/kdedev/home/kde/lib/
 > 15M 2007-04-15 13:16 /media/kdedev/home/kde/lib/
 > 42M 2007-04-10 22:36 /media/kdedev/home/kde/lib/
 > 54M 2007-04-10 22:37 /media/kdedev/home/kde/lib/
 > 37M 2007-04-10 22:36 /media/kdedev/home/kde/lib/
 > 3.3M 2007-03-28 00:08 /media/kdedev/home/qt-copy/lib/
 > 1.9M 2007-03-27 23:46 /media/kdedev/home/qt-copy/lib/
 > 9.1M 2007-03-27 23:59 /media/kdedev/home/qt-copy/lib/
 > >and how big are their debugging symbols?
 > What command can I use to find out?
 You can look at the size of .debug_info with readelf -S, but it won't
 tell us much; it's always roughly the same proportion of file size for
 C++.  I estimate you have about 150MB of DWARF-2 information (plus or
 minus a hundred percent :-).  DWARF-2 is designed to be compact on
 disk; useful memory representations tend to be bigger.
 I would be reluctant to debug KDE on something with <1GB RAM.
 > If it is already heavily optimized, do you think caching on disk would gain anything at all?
 Possibly, since it could be more easily paged out by the OS if we
 could use it unmodified.  But it would be a fair amount of work to
 design a useful cache.
 I think there are also some C++-specific optimizations possible.  For
 instance we waste some memory by our representation of demangled
 names, especially for templates.  I had a discussion the Michael Matz
 on the GCC list some months ago about this; it requires compiler
 assistance to get it right.
 Daniel Jacobowitz

More information about the Gdb-prs mailing list