title: GDB source path
body: <p>How to make gdb to use different directory to look for source files.</p>
  
  <p>For example my source file during the compilation was in directory:</p>
  
  <pre><code>/home/foo/bar.c
  </code></pre>
  
  <p>Next, I moved it into directory:</p>
  
  <pre><code>/tmp/debug/home/foo/bar.c
  </code></pre>
  
  <p>How to enforce gdb to search in this directory? 
  According to <a href="https://sourceware.org/gdb/onlinedocs/gdb/Source-Path.html" rel="noreferrer">this site</a> I should just use command:</p>
  
  <pre><code>dir /tmp/debug/
  </code></pre>
  
  <p>But it is not working. I get a message <code>foo.c: "No such file or directory"</code> from gdb.</p>