aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2012-05-11 18:06:28 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2012-05-11 18:06:28 +0000
commitb09aca3aa72db7e4cd8f301984b42bbe3cb319f8 (patch)
tree07d1a8d0e301fa7b4eebe053d792173cdd09c6a7 /gdb
parente04d7088afe0be6ef89900a994bd48bf35d17e77 (diff)
downloadgdb-b09aca3aa72db7e4cd8f301984b42bbe3cb319f8.zip
gdb-b09aca3aa72db7e4cd8f301984b42bbe3cb319f8.tar.gz
gdb-b09aca3aa72db7e4cd8f301984b42bbe3cb319f8.tar.bz2
gdb/
Make auto-load handle multiple components of DEBUG_FILE_DIRECTORY. * auto-load.c (auto_load_objfile_script): Remove check for NULL DEBUG_FILE_DIRECTORY. Handle multiple components of DEBUG_FILE_DIRECTORY.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/auto-load.c30
2 files changed, 28 insertions, 9 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index f79f1ef..e6179bb 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2012-05-11 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ Make auto-load handle multiple components of DEBUG_FILE_DIRECTORY.
+ * auto-load.c (auto_load_objfile_script): Remove check for NULL
+ DEBUG_FILE_DIRECTORY. Handle multiple components of
+ DEBUG_FILE_DIRECTORY.
+
2012-05-10 Tom Tromey <tromey@redhat.com>
* dwarf2read.c (recursively_write_psymbols): New function.
diff --git a/gdb/auto-load.c b/gdb/auto-load.c
index 9d4d0bc..254de3b 100644
--- a/gdb/auto-load.c
+++ b/gdb/auto-load.c
@@ -587,17 +587,29 @@ auto_load_objfile_script (struct objfile *objfile,
input = fopen (filename, "r");
debugfile = filename;
- if (!input && debug_file_directory)
+ if (!input)
{
- /* Also try the same file in the separate debug info directory. */
- debugfile = xmalloc (strlen (filename)
- + strlen (debug_file_directory) + 1);
- strcpy (debugfile, debug_file_directory);
- /* FILENAME is absolute, so we don't need a "/" here. */
- strcat (debugfile, filename);
+ char *debugdir;
+ VEC (char_ptr) *debugdir_vec;
+ int ix;
- make_cleanup (xfree, debugfile);
- input = fopen (debugfile, "r");
+ debugdir_vec = dirnames_to_char_ptr_vec (debug_file_directory);
+ make_cleanup_free_char_ptr_vec (debugdir_vec);
+
+ for (ix = 0; VEC_iterate (char_ptr, debugdir_vec, ix, debugdir); ++ix)
+ {
+ /* Also try the same file in the separate debug info directory. */
+ debugfile = xmalloc (strlen (debugdir) + strlen (filename) + 1);
+ strcpy (debugfile, debugdir);
+
+ /* FILENAME is absolute, so we don't need a "/" here. */
+ strcat (debugfile, filename);
+
+ make_cleanup (xfree, debugfile);
+ input = fopen (debugfile, "r");
+ if (input != NULL)
+ break;
+ }
}
if (!input && gdb_datadir)