Debugging Information for Windows

Hello,

Can LLVM generate debugging information for a Windows target? If not,
can you think of any simple alternatives?

Best Regards,
Jon

Hello

Can LLVM generate debugging information for a Windows target?

Yes. LLVM generates DWARF debugging information. I haven't checked its
status recently, but it worked some time ago (on mingw32). Note that,
however, you cannot mix stabs debug format and DWARF (I saw, e.g.
pretty weird results from gdb in that case), that means you will need
either use new mingw32 gcc (4.2+) or rebuild runtime, etc to use
DWARF.

Can LLVM generate debugging information for a Windows target?

Yes. LLVM generates DWARF debugging information. I haven't checked its
status recently, but it worked some time ago (on mingw32). Note that,
however, you cannot mix stabs debug format and DWARF (I saw, e.g.
pretty weird results from gdb in that case), that means you will need
either use new mingw32 gcc (4.2+) or rebuild runtime, etc to use
DWARF.

Ok, is there a tutorial on how to emit assembly and machine code? I'm
using the code in llc as a starting point, but I'm running into lots
of problems.

Best Regards,
Jon

Can LLVM generate debugging information for a Windows target?

Yes. LLVM generates DWARF debugging information. I haven't checked its
status recently, but it worked some time ago (on mingw32). Note that,
however, you cannot mix stabs debug format and DWARF (I saw, e.g.
pretty weird results from gdb in that case), that means you will need
either use new mingw32 gcc (4.2+) or rebuild runtime, etc to use
DWARF.

Ok, is there a tutorial on how to emit assembly and machine code? I'm
using the code in llc as a starting point, but I'm running into lots
of problems.

I don't think we have any tutorial on this, although it would be an
obvious extension of the Kaleidoscope tutorial.

You may find clang's Backend.cpp useful:
  http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/Backend.cpp?revision=75821&view=markup
It is relatively self contained.

- Daniel