DWARF Standard


180201.1 Scott Linder DWARF and source text embedding Enhancement Open

Section 6.2, 7.27, pg 159, 237
This is a proposed extension to support embedding source text directly in
the line number program header. The proposal has also been sent to the
dwarf-discuss list, and is an alternative design based on DWARF Standard
issue 161018.1.


Add two new optional fields to the file_names prologue of the line table.

Add two bullets after "5. DW_LNCT_MD5"
6. DW_LNCT_has_source
    DW_LNCT_has_source indicates that the value is a boolean which affects the
    interpretation of an accompanying DW_LNCT_source value. When present there
    must be an accompanying DW_LNCT_source value. When true, consumers may use
    the embedded source instead of attempting to discover the source on disk.
    When false, consumers will ignore the DW_LNCT_source value. This code point
    is always paired with a flag form (e.g. DW_FORM_flag or
7. DW_LNCT_source
    DW_LNCT_source indicates that the value is a null-terminated string which
    is the original source text of the file. When present there must be an
    accompanying DW_LNCT_has_source value. The string will contain the UTF-8
    encoded source text with '\n' line endings. When the accompanying
    DW_LNCT_has_source value is false, the value of DW_LNCT_source will be the
    empty string. This code point is always paired with a string form (e.g.
    DW_FORM_string, DW_FORM_line_strp, DW_FORM_strp).

New type codes can be allocated for them in a backwards-compatible way, or
codes for these new content types can be added in the range of
[DW_LNCT_lo_user, DW_LNCT_hi_user] to avoid changing the spec itself.

Table 7.27:
Add DW_LNCT_has_source  0x6
Add DW_LNCT_source      0x7

Any DWARFv5 consumer which is unaware of this extension would continue to
operate as before, ignoring the new fields. Any consumer which is aware of the
extension would know to check DW_LNCT_has_source for each file_name entry in
order to determine whether the embedded source field (DW_LNCT_source) contains
the source text of the corresponding file.

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2007-2017 by DWARF Standards Committee.