This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] add -foverride-comp-dir
On Mon, Oct 02, 2006 at 12:18:18PM +0200, Dan Aloni wrote:
> I see. Then perhaps the feature needs to be extended:
>
> -frebase-comp-dir=[old-base],[new-base]
>
> The user will pass (for example):
>
> -frebase-comp-dir=/home/user/work/src/project-root,.
>
> The code that handles frebase-comp-dir performs a match-and-replace of
> /home/user/work/src/project-root with '.'.
>
> Thus, if a recursive-make build is used, you'd still get a canonical
> path, for example:
>
> cd /home/user/work/src/project-root/subdir
> gcc -g -c a.c -o a.o
> -frebase-comp-dir=/home/user/work/src/project-root,.
>
> should produces the path "./subdir/a.o" in the debug information.
Yeah, that would be likely helpful.
In Fedora Core we use a DWARF3 postprocessing utility to do this kind of
replacement of paths in the debugging sections when we generate separate
debuginfo files, but it would certainly be better if already the compiler
could do that. The only issue would be that gas generates debuginfo too for
assembly sources and for that we'd need a similar switch for assembler I'd
guess.
Jakub