[LLVMdev] Advice for setting debug locations

David Blaikie dblaikie at gmail.com
Wed Aug 13 14:53:01 PDT 2014


Use the second form of DW_TAG_lexical_block metadata (the one with 3
fields - http://llvm.org/docs/SourceLevelDebugging.html#block-descriptors
) to describe file changes within a sequence of LLVM IR functions.

A small example of IR would be easier to follow if you want help
debugging why your IR is causing problems.

On Wed, Aug 13, 2014 at 2:25 PM, Keno Fischer
<kfischer at college.harvard.edu> wrote:
> 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
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev



More information about the llvm-dev mailing list