Full paths in diagnostic output?
Brian Dessent
brian@dessent.net
Wed May 21 06:32:00 GMT 2008
Rick Mann wrote:
> Is there a command-line option to enable something like this?
Not that I know of. But gcc reports filenames in diagnostics in the
same form they are specified on the command line, so if you specify them
as full pathnames in the command you'll get them that way in the
diagnostics. e.g. in a makefile you could try something like
%.o: %.c
$(CC) $(CPPFLAGS) $(CFLAGS) -c `readlink -e $<` -o $@
Do note however that the same thing applies for the source filenames
recorded in the debug information (DW_AT_name), so doing this may change
your ability to use source line information with debugging tools as the
location will be recorded as an absolute path instead of relative to the
compilation dir (DW_AT_comp_dir). If the source location remains a
valid path on the debug host then it should still work fine though.
Brian
More information about the Gcc-help
mailing list