The use of #line in the testcases in the appended patch is questionable, but as a data point the testcases fail without the patch and pass with the patch. These versions of the testcases have been amended to use substitute-path. ref: pr 2360 http://sourceware.org/ml/gdb/2007-11/msg00138.html http://sourceware.org/ml/gdb-patches/2007-11/msg00314.html Maybe #line + substitute-path fixup isn't supported. Again, this patch is just a data point. Note: This patch contains the rewrite_subfile_path suggestion of my previous email. I don't know whether it helps or hurts the case you're trying to fix.