llvm-gcc debug info on mingw32msvc?

I'm building a cross-gcc with target i386-mingw32msvc, running on Mac OS X 10.5.2. While it compiles and works fine and dandy, I don't seem to get any sensible debug output regarding lines/position in my program. Running the executables produced by the cross-compiler in gdb, I get full symbols in backtraces, but "the program doesn't contain any line number information" or somesuch, so I can't single-step or anything. Comparing the output from a regular cross-gcc (4.3.0 from fsf), any line number information seems to be missing. The generated assembly doesn't show any line information either; old-style gcc has lots of
  .file 1 "main.c"
  .loc 1 4 0
in there, while llvm-gcc has nothing.
Is this simply not implemented? I don't see anything in the code generated by --emit-llvm, so this seems to be a problem in llvm-gcc, right? Would it be feasible to add this?

Also, totally unrelated, should the current trunk build again? I'm getting a lot of
/Developer/Cocotron/1.0/Source/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:3229: error: ‘atomic_lss’ is not a member of ‘llvm::Intrinsic’
as of r50895.

Cheers,
Johannes Fortmann

Is this simply not implemented? I don't see anything in the code
generated by --emit-llvm, so this seems to be a problem in llvm-gcc,
right? Would it be feasible to add this?

Currently you only get debug info when compiling at -O0...

Ciao,

Duncan.

Oh, I forgot to say that I use -g -O0. I do get debug info, but no line number information. Stuff like which function is where etc. is all there.

Thanks anyway,
Johannes

Hello, Johannes

Oh, I forgot to say that I use -g -O0. I do get debug info, but no
line number information. Stuff like which function is where etc. is
all there.

There are some known issues with debug/eh info on mingw32. Some of them
(especially eh-related) will require DwarfEmitter refactoring and this
is my todo list.

        .file 1 "main.c"
        .loc 1 4 0
in there, while llvm-gcc has nothing.

Line numbering is implemented, however llvm-gcc does not use .loc
assembler directives to emit line numbering information - it does this
directly, thus future investigation will be needed to compare 'raw'
contents of sections with dwarf information. However, I expect multiple
issues here, since almost nobody tested this :slight_smile: