From owner-freebsd-current Sun Mar 31 05:46:04 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id FAA24868 for current-outgoing; Sun, 31 Mar 1996 05:46:04 -0800 (PST) Received: from diablo.ppp.de (diablo.ppp.de [193.141.101.34]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id FAA24862 for ; Sun, 31 Mar 1996 05:45:59 -0800 (PST) Received: from allegro.lemis.de by diablo.ppp.de with smtp (Smail3.1.28.1 #1) id m0u3NS8-000QXsC; Sun, 31 Mar 96 15:45 MET DST From: grog@lemis.de (Greg Lehey) Organisation: LEMIS, Schellnhausen 2, 36325 Feldatal, Germany Phone: +49-6637-919123 Fax: +49-6637-919122 Received: (grog@localhost) by allegro.lemis.de (8.6.9/8.6.9) id PAA00499 for current@freebsd.org; Sun, 31 Mar 1996 15:43:51 +0200 Message-Id: <199603311343.PAA00499@allegro.lemis.de> Subject: gcc symbols broken in -current? To: current@freebsd.org Date: Sun, 31 Mar 1996 15:43:51 +0200 (MET DST) X-Mailer: ELM [version 2.4 PL23] MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk I've just run into a strange problem: when debugging a user-level C program, the symbolic information is all screwed up. Consider this backtrace: > Starting program: /S/FreeBSD/Development/cdtools-1.3/mklinks -k -s2 /src/2.2-CURRENT/src/sys /usr/src/sys > During symbol reading...unknown symbol type 0x1e... What's that? > (gdb) bt > #0 0x8039848 in link () > #1 0x22a1 in checkdir (src=0xefbfd05c "/src/2.2-CURRENT/src/sys/CVS", dst=0xefbfcc5c "/usr/src/sys/CVS") > at mklinks.c:198 > #2 0x1fc3 in checkdir (src=0xefbfd5ba "/src/2.2-CURRENT/src/sys", dst=0xefbfd5d3 "/usr/src/sys") at mklinks.c:290 > #3 0x3e4f in main (argc=5, argv=0xefbfd4a8) at mklinks.c:674 > (gdb) f 1 > #1 0x22a1 in checkdir (src=0xefbfd05c "/src/2.2-CURRENT/src/sys/CVS", dst=0xefbfcc5c "/usr/src/sys/CVS") > at mklinks.c:198 > 198 if (dohardlink) > (gdb) l > 193 fprintf (stderr, "*** Can't unlink %s: %s\n", srcname, strerror (errno)); > 194 else > 195 { > 196 if (verbose > 1) > 197 fprintf (stderr, "--- Unlinked %s\n", srcname); > 198 if (dohardlink) > 199 { > 200 if (link (srcname, dstname)) /* can't link the new source? */ > 201 fprintf (stderr, "*** Can't link %s to %s: %s\n", srcname, dstname, strerror (errno)); > 202 else if (verbose > 1) First, the function name for frame 1 is incorrect: it's in linkreplace, not checkdir. Then the line number is incorrect: it's 200, not 198. The line numbers are, in fact, all off by 2. This problem obviously comes from the compiler: if I compile the same source under BSD/386, and then run it under FreeBSD with the same debugger, things look correct: > (gdb) bt > #0 0x3aa4 in link () > #1 0x155d in linkreplace (srcname=0xefbfbafc "/src/2.2-CURRENT/src/sys/compile/CVS/Root", > dstname=0xefbfb6fc "/usr/src/sys/compile/CVS/Root", dohardlink=1) at mklinks.c:200 > #2 0x268b in checkdir (src=0xefbfc5ac "/src/2.2-CURRENT/src/sys/compile/CVS", > dst=0xefbfc1ac "/usr/src/sys/compile/CVS") at mklinks.c:553 > #3 0x1bb7 in checkdir (src=0xefbfd05c "/src/2.2-CURRENT/src/sys/compile", dst=0xefbfcc5c "/usr/src/sys/compile") > at mklinks.c:292 > #4 0x1bb7 in checkdir (src=0xefbfd5b9 "/src/2.2-CURRENT/src/sys", dst=0xefbfd5d2 "/usr/src/sys") at mklinks.c:292 > #5 0x2df3 in main (argc=5, argv=0xefbfd4a8) at mklinks.c:676 The error message at the start doesn't get printed, either. Greg