[LLVMdev] Advice for setting debug locations

Keno Fischer kfischer at college.harvard.edu
Wed Aug 13 14:25:21 PDT 2014


Hello,

I'm trying to fix a long standing issue we are having in Julia where
when the file information switched, we weren't recording that
correctly, so line information showed up in the wrong file. Basically
we would always create a scope with the DISubprogram and the given
line number. What I tried was to change the scope to be a DIFile
instead so we'd get the correct file information. Unfortunately I had
to revert this [1], because it crashes llvm's dwarf reader (which we
use to get line information for backtraces when exceptions are thrown)
with the following backtrace:

isNULL at /Users/kfischer/Documents/julia-debug/deps/llvm-svn/lib/DebugInfo/DWARFDebugInfoEntry.h:52
getAddressRanges at
/Users/kfischer/Documents/julia-debug/deps/llvm-svn/lib/DebugInfo/DWARFDebugInfoEntry.cpp:242
collectAddressRanges at
/Users/kfischer/Documents/julia-debug/deps/llvm-svn/lib/DebugInfo/DWARFUnit.cpp:302
generate at /Users/kfischer/Documents/julia-debug/deps/llvm-svn/lib/DebugInfo/DWARFDebugAranges.cpp:54
getDebugAranges at
/Users/kfischer/Documents/julia-debug/deps/llvm-svn/lib/DebugInfo/DWARFContext.cpp:270
getCompileUnitForAddress at
/Users/kfischer/Documents/julia-debug/deps/llvm-svn/lib/DebugInfo/DWARFContext.cpp:423

Can somebody tell me what the correct way to achieve this is?

[1] https://github.com/JuliaLang/julia/commit/e494cb6dff193ecb0e254981be0f1122ae294d04



More information about the llvm-dev mailing list