gdb/gdb-6.3-sepcrc-20050402.patch

83 lines
2.6 KiB
Diff

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.
Index: gdb-6.8.50.20081128/gdb/symfile.c
===================================================================
--- 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
}
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;
bfd *abfd;
@@ -1316,7 +1317,15 @@ separate_debug_file_exists (const char *
bfd_close (abfd);
- 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;
}
char *debug_file_directory = NULL;
@@ -1368,6 +1377,8 @@ find_separate_debug_file (struct objfile
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);
@@ -1395,7 +1406,7 @@ find_separate_debug_file (struct objfile
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);
@@ -1408,7 +1419,7 @@ find_separate_debug_file (struct objfile
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);
@@ -1421,7 +1432,7 @@ find_separate_debug_file (struct objfile
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);
@@ -1440,7 +1451,7 @@ find_separate_debug_file (struct objfile
strcat (debugfile, "/");
strcat (debugfile, basename);
- if (separate_debug_file_exists (debugfile, crc32))
+ if (separate_debug_file_exists (debugfile, crc32, objfile->name))
{
xfree (canon_name);
xfree (basename);