2005-04-02 22:38:09 +00:00
|
|
|
2005-04-02 Andrew Cagney <cagney@gnu.org>
|
|
|
|
|
|
|
|
* symfile.c (separate_debug_file_exists): When the CRCs mismatch
|
|
|
|
print a warning.
|
|
|
|
(find_separate_debug_file): Pass in the objfile's name.
|
|
|
|
|
2008-12-14 14:05:20 +00:00
|
|
|
Index: gdb-6.8.50.20081128/gdb/symfile.c
|
2008-07-14 09:09:04 +00:00
|
|
|
===================================================================
|
2008-12-14 14:05:20 +00:00
|
|
|
--- gdb-6.8.50.20081128.orig/gdb/symfile.c 2008-10-03 18:36:10.000000000 +0200
|
|
|
|
+++ gdb-6.8.50.20081128/gdb/symfile.c 2008-12-01 16:34:36.000000000 +0100
|
|
|
|
@@ -1296,7 +1296,8 @@ get_debug_link_info (struct objfile *obj
|
2005-04-02 22:38:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
-separate_debug_file_exists (const char *name, unsigned long crc)
|
|
|
|
+separate_debug_file_exists (const char *name, unsigned long crc,
|
|
|
|
+ const char *parent_name)
|
|
|
|
{
|
|
|
|
unsigned long file_crc = 0;
|
2008-12-14 14:05:20 +00:00
|
|
|
bfd *abfd;
|
|
|
|
@@ -1316,7 +1317,15 @@ separate_debug_file_exists (const char *
|
2005-04-02 22:38:09 +00:00
|
|
|
|
2008-12-14 14:05:20 +00:00
|
|
|
bfd_close (abfd);
|
2005-04-02 22:38:09 +00:00
|
|
|
|
|
|
|
- return crc == file_crc;
|
|
|
|
+ if (crc != file_crc)
|
|
|
|
+ {
|
|
|
|
+ warning (_("the debug information found in \"%s\""
|
|
|
|
+ " does not match \"%s\" (CRC mismatch).\n"),
|
|
|
|
+ name, parent_name);
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return 1;
|
|
|
|
}
|
|
|
|
|
2008-07-14 09:09:04 +00:00
|
|
|
char *debug_file_directory = NULL;
|
2008-12-14 14:05:20 +00:00
|
|
|
@@ -1368,6 +1377,8 @@ find_separate_debug_file (struct objfile
|
2005-04-02 22:38:09 +00:00
|
|
|
basename = get_debug_link_info (objfile, &crc32);
|
|
|
|
|
|
|
|
if (basename == NULL)
|
|
|
|
+ /* There's no separate debug info, hence there's no way we could
|
|
|
|
+ load it => no warning. */
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
dir = xstrdup (objfile->name);
|
2008-12-14 14:05:20 +00:00
|
|
|
@@ -1395,7 +1406,7 @@ find_separate_debug_file (struct objfile
|
2005-04-02 22:38:09 +00:00
|
|
|
strcpy (debugfile, dir);
|
|
|
|
strcat (debugfile, basename);
|
|
|
|
|
|
|
|
- if (separate_debug_file_exists (debugfile, crc32))
|
|
|
|
+ if (separate_debug_file_exists (debugfile, crc32, objfile->name))
|
|
|
|
{
|
|
|
|
xfree (basename);
|
|
|
|
xfree (dir);
|
2008-12-14 14:05:20 +00:00
|
|
|
@@ -1408,7 +1419,7 @@ find_separate_debug_file (struct objfile
|
2005-04-02 22:38:09 +00:00
|
|
|
strcat (debugfile, "/");
|
|
|
|
strcat (debugfile, basename);
|
|
|
|
|
|
|
|
- if (separate_debug_file_exists (debugfile, crc32))
|
|
|
|
+ if (separate_debug_file_exists (debugfile, crc32, objfile->name))
|
|
|
|
{
|
|
|
|
xfree (basename);
|
|
|
|
xfree (dir);
|
2008-12-14 14:05:20 +00:00
|
|
|
@@ -1421,7 +1432,7 @@ find_separate_debug_file (struct objfile
|
2005-04-02 22:38:09 +00:00
|
|
|
strcat (debugfile, dir);
|
|
|
|
strcat (debugfile, basename);
|
|
|
|
|
|
|
|
- if (separate_debug_file_exists (debugfile, crc32))
|
|
|
|
+ if (separate_debug_file_exists (debugfile, crc32, objfile->name))
|
|
|
|
{
|
|
|
|
xfree (basename);
|
|
|
|
xfree (dir);
|
2008-12-14 14:05:20 +00:00
|
|
|
@@ -1440,7 +1451,7 @@ find_separate_debug_file (struct objfile
|
2007-11-01 20:24:20 +00:00
|
|
|
strcat (debugfile, "/");
|
|
|
|
strcat (debugfile, basename);
|
|
|
|
|
|
|
|
- if (separate_debug_file_exists (debugfile, crc32))
|
|
|
|
+ if (separate_debug_file_exists (debugfile, crc32, objfile->name))
|
|
|
|
{
|
|
|
|
xfree (canon_name);
|
2008-07-14 09:09:04 +00:00
|
|
|
xfree (basename);
|