DWARF Standard


HOME
SPECIFICATIONS
FAQ
ISSUES



210628.1 Caroline Tice Clarification of relative paths in DW_AT_comp_dir Clarification Open Caroline Tice


Section 3.1.1, pg 64

Below are two alternate proposals, one for insisting on absolute
paths, and one for allowing relative paths.


Current text (Section 3.1.1, pg 64):
----------------------------------------------
6. A DW_AT_comp_dir attribute whose value is a null-terminated string
containing the current working directory of the compilation command
that produced this compilation unit in whatever form makes sense for
the host system.


Proposal 1 (insist on absolute path):
------------------------------------------------
Add the text "absolute path for the" to the current text:

6. A DW_AT_comp_dir attribute whose value is a null-terminated string
containing the absolute path for the current working directory of the
compilation command that produced this compilation unit in whatever
form makes sense for the host system.


Proposal 2 (allow relative paths, with clarification):
------------------------------------------------------------------
Add the following normative text after the current text:

"If a relative path is used in DW_AT_comp_dir, it should be
interpreted as being relative to the location of the linked image
containing the DW_AT_comp_dir entry."

Add the following non-normative text after the preceding text:

In some cases a producer may allow the user to specify a relative
path for DW_AT_comp_dir. There are a few cases in which this is
useful, but in general using a relative path for DW_AT_comp_dir is
discouraged as it will not work well in many cases including the
following: different relative paths are used within the same build;
the build system creates multiple linked images in different
directories; the final linked image is moved before being debugged; .o
files need to be debugged directly.  If a relative path is used in
DW_AT_comp_dir, it should be interpreted as being relative to the
location of the linked image containing the DW_AT_comp_dir entry.

-- 
2021-07-21: Revised: Added alternate proposal.
   Previous version: http://dwarfstd.org/ShowIssue.php?issue=210628.1-1


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