aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2003-10-29 18:29:07 +0000
committerMark Kettenis <kettenis@gnu.org>2003-10-29 18:29:07 +0000
commit7b097ae3929cc0a113d185397fff442217b2365b (patch)
tree48652e518cb65f2f22e748b85766af31ea541a98 /gdb
parent83aeabb6ddcb906b8eb17b4aadbb9a89882bcef0 (diff)
downloadgdb-7b097ae3929cc0a113d185397fff442217b2365b.zip
gdb-7b097ae3929cc0a113d185397fff442217b2365b.tar.gz
gdb-7b097ae3929cc0a113d185397fff442217b2365b.tar.bz2
* objfiles.h (clear_objfile_data): New prototype.
* objfiles.c (clear_objfile_data): New function. * symfile.c (reread_symbols): Clear per-objfile data.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/objfiles.c7
-rw-r--r--gdb/objfiles.h1
-rw-r--r--gdb/symfile.c1
4 files changed, 15 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e52728f..0588d65 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2003-10-29 Mark Kettenis <kettenis@gnu.org>
+
+ * objfiles.h (clear_objfile_data): New prototype.
+ * objfiles.c (clear_objfile_data): New function.
+ * symfile.c (reread_symbols): Clear per-objfile data.
+
2003-10-28 Jeff Johnston <jjohnstn@redhat.com>
* symfile.c (symbol_file_add_with_addrs_or_offsets): Switch to use
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index 1321b82..9a181f4 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -1166,6 +1166,13 @@ objfile_free_data (struct objfile *objfile)
}
void
+clear_objfile_data (struct objfile *objfile)
+{
+ gdb_assert (objfile->data != NULL);
+ memset (objfile->data, 0, objfile->num_data * sizeof (void *));
+}
+
+void
set_objfile_data (struct objfile *objfile, const struct objfile_data *data,
void *value)
{
diff --git a/gdb/objfiles.h b/gdb/objfiles.h
index fe54f6d..6887dca 100644
--- a/gdb/objfiles.h
+++ b/gdb/objfiles.h
@@ -599,6 +599,7 @@ extern int is_in_import_list (char *, struct objfile *);
modules. */
extern const struct objfile_data *register_objfile_data (void);
+extern void clear_objfile_data (struct objfile *objfile);
extern void set_objfile_data (struct objfile *objfile,
const struct objfile_data *data, void *value);
extern void *objfile_data (struct objfile *objfile,
diff --git a/gdb/symfile.c b/gdb/symfile.c
index caea160..6835284 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -1969,6 +1969,7 @@ reread_symbols (void)
memset (&objfile->msymbol_demangled_hash, 0,
sizeof (objfile->msymbol_demangled_hash));
objfile->fundamental_types = NULL;
+ clear_objfile_data (objfile);
if (objfile->sf != NULL)
{
(*objfile->sf->sym_finish) (objfile);