rainers / cv2pdb

converter of DMD CodeView/DWARF debug information to PDB files
Artistic License 2.0
466 stars 110 forks source link

Add more line number information #51

Closed Marc-Aldorasi-Imprivata closed 5 years ago

Marc-Aldorasi-Imprivata commented 5 years ago

The previous line number code flushed immediately when the filename changed. This meant that some instructions after the current row's address could be not marked because they hadn't been passed when the flush happened but were before the address in the row for the new file. This patch changes addLineInfo to flush when adding a row that indicates a file change. Since at that point we know the address of the first instruction from the new file we can mark any previous instructions as being part of the previous file.

This also removes the special-casing of address 0; it's not mentioned in the DWARF spec and causes issues due to a linker bug: https://sourceware.org/bugzilla/show_bug.cgi?id=24192

rainers commented 5 years ago

Otherwise LGTM.

rainers commented 5 years ago

Thanks!