[ccache] Stumbling blocks with ccache and embedded/encapsulated environments

Paul Smith paul at mad-scientist.net
Thu Dec 2 11:26:48 MST 2010

On Wed, 2010-12-01 at 21:47 -0500, Paul Smith wrote:
> Now I'm on to my next problem.  In order to get this to happen I have
> to set CCACHE_BASEDIR to strip off the workspace directory prefix, so
> that the per-workspace filenames are not embedded in the cache.  This
> works (see above), however the result is not so nice.

Ugh.  I lied.  Actually GDB handles this just fine with no special
instruction; I had a problem on my test server (and then I misunderstood
how the GDB substitute-path feature worked).

This works because GDB remembers not only the path of the source file,
but also the working directory when the compile happened:

        (gdb) info source
        Current source file is ../../../src/subdir/foo/foo.c
        Compilation directory is /path/to/ONE/obj/subdir/foo
        Source language is c.
        Compiled with DWARF 2 debugging format.
        Does not include preprocessor macro info.

So GDB intelligently notices that the source file path is relative and
appends it to the compilation directory, and viola! [1]

I _think_ I'm all set now.  I'll check back if more issues surface.


[1] sic

More information about the ccache mailing list