It turns out that providing debug information in LLVM is relatively
straightforward. At this moment this only provides debug information with
- rGHC Glasgow Haskell Compiler
Lint Warnings Excuse: it's okay Severity Location Code Message Warning compiler/llvmGen/LlvmCodeGen/Base.hs:66 TXT3 Line Too Long Warning compiler/llvmGen/LlvmCodeGen/Base.hs:202 TXT3 Line Too Long Warning compiler/llvmGen/LlvmCodeGen/Base.hs:374 TXT3 Line Too Long Warning compiler/llvmGen/LlvmCodeGen/Base.hs:383 TXT3 Line Too Long Warning compiler/llvmGen/LlvmCodeGen/Ppr.hs:54 TXT3 Line Too Long Warning compiler/llvmGen/LlvmCodeGen/Ppr.hs:92 TXT3 Line Too Long Warning compiler/llvmGen/LlvmCodeGen/Ppr.hs:95 TXT3 Line Too Long Warning compiler/llvmGen/LlvmCodeGen/Ppr.hs:98 TXT3 Line Too Long Warning compiler/main/CodeOutput.hs:98 TXT3 Line Too Long Warning compiler/main/CodeOutput.hs:183 TXT3 Line Too Long
No Unit Test Coverage
- Build Status
Buildable 17618 Build 34096: [GHC] Linux/amd64: Patch building Build 34095: [GHC] OSX/amd64: Continuous Integration Build 34094: [GHC] Windows/amd64: Continuous Integration Build 34093: arc lint + arc unit
Good work. Seems LLVM's DWARF representation has matured a bit since I touched it. Adding debug annotations for the blocks shouldn't be that hard either, right? I added a few more or less obvious remarks.
According to the docs there's a "distinct" modifier too. I suspect that this might solve the problems I had with blocks before - namely that if two blocks happen to have the same meta data (same line) LLVM assumed that they were the same. But no pressing reason yet to introduce it, I suppose.
Might want to factor this out? Feels a bit verbose to put into llvmCodeGen'.
I think this should be the compiler's working directory. Can't quite remember how strong my evidence for that was.
cProjectName ++ " " ++ cProjectVersion would be consistent with nativeGen/Dwarf.hs.
Unused, as above you use an inline MetaStruct in the compile unit meta.
I did start playing around with this patch a few days ago. You can find my progress here https://github.com/cocreature/ghc/commits/llvm-dwarf (sorry for the terrible commit messages, I was planning to clean this up at some point). I updated it for LLVM 4 and GHC master. However, setting breakpoints in gdb/lldb doesn’t seem to work. I made some progress in that they no longer complain about not knowing the file but they still don’t know the line number. After playing around with the LLVM generated from C code by Clang, I got the impression that this requires DILocation annotations but so far adding them doesn’t seem to help (ignoring the fact that I currently just attach it to the first instruction in the corresponding block which is probably not a good idea). I don’t know when I’ll get around to work on this again so feel free to pick up what I’ve got (if it’s useful).