Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!jarthur!uci-ics!rfg From: rfg@ics.uci.edu (Ronald Guilmette) Newsgroups: comp.lang.c++ Subject: Re: GDB slowness (includes -fminimal-debug patches) Message-ID: <26074272.12588@paris.ics.uci.edu> Date: 21 Mar 90 08:59:30 GMT References: <9003161607.AA06581@kewill.uucp> Reply-To: rfg@ics.uci.edu (Ronald Guilmette) Organization: UC Irvine Department of ICS Lines: 36 In article <9003161607.AA06581@kewill.uucp> bryan@kewill.UUCP (Bryan Boreham) writes: >Paul Vaughan (vaughan@mcc.com) writes: > >> In using gdb, I often suffer long delays ... > >Me too :-) > >G++ traditionally outputs all the information that might conceivably >be useful to a debugger, in every .o file. Since C++ programs tend to >#include a lot of the same headers in every source file, this leads to >duplication in the binary. It hit me pretty hard, since the smallest >ET++ program would wind up at around 17Mb, and the biggest machine >here only had 8Mb of RAM... > >I suggested to Michael that this was wrong, and he implemented a flag >-fminimal-debug. This has been in g++ since version 1.36, and it only >outputs debug info for a class if code is generated in this >compilation. For systems structured as one .cc file per class, this >can be a big win. My ET++ binaries come down to around 5Mb, still >with all the information gdb needs. So this reduces the duplicated debugging info for classes. Great. Now what about typedefs? What about enum types? What about good old fashioned structs and unions? What about extern declarations for data objects and functions? This stuff can all be present in include files also and it can also lead to duplication of debug information in executable files. Frankly, the solution described above sounds like a kludge. A better solution would be to have a "smart linker" which eliminated the duplicate information for *all* categories of things while it was doing linking. This could be done in GNU ld and in COFF and ELF linkers, and it would provide even greater savings in disk space, and even faster debugging. // Ron Guilmette (rfg@ics.uci.edu) // C++ Entomologist // Motto: If it sticks, force it. If it breaks, it needed replacing anyway.