Bug 3540 – Another DWARF line number fix

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
Other
OS
Linux
Creation time
2009-11-21T18:24:00Z
Last change time
2014-04-18T09:12:07Z
Keywords
patch, wrong-code
Assigned to
nobody
Creator
nfxjfg
Blocks
3214

Attachments

IDFilenameSummaryContent-TypeSize
513dmd_dwarffix for .debug_line outputtext/plain1413

Comments

Comment #0 by nfxjfg — 2009-11-21T18:24:25Z
There's a small detail wrong with the DWARF line number information: your code makes wrong assumptions when the line number state machine register state is reset. The DWARF specification says it's reset after DW_LNE_end_sequence, but as your code resets the register state, it doesn't emit a DW_LNE_end_sequence. The result is that some address/line number ranges in .debug_line are completely bogus. This patch provides a simple fix by moving DW_LNE_end_sequence to where it is appropriate. (Note that some DWARF consumers, such as GNU BFD, are able to deal with the buggy line number information.) (I hope the wrong-code keyword isn't inappropriate here.) Note that this bug is unrelated to bug 3214, which has yet to be fixed.
Comment #1 by nfxjfg — 2009-11-21T18:25:04Z
Created attachment 513 fix for .debug_line output
Comment #2 by leandro.lucarella — 2009-11-22T14:26:54Z
Comment #3 by nfxjfg — 2009-11-22T21:38:32Z
Great! That means this particular bug is fixed in the SVN version. Now Walter, what about bug 3214? Please comment!
Comment #4 by 2korden — 2009-11-24T04:10:07Z
Please, don't close bugs until a fix is proven to work. There is no DMD release that has this bug fixed yet.
Comment #5 by bugzilla — 2009-12-06T00:48:31Z
Fixed dmd 1.053 and 2.037