Better DWARF info for Cmm procedures?

Ben Gamari ben at
Mon Jan 7 21:57:01 UTC 2019

Ömer Sinan Ağacan <omeragacan at> writes:

>> However, there is also a slightly more fundamental issue here: GHC's NCG
>> handles DWARF information with block granularity. Fixing this will be a
>> bit more involved. See compiler/nativeGen/Dwarf.hs for details.
>> One alternative would be to just finish debug information in the LLVM
>> backend and use this instead (originally D2343, although mpickering has
>> a newer version).
> But LLVM backend also uses the same debug info we generate for NCG, no? So I
> think debug info would still be in block granularity?

> How hard do you think it would be to do the refactoring to generate debug info
> for each Cmm source line, instead of each RawCmm block?
I was under the impression that 
the C-- AST can already capture debug information with arbitrarily fine
granularity. However, after looking again at the implementation it looks
like you raise a very good point: CmmTick nodes apparently cover the
entire block they reside within. This is indeed a problem.

I honestly don't know how hard it would be to fix this without serious
surgery to the C-- pipeline. It doesn't sound particularly easy.


- Ben
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 487 bytes
Desc: not available
URL: <>

More information about the ghc-devs mailing list