Issue 240320.2: Clarify Description of Line Table Compression

Author: Cary Coutant
Champion:
Date submitted: 2024-03-20
Date revised:
Date closed:
Type: Clarification
Status: Open
DWARF Version: 6

Background

Technically, the DWARF spec doesn't really describe the compression technique used for line table rows correctly. The non-normative text at the beginning of Section 6.2 says:

We shrink it with two techniques. First, we delete from the matrix each row whose file, line, source column and discriminator is identical with that of its predecessors. Any deleted row would never be the beginning of a source statement. Second, ….

This isn't quite right — the is_stmt flag doesn't mark the beginning of a source statement; it marks a suggested breakpoint location, which may not be the first instruction of the statement. So it's quite possible that a row with is_stmt = false could be followed by a row with is_stmt = true, whose file, line, source column, and discriminator are identical with the first. So really, we should say that no row where is_stmt = true can be deleted. Likewise, prologue_end and epilogue_begin have the same effect — they apply to a single instruction, but not to the instructions in any following rows that were elided.

Proposed Changes

In Section 6.2, replace the sentences quoted above with the following:

We shrink it with two techniques. First, we delete from the matrix each row whose file, line, source column and discriminator is identical with that of its predecessors, except where the instruction is marked as a suggested breakpoint location, the end of a prologue region, or the beginning of an epilogue region. Second, …..