aboutsummaryrefslogtreecommitdiff
path: root/gdb/objfiles.c
diff options
context:
space:
mode:
authorTristan Gingold <gingold@adacore.com>2009-10-13 07:56:29 +0000
committerTristan Gingold <gingold@adacore.com>2009-10-13 07:56:29 +0000
commite361b228f21dbaaacbeb3b0813ec57d0d6b6cb94 (patch)
treec848e404b41d9376d7f1cfcbed0a6e97a513eadf /gdb/objfiles.c
parentfc3e1e3c7e5d81ec71176b7015e1f0b5d81d751f (diff)
downloadgdb-e361b228f21dbaaacbeb3b0813ec57d0d6b6cb94.zip
gdb-e361b228f21dbaaacbeb3b0813ec57d0d6b6cb94.tar.gz
gdb-e361b228f21dbaaacbeb3b0813ec57d0d6b6cb94.tar.bz2
2009-10-12 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.
Diffstat (limited to 'gdb/objfiles.c')
-rw-r--r--gdb/objfiles.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index 8dcca70..3aabc7c 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -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. */