[LLVMdev] Fwd: LLVM generates broken debug info on Windows

Vadim vadimcn at gmail.com
Thu Jun 6 13:16:37 PDT 2013


Hi,
I 'm trying to figure out why LLVM emits broken DWARF debug info on
Windows.   When I load executable in gdb it says "DW_FORM_strp pointing
outside of .debug_str section [in module ... ]"   It looks like this issue
had been previously reported here
[1]<http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-October/025291.html>,
[2] <http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-October/054751.html>.
I am still seeing this error with clang compiled from master branch (as
well as in 3.3 and 3.2).

So I compared asm emitted by clang with that created by gcc, and the
difference seems to be that for inter-debug-section references gcc uses
.secrel32 <label> directive, whereas clang uses .long <label>.   After
manually replacing .long's with .secrel32's and building executable, gdb
seemed to like new debug info a lot more!

I am not sure what's the right approach for fixing this.  Should .secrel32
be used on all platforms, or just for Windows PE-COFF?   Can somebody
familiar with intricacies of DWARF format on different platforms please
comment of this?

thanks!
Vadim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130606/6799c354/attachment.html>


More information about the llvm-dev mailing list