This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] add -foverride-comp-dir
- From: Daniel Jacobowitz <drow at false dot org>
- To: Mark Mitchell <mark at codesourcery dot com>
- Cc: Geoffrey Keating <geoffk at apple dot com>, Dan Aloni <da-x at monatomic dot org>, gcc-patches at gcc dot gnu dot org
- Date: Sun, 1 Oct 2006 19:27:46 -0400
- Subject: Re: [PATCH] add -foverride-comp-dir
- References: <20060926135209.GA3599@localdomain> <firstname.lastname@example.org> <45201FAF.email@example.com>
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