Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 31 Mar 1996 15:43:51 +0200 (MET DST)
From:      grog@lemis.de (Greg Lehey)
To:        current@freebsd.org
Subject:   gcc symbols broken in -current?
Message-ID:  <199603311343.PAA00499@allegro.lemis.de>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199603311343.PAA00499>