[PATCH] add -foverride-comp-dir

Daniel Jacobowitz drow@false.org
Sun Oct 1 23:27:00 GMT 2006


On Sun, Oct 01, 2006 at 01:06:07PM -0700, Mark Mitchell wrote:
> Geoffrey Keating wrote:
> 
> >>When debug information is used, we need to make sure that that the
> >>result binaries are identical if compiled from the same source between 
> >>several developers working from different directories, and also to be 
> >>able to look at core files from gdb with proper (i.e. path-relative) 
> >>source code lookup. By simply passing -foverride-comp-dir=. to gcc
> >>after this feature is patched in, we are able to achieve our goals.
> >
> >Would it be better to simply have a -fno-comp-dir flag, to omit this
> >information entirely from the DWARF output?
> 
> The other motivation for this kind of feature is so that you can ship 
> libraries in both object and source form, and make it easy for users to 
> refer to the source code in the debugger.  You need to make absolute 
> paths into relative ones.  Daniel, does GDB already have the ability to 
> do the substitution?  In other words, does Dan's functionality provide 
> any additional leverage for that use case?

I'm not sure what you're asking.  GDB has the ability to transform a
specified path into another path in source files.  You have to get the
specified path into your objects somehow.  We already know at least one
way to do this (the RPM debugedit tool, which we were talking about
using for our own packages too).  Or you could do it in the compiler,
but then you have to make sure to compile everything with appropriate
flags :-)

-- 
Daniel Jacobowitz
CodeSourcery



More information about the Gcc-patches mailing list