Skip to content

llvm-clang executables are not debuggable. #51

Description

@GoogleCodeExporter
What steps will reproduce the problem?
1. Create c hello world project.
2. Build
3. start gdb

What is the expected output? What do you see instead?

I am able to have fun with gdb just as with gcc.

What version of the product are you using? On what operating system?
Version: Indigo Service Release 2
Build id: 20120216-1857
clang 3.1 (mingw)

Please provide any additional information below.

clang -O0 -emit-llvm -g3 -Wall -c -fmessage-length=0 -o src\gdb-test.bc 
..\src\gdb-test.c
llvm-ld -v -LC:\Software\clang+llvm\lib -Lc:\MinGW\lib\gcc\mingw32\4.7.0 
-native -o gdb-test src\gdb-test.bc -lstdc++
  Linking bitcode file 'src/gdb-test.bc'
  Linked in file 'src/gdb-test.bc'
  Linking archive file 'c:/MinGW/lib/gcc/mingw32/4.7.0/libstdc++.a'
Generating Bitcode To gdb-test.exe.bc
Generating Assembly With: 
'c:/Software/clang+llvm/bin/llc.exe' '-x86-asm-syntax=att' '-o' 
'gdb-test.exe.s' 'gdb-test.exe.bc' 
Generating Native Executable With:
'c:/MinGW/bin/gcc.exe' '-fno-strict-aliasing' '-O3' '-o' 'gdb-test.exe' 
'gdb-test.exe.s' '-LC:\Software\clang+llvm\lib' 
'-Lc:\MinGW\lib\gcc\mingw32\4.7.0' '-lstdc++' 
Build complete for project gdb-test
Time consumed: 412  ms

Now from mingw shell:
GNU gdb (GDB) 7.4
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from d:\workspace\gdb-test\Debug\gdb-test.exe...
DW_FORM_strp pointing outside of .debug_str section [in module 
d:\workspace\gdb-test\Debug\gdb-test.exe]
(gdb) b main
No symbol table is loaded.  Use the "file" command.
Make breakpoint pending on future shared library load? (y or [n]) y

Breakpoint 1 (main) pending.
....

attached file from:
$ nm gdb-test.exe > symbols


Original issue reported on code.google.com by kmalew...@gmail.com on 19 Jun 2012 at 11:19

Attachments:

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions