[distcc] distcc and gdb incompatibility (not mentioned in the manual)

Martin Pool mbp at samba.org
Thu Feb 6 23:32:18 GMT 2003

On  6 Feb 2003, "Giles, Lezz" <lgiles at starentnetworks.com> wrote:
> When I normally compile a file it stores the pathname given to the compiler
> and the current working directory - then if I'm debugging using gdb in
> another directory, gdb is clever enough to combine these two to find the
> source file.  The problem is that when we use distcc, the current directory
> is always whereever the daemon was kicked off (normally /), and so gdb
> cannot find source files automatically.
> Of course, the workaround is to use dir to tell gdb where to find sources,
> but this should be at least noted in the user manual.  I'm not sure if there's
> any way to fix it to put in the correct path.

Thanks for reporting this, but it's already known:



I guess it should be in the manual too since it may not go away soon.

It's been extensively discussed on the list; see the archive.

You can try Tim Janik's patch which makes all source filenames
absolute, but that introduces other problems:


Or just change your makefile to pass absolute names to distcc.

Or use the 'directory' command in gdb to find the source.

Or politely ask the gcc people to fix this bug. 


More information about the distcc mailing list