2009-10-12 Tristan Gingold <gingold@adacore.com>
authorTristan Gingold <gingold@adacore.com>
Tue, 13 Oct 2009 07:56:29 +0000 (07:56 +0000)
committerTristan Gingold <gingold@adacore.com>
Tue, 13 Oct 2009 07:56:29 +0000 (07:56 +0000)
* objfiles.c (objfile_has_symbols): New function.
* objfiles.h (objfile_has_symbols): Add prototype.
* symfile.c (symbol_file_add_with_addrs_or_offsets): Call
objfile_has_symbols.
(reread_symbols): Ditto.

gdb/ChangeLog
gdb/objfiles.c
gdb/objfiles.h
gdb/symfile.c

index dab0eca..f9bcc1b 100644 (file)
@@ -1,3 +1,11 @@
+2009-10-13  Tristan Gingold  <gingold@adacore.com>
+
+       * objfiles.c (objfile_has_symbols): New function.
+       * objfiles.h (objfile_has_symbols): Add prototype.
+       * symfile.c (symbol_file_add_with_addrs_or_offsets): Call
+       objfile_has_symbols.
+       (reread_symbols): Ditto.
+
 2009-10-12  Jiang Jilin  <freephp@gmail.com>
 
        * i386-tdep.c (i386_process_record): Add xgetbv/xsetbv
index 8dcca70..3aabc7c 100644 (file)
@@ -717,6 +717,30 @@ objfile_has_full_symbols (struct objfile *objfile)
   return objfile->symtabs != NULL;
 }
 
+/* Return non-zero if OBJFILE has full or partial symbols, either directly
+   or throught its separate debug file.  */
+
+int
+objfile_has_symbols (struct objfile *objfile)
+{
+  struct objfile *separate_objfile;
+
+  if (objfile_has_partial_symbols (objfile)
+      || objfile_has_full_symbols (objfile))
+    return 1;
+
+  separate_objfile = objfile->separate_debug_objfile;
+  if (separate_objfile == NULL)
+    return 0;
+
+  if (objfile_has_partial_symbols (separate_objfile)
+      || objfile_has_full_symbols (separate_objfile))
+    return 1;
+
+  return 0;
+}
+
+
 /* Many places in gdb want to test just to see if we have any partial
    symbols available.  This function returns zero if none are currently
    available, nonzero otherwise. */
index 62fa498..aff430c 100644 (file)
@@ -476,6 +476,8 @@ extern int objfile_has_partial_symbols (struct objfile *objfile);
 
 extern int objfile_has_full_symbols (struct objfile *objfile);
 
+extern int objfile_has_symbols (struct objfile *objfile);
+
 extern int have_partial_symbols (void);
 
 extern int have_full_symbols (void);
index 2458201..3fd8c6d 100644 (file)
@@ -1040,8 +1040,7 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd,
     }
 
   if ((from_tty || info_verbose)
-      && !objfile_has_partial_symbols (objfile)
-      && !objfile_has_full_symbols (objfile))
+      && !objfile_has_symbols (objfile))
     {
       wrap_here ("");
       printf_unfiltered (_("(no debugging symbols found)..."));
@@ -2422,8 +2421,7 @@ reread_symbols (void)
                 zero is OK since dbxread.c also does what it needs to do if
                 objfile->global_psymbols.size is 0.  */
              (*objfile->sf->sym_read) (objfile, 0);
-             if (!objfile_has_partial_symbols (objfile)
-                 && !objfile_has_full_symbols (objfile))
+             if (!objfile_has_symbols (objfile))
                {
                  wrap_here ("");
                  printf_unfiltered (_("(no debugging symbols found)\n"));