aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/symfile.c10
2 files changed, 12 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 23503ae..3ec0d95 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2019-01-02 Andrey Utkin <autkin@undo.io>
+
+ * symfile.c (find_separate_debug_file): Fix search of debug files for
+ remote debuggee.
+
2019-01-02 Tom Tromey <tom@tromey.com>
* python/py-inferior.c (gdbpy_initialize_inferior): Fix
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 259b272..8858098 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -1433,14 +1433,17 @@ find_separate_debug_file (const char *dir,
Keep backward compatibility so that DEBUG_FILE_DIRECTORY being "" will
cause "/..." lookups. */
+ bool target_prefix = startswith (dir, "target:");
+ const char *dir_notarget = target_prefix ? dir + strlen ("target:") : dir;
std::vector<gdb::unique_xmalloc_ptr<char>> debugdir_vec
= dirnames_to_char_ptr_vec (debug_file_directory);
for (const gdb::unique_xmalloc_ptr<char> &debugdir : debugdir_vec)
{
- debugfile = debugdir.get ();
+ debugfile = target_prefix ? "target:" : "";
+ debugfile += debugdir.get ();
debugfile += "/";
- debugfile += dir;
+ debugfile += dir_notarget;
debugfile += debuglink;
if (separate_debug_file_exists (debugfile, crc32, objfile))
@@ -1453,7 +1456,8 @@ find_separate_debug_file (const char *dir,
strlen (gdb_sysroot)) == 0
&& IS_DIR_SEPARATOR (canon_dir[strlen (gdb_sysroot)]))
{
- debugfile = debugdir.get ();
+ debugfile = target_prefix ? "target:" : "";
+ debugfile += debugdir.get ();
debugfile += (canon_dir + strlen (gdb_sysroot));
debugfile += "/";
debugfile += debuglink;