[LLVMbugs] [Bug 13303] New: Broken debugging information, unless using an intermediate .s file

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jul 9 08:18:08 PDT 2012


             Bug #: 13303
           Summary: Broken debugging information, unless using an
                    intermediate .s file
           Product: clang
           Version: 3.1
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: l.lunak at suse.cz
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Clang seems to sometimes produce broken debugging information that makes
stepping in gdb impossible in some functions.

Steps to reproduce:

$ echo 'int main() { return 0; }' >a.cpp
$ clang++ a.cpp -g2
$ gdb a.out
(gdb) start
Temporary breakpoint 1 at 0x400540
Temporary breakpoint 1, 0x0000000000400540 in main ()

Notice here that there is no source listing for main or any other debugging

(gdb) quit
$ clang++ a.cpp -g2 -S
$ clang++ a.s
$ gdb a.out
(gdb) start
Temporary breakpoint 1 at 0x400540: file a.cpp, line 1.
Temporary breakpoint 1, main () at a.cpp:1
1       int main() { return 0; }

Notice that here the debugging information is present.

(gdb) quit
$ clang++ --version
clang version 3.1 (branches/release_31 157047)
Target: x86_64-unknown-linux-gnu
Thread model: posix

I cannot quite tell what the problem is (or even say for sure it's clang and
not gdb problem), but in both cases the binaries do contain debugging
information, it is just slightly different. Also, it seems that the debugging
information mostly works and is not generated correctly only for some

Comparing hexdump of the two binaries shows differences in sections
.note.gnu.build-id, .debug_info and .debug_line , but I don't know how to tell
more or what additional information I could provide.

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