gdb/
[deliverable/binutils-gdb.git] / gdb / symfile.c
index 3fd8c6d4a55f7d46b549f881e633400e69ff3e38..75cb0f8e999b6b1c38c263dd4cbbbf52db305a49 100644 (file)
@@ -1283,7 +1283,8 @@ get_debug_link_info (struct objfile *objfile, unsigned long *crc32_out)
 }
 
 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;
@@ -1303,7 +1304,15 @@ separate_debug_file_exists (const char *name, unsigned long crc)
 
   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;
@@ -1355,6 +1364,8 @@ find_separate_debug_file (struct objfile *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);
@@ -1388,7 +1399,7 @@ find_separate_debug_file (struct objfile *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);
@@ -1402,7 +1413,7 @@ find_separate_debug_file (struct objfile *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);
@@ -1416,7 +1427,7 @@ find_separate_debug_file (struct objfile *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);
@@ -1435,7 +1446,7 @@ find_separate_debug_file (struct objfile *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);
@@ -2807,7 +2818,7 @@ clear_symtab_users (void)
 
   clear_displays ();
   breakpoint_re_set ();
-  set_default_breakpoint (0, 0, 0, 0);
+  set_default_breakpoint (0, NULL, 0, 0, 0);
   clear_pc_function_cache ();
   observer_notify_new_objfile (NULL);
 
This page took 0.039699 seconds and 4 git commands to generate.