[distcc] Re: Distcc & GDB (fix)

Martin Pool mbp at sourcefrog.net
Sun May 11 04:05:48 GMT 2003


On 10 May 2003, Alexandre Oliva <oliva at lsd.ic.unicamp.br> wrote:

> Please note that embedding the pwd of the preprocessor/compiler in the
> object file *is* the right thing to do: a number of debugging info
> formats have a well-defined location for this information, and this is
> exactly what enables the debugger to find the source file even after
> the executable is installed.

Right.

The main problem with just passing the absolute filename to the
preprocessor (or with timj's patch) is that it loses information about
the location of the source file relative to the root of the
compilation directory.  So if a tree with more than one directory is
moved, you can't give a single 'dir' command to find all of the files
in gdb.  (I suppose gdb could be enhanced to search variations and
combinations based on the search path and debug source filename.)

> Martin, one thing that the preprocessor maintainers have been
> proposing to me is to require an additional flag in order to enable
> this patch [...] How do you feel about
> having distcc implicitly pass such a flag to GCC?  Or should this be
> just a documentation issue, e.g., if you run ccache/distcc/wahtever
> with GCC, make sure you pass these flags to GCC (starting at some
> future release) otherwise it won't get output identical to what you'd
> get with local compilation with the integrated preprocessor.

I'd prefer the second, because it would be hard for distcc to know
when it ought to pass that flag -- it would depend on knowing the gcc
version, which at the moment we don't. 

If you could get the "right" pwd into the debug info by passing
-frich-preprocessor (or something), then I think that would be ideal.
It is not too much of a burden for the distcc manual to ask people to
set that flag.  Perhaps it could become the default in say gcc 4.x.

> and the other that enriches the preprocessed output such that GCC
> knows the correct location of all tokens in the input stream, like
> it does with the integrated preprocessor.

Sorry, can you explain this a bit more?

--
Martin


More information about the distcc mailing list