[distcc] Distcc & GDB (fix)

Thomas Walker Thomas.Walker at morganstanley.com
Fri May 9 15:26:55 GMT 2003


I've been spending a bit of time playing around with distcc and gdb
trying to figure out a workaround for the source directory mangling that
is caused by gcc's reluctance to record the source directory when
running cpp (it instead decides to use the pwd when cc1 runs, which for
distcc is /var/tmp and rather useless).  It turns out that if you
specify the full path to your source files when compiling (e.g. distcc
gcc -g -o foo -c /some/dir/foo.c) then this forces cpp to include the
full path to the .c file in the .i (rather than simply the filename).
cc1 then picks up on this and embeds the proper source directory into
the .debug section of the resulting elf binaries.  This is not an
elegant solution as it requires rewriting of makefiles but it actually
works!
Alexandre, you had mentioned that you had, at some point, passed a patch
to fix this behaviour (I'm assuming it caused cpp to always include the
full path to source in the .i files, which makes sense because cpp is
the only part of the compiler that is guarenteed to actually know where
they are) but that the preprocessor guys had been reluctant to include
it (or admit it as a bug).  Do you happen to still have a copy of this
patch lying around?  I recently brought the issue to the attention of
our Enterprise Support rep at Redhat and he seemed to think that he
could help with getting the patch pushed through (it helps being a
really big client I guess :)  I've already filed a bug report with
Enterprise support but things would likely move faster if I had a patch
handy (even if for an out of date version) rather than having to find
the time to generate a patch myself...

Thanks,

Tom.

--
NOTICE: If received in error, please destroy and notify sender.  Sender
does not waive confidentiality or privilege, and use is prohibited.




More information about the distcc mailing list