This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Search debugfile directly in debug-file-directory if specified


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);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]