title: Using -ffile-prefix-map breaks debugging
body: <p>At $DAYJOB, I am trying to implement reproducible builds to make debugging released software where we no longer have the full debug versions on our build servers easier, using the tips from <a href="https://reproducible-builds.org" rel="nofollow noreferrer">reproducible-builds.org</a>.</p>
  <p>Using the <a href="https://stackoverflow.com/a/53848526">-ffile-prefix-map=/path/to/build=src</a> option in GCC to <a href="https://reproducible-builds.org/docs/build-path/" rel="nofollow noreferrer">avoid leaking internal file paths</a> does help making some error messages cleaner, but does produce problems when using GDB. I am in /path/to/build/some/binary/ and hitting a breakpoint in /path/to/build/lib/cclib/:</p>
  <pre><code>Breakpoint 1, [...]
  at src/lib/cclib/eventloop.cc:154
  154    src/lib/cclib/eventloop.cc: No such file or directory.
  (gdb)
  </code></pre>
  <p>As a workaround, I can symlink <code>src</code> to the root of the build tree, but is there a better way to make sure gdb understands the mapping?</p>