[LLVMbugs] [Bug 7476] New: llvm-gcc emits incorrect stabs debug info (for source file name)

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jun 23 14:48:09 PDT 2010


http://llvm.org/bugs/show_bug.cgi?id=7476

           Summary: llvm-gcc emits incorrect stabs debug info (for source
                    file name)
           Product: new-bugs
           Version: unspecified
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: wiml at omnigroup.com
                CC: llvmbugs at cs.uiuc.edu


When compiling with -gstabs (or -gstabs+) on OSX, llvm-gcc emits debug symbols
with incorrect N_SECT values.

To duplicate: place this program into 'foo.c' and compile with 'llvm-gcc-4.2
-gstabs+ foo.c' and also with normal gcc.

int main()
{
   return 42;
}

Compare the results of 'nm -ax a.out' in each case. llvm-gcc's output includes
these lines (inter alia):

0000000000000000 64 00 0000 0000000000000073 /tmp/
0000000000000000 84 00 0000 00000000000000c3 /tmp//foo.c
000000004c227de6 66 00 0001 000000000000007f
/var/folders/uD/uDLSH-4HEmayFxoFpdflz+++2sg/-Tmp-//ccSxlmdV.o
0000000000000000 64 00 0000 0000000000000079 foo.c

Notice that the third field, the section number, is zero. This should contain
the section number of the section in which the function's code resides
(typically 1) in order for the debug symbols to be appropriately relocated in
the final executable.

For reference, the second field is the N_TYPE value: in this example the types
are N_SO (source file name), N_SOL (#included file name --- shouldn't this be
N_SO again?), N_OSO (object file name and timestamp), and N_SO again.

The doubled slash is also a bug, see bug #5011.

"llvm-gcc-4.2 -v" reports "gcc version 4.2.1 (Based on Apple Inc. build 5646)
(LLVM build 2207.5)".

The behavior is the same for x86_64 and i386 targets.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list