aboutsummaryrefslogtreecommitdiff
path: root/gdb/objfiles.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2009-11-05 22:26:10 +0000
committerTom Tromey <tromey@redhat.com>2009-11-05 22:26:10 +0000
commit10abe6bf36363fc8004785a70e350f013bd02c4a (patch)
treeb6f02b801de93a1af23a10b411a7ead5c618483f /gdb/objfiles.c
parent69a943f00538328c36e1d1005f5357a61a71c7fc (diff)
downloadgdb-10abe6bf36363fc8004785a70e350f013bd02c4a.zip
gdb-10abe6bf36363fc8004785a70e350f013bd02c4a.tar.gz
gdb-10abe6bf36363fc8004785a70e350f013bd02c4a.tar.bz2
* symmisc.c (print_symbol_bcache_statistics): Print filename cache
statistics. (print_objfile_statistics): Likewise. * symfile.c (reread_symbols): Initialize filename_cache. (allocate_symtab): Cache the file name. (allocate_psymtab): Likewise. * solib-sunos.c (allocate_rt_common_objfile): Initialize filename_cache. * objfiles.h (struct objfile) <filename_cache>: New field. * objfiles.c (allocate_objfile): Initialize filename_cache. (free_objfile): Free filename_cache.
Diffstat (limited to 'gdb/objfiles.c')
-rw-r--r--gdb/objfiles.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index 0425d7a..48f2613 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -199,6 +199,7 @@ allocate_objfile (bfd *abfd, int flags)
objfile = (struct objfile *) xzalloc (sizeof (struct objfile));
objfile->psymbol_cache = bcache_xmalloc ();
objfile->macro_cache = bcache_xmalloc ();
+ objfile->filename_cache = bcache_xmalloc ();
/* We could use obstack_specify_allocation here instead, but
gdb_obstack.h specifies the alloc/dealloc functions. */
obstack_init (&objfile->objfile_obstack);
@@ -561,6 +562,7 @@ free_objfile (struct objfile *objfile)
/* Free the obstacks for non-reusable objfiles */
bcache_xfree (objfile->psymbol_cache);
bcache_xfree (objfile->macro_cache);
+ bcache_xfree (objfile->filename_cache);
if (objfile->demangled_names_hash)
htab_delete (objfile->demangled_names_hash);
obstack_free (&objfile->objfile_obstack, 0);