This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: Debugging a large program
----- Original Message -----
From: "Daniel Jacobowitz" <drow@false.org>
To: "Nick Savoiu" <savoiu@ics.uci.edu>
Cc: <gdb@sources.redhat.com>
Sent: Monday, October 04, 2004 4:25 PM
Subject: Re: Debugging a large program
> On Mon, Oct 04, 2004 at 04:21:28PM -0700, Nick Savoiu wrote:
> > ----- Original Message -----
> > From: "Daniel Jacobowitz" <drow@false.org>
> > To: "Nick Savoiu" <savoiu@ics.uci.edu>; <gdb@sources.redhat.com>
> > Sent: Monday, October 04, 2004 3:14 PM
> > Subject: Re: Debugging a large program
> >
> >
> > > On Mon, Oct 04, 2004 at 05:15:14PM -0400, Daniel Jacobowitz wrote:
> > > > > BTW, 405MB was for gdb running to main() not just what I said
above :)
> > There
> > > > > probably are a few global variables but I don't think they should
take
> > up
> > > > > too much space.
> > > >
> > > > That requires loading symbol information for all the shared
libraries,
> > > > which is probably what's taking all the space. 400MB+ is a bit
> > > > unusual, but I don't know how big your libraries are.
> > >
> > > Your libraries contain 288MB of DWARF2 debug information. We're
> > > winding up with less than twice that in memory usage for reading in
> > > partial symbols. It probably could be reduced somewhat - say, 30%.
> > > But some of this data we've just got to hold in memory.
> >
> > I see. If one of the .so files is not actually used, can I somehow
prevent
> > GDB from loading even its partial symbols? How much memory do partial
> > symbols use?
>
> Partial symbols are most or all of that memory. Try "set
> auto-solib-add 0", followed by "sharedlibrary REGEXP-YOU-WANT-LOADED".
This seems to work reasonably well (a bit tedious since one has to know what
libs to load and when). I wish that GDB could infer that automagically.
Nick