This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Search debugfile directly in debug-file-directory if specified
- From: Mateusz Tabaka <8tab at wp dot pl>
- To: gdb-patches at sourceware dot org
- Date: Wed, 09 Apr 2014 22:27:52 +0200
- Subject: Search debugfile directly in debug-file-directory if specified
- Authentication-results: sourceware.org; auth=none
Hi, When I set debug-file-directory, searching for debuglink doesn't
work when it is located directly in that directory
(<debug-file-directory>/debuglink). This patch fixes this issue.
Thanks,
Mateusz.
ChangeLog:
2014-04-09 Mateusz Tabaka <8tab@wp.pl>
* symfile.c: search debugfile directly in debug-file-directory
if specified
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 64a83c6..559ca95 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -1534,6 +1534,17 @@ find_separate_debug_file (const char *dir,
return debugfile;
}
}
+ /* If debugfile doesn't exists in all of above paths,
+ try "<debug-file-directory>/<debuglink>" */
+ strcpy (debugfile, debugdir);
+ strcat (debugfile, "/");
+ strcat (debugfile, debuglink);
+
+ if (separate_debug_file_exists (debugfile, crc32, objfile))
+ {
+ do_cleanups (back_to);
+ return debugfile;
+ }
}
do_cleanups (back_to);