pub struct PrefixMaps {
pub macros: PrefixMap,
pub debug: PrefixMap,
pub profile: PrefixMap,
}Expand description
The three answers to the question the -f*-prefix-map= family asks, which is one question
asked about three kinds of output.
They are separate because gcc’s flags are separate and a build uses that: a distribution maps
its debug paths to something a debugger can find the sources under and leaves __FILE__ alone,
or maps __FILE__ so that an assertion message does not name a build directory and leaves the
debug info pointing at the real tree. -ffile-prefix-map= is the shorthand for all three and is
what a build that simply wants to be reproducible writes.
Fields§
§macros: PrefixMapWhat __FILE__ and __BASE_FILE__ are rewritten by, from -fmacro-prefix-map=.
The only one of the three this compiler acts on today, because it is the only one whose
output exists: __FILE__ is a string literal in the binary and an assertion message a user
reads.
debug: PrefixMapWhat a path in the debug info is rewritten by, from -fdebug-prefix-map=.
Read by the driver rather than by rucc-debug, because the driver is the layer where a path
is still a path and by the time one reaches the DWARF writer it is a string in a table that
nothing is allowed to reinterpret. Every path that reaches the line table goes through it,
the unit’s own name and the directory it was compiled in among them.
profile: PrefixMapWhat a path in the profile data is rewritten by, from -fprofile-prefix-map=.
Nothing reads this yet either, and for the same reason: there is no profile data.