1

I have generated an ELF object via MCJIT with debug information, but when I read it back in LLVM it finds an empty debug_ranges section, even though there should be data there. I've dumped the object file to disk, and indeed:

$ readelf -wR objfile
Contents of the .debug_ranges section:

    Offset   Begin    End
    00000000 0000000000000089 00000000000000b6 
    00000000 0000000000000120 0000000000000150 
    00000000 <End of list>

$ llvm-dwarfdump --debug-dump=ranges objfile

objfile:        file format ELF64-x86-64


.debug_ranges contents:

Dumping with plain llvm-dwarfdump objfile gives the slightly more detailed:

.debug_ranges contents:
00000000 <End of list>
00000010 <End of list>
00000020 <End of list>

So it seems that the data is written successfully but not properly read. Any ideas what can cause this and how can I solve it?

I've generated the object file using LLVM 3.2, and tried llvm-dwarfdump from both 3.2 and top-of-trunk.

Oak
  • 26,231
  • 8
  • 93
  • 152
  • 1
    Don't over-estimate the completeness of the `DebugInfo` library ;-) It's very bare-bones and not too-well-tested. The best thing would be to submit a detailed bug report (with your object file attached). The next best thing would be fire up the debugger (or `errs()`) and get your hands dirty. – Eli Bendersky Oct 28 '13 at 16:49
  • @EliBendersky thanks, though this is of course what I was hoping not to hear :-) I'll try to tackle this some more on my own. Meanwhile I see `readelf` and `objdump` disagree on the content of that section as well, so maybe something went wrong when it was written. – Oak Oct 29 '13 at 12:37

0 Answers0