How to make gdb to use different directory to look for source files.
For example my source file during the compilation was in directory:
/home/foo/bar.c
set substitute-path /home/foo /tmp/debug/home/foo
http://sourceware.org/gdb/current/onlinedocs/gdb/Source-Path.html#index-set-substitute_002dpath