Fix lookup of separate debug file on MS-Windows.
authorEli Zaretskii <eliz@gnu.org>
Fri, 3 May 2019 07:29:59 +0000 (10:29 +0300)
committerEli Zaretskii <eliz@gnu.org>
Fri, 3 May 2019 07:34:56 +0000 (10:34 +0300)
commit661f388860346b3747b3b76479f2a784f3b8e9da
treebf9888ad5e59accd16fc89027419e47661f80977
parent35f7673945a9c30fca33d981afdcd42f6fd73a6b
Fix lookup of separate debug file on MS-Windows.

If you put the separate debug file in a global debug directory, GDB on
MS-Windows would fail to find it.  This happens because we obtain the
directory to look up the debug file by concatenating the debug
directory name with the leading directories of the executable, and the
latter includes the drive letter on MS-Windows.  So we get an invalid
file name like

   d:/usr/lib/debug/d:/usr/bin/foo.debug

This commit fixes that by removing the colon of the drive letter,
thus producing

   d:/usr/lib/debug/d/usr/bin/foo.debug

gdb/ChangeLog:
2019-05-03  Eli Zaretskii  <eliz@gnu.org>

* symfile.c (find_separate_debug_file): Remove colon from the
drive spec of DOS/Windows file names of the target, so that the
file name produced from DEBUGDIR and the target's directory will
be valid on DOS/Windows systems.

gdb/doc/ChangeLog:
2019-05-03  Eli Zaretskii  <eliz@gnu.org>

* gdb.texinfo (Separate Debug Files): Document how the
subdirectory of the global debug directory is computed on
MS-Windows/MS-DOS.

(cherry picked from commit 5f2459c233faebe8f882e556b2f4a86594a51292)
gdb/ChangeLog
gdb/doc/ChangeLog
gdb/doc/gdb.texinfo
gdb/symfile.c