From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20106 invoked by alias); 24 Nov 2001 18:06:34 -0000 Mailing-List: contact gdb-help@sourceware.cygnus.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 19986 invoked from network); 24 Nov 2001 18:05:17 -0000 Received: from unknown (HELO gremlin.ics.uci.edu) (128.195.1.70) by sourceware.cygnus.com with SMTP; 24 Nov 2001 18:05:17 -0000 Received: from vino.ics.uci.edu ( vino.ics.uci.edu [128.195.11.198] ) by gremlin-relay.ics.uci.edu id aa28513 for ; 24 Nov 2001 10:05 PST To: gdb@sources.redhat.com Subject: Re: GDB 5.1 on Solaris 2.8 From: Dan Nicolaescu In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 11 Nov 2001 21:24:00 -0000 Message-ID: <200111241005.aa28513@gremlin-relay.ics.uci.edu> X-SW-Source: 2001-11/txt/msg00121.txt.bz2 gdb@thewrittenword.com writes: > > > I've just built GDB 5.1 on Solaris 2.8, and I have a problem: GDB says > > > there's no debugging symbols in every executable I find, even though > > > they > > > were compiled and linkes with -g. dbx does find the debugging info. > > > >From what I see, GDB does find the minimal symbols, since I can put > > > breakpoints, but it cannot find the source line information. > > > > > > This is the first time I build GDB on Solaris, so I don't know whether > > > this is a known issue (not a word in README, though), or maybe I > > > goofed > > > during the build. > > > > > > The compiler used to compile GDB and the programs I try to debug was > > > SunWspro ANSI C compiler. > > > > > > Any ideas are welcome. > > > > > > It sounds that this is due to the fact that Sun's compiler+linker do not > > put the full debugging information in the binary by default. > > They only put some minimal debug info in the binary and leave the > > rest in the object files. > > > > Try compiling with -g -xs and see if you can debug then. > > $ pwd > /opt/src/devel/gdb-5.1 > $ ls -ld a.c > -rw-rw-r-- 1 china src 33 Nov 23 15:25 a.c > $ cat a.c > int > main (void) { > int a = 1; > } > $ cc -V > cc: Sun WorkShop 6 update 2 C 5.3 2001/05/15 > $ cc -g -xs a.c > $ dbx a.out > dbx> list 1,+ > 1 int > 2 main (void) { > 3 int a = 1; > 4 } > dbx> exit > $ gdb a.out > gdb> list > /opt/src/devel/gdb-5.1: Is a directory. Well, it works for me... But it seems that you have a newer version of the Sun compiler than I do: cc -V cc: Sun WorkShop 6 update 1 C 5.2 2000/09/11 gdb /tmp/a.out GNU gdb 5.1 Copyright 2001 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "sparc-sun-solaris2.7"... (gdb) l 1 int 2 main (void) { 3 4 int a = 1; 5 return 0; 6 } Same thing on solaris2.8