Re: Full paths in diagnostic output?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux