From: Joshua W. <jpe...@gm...> - 2020-01-20 15:19:26
|
On 1/14/20 2:11 PM, hp...@zy... wrote: > On January 14, 2020 11:51:44 AM PST, Joshua Watt <jpe...@gm...> wrote: >> On 1/13/20 7:34 PM, H. Peter Anvin wrote: >>> On 2020-01-13 10:44, Joshua Watt wrote: >>>> On 12/18/19 11:46 AM, Joshua Watt wrote: >>>>> Adds a command line option --debug-prefix-map that changes the way >> file >>>>> paths are encoded in debug information (similar to >> -fdebug-prefix-map in >>>>> GCC). This allows nasm to generate reproducible output regardless >> of the >>>>> location of the files. >>>> Ping? >>>> >>> I would prefer if this could be made into a set of %pragma debug >> options; that >>> way they can be specified either in a source file or on the command >> line. >> >> I can do that if you think it's better, but out of curiosity, what's >> the >> utility in being able to specify the prefix mapping in the source file? >> >> It seems like isn't very useful because a source file isn't going to be >> >> able to know the location where it is checkout out to correctly set the >> >> option? >> >>> -hpa >>> > Consider config.h or the equivalent. Ok, I finally got around to attempting to do the debug prefix map with a %pragma, but there is a problem that I found with this approach: The output backends are initialized before the pragma options are parsed. Most of the backends set the "module" name (the thing that needs to be remapped) at initialization, meaning that the remapping doesn't occur at all because it's needed before any pragma commands are parsed. It looks like you can specify pragma statements on the command line with --pragma, but this doesn't seem any better than a dedicated option (e.g. --debug-prefix-map), and might be confusing to have a pragma that only really works when specified on the command line and has no effect when specified in a source file? |