diff options
author | Tom Tromey <tromey@redhat.com> | 2009-11-05 22:26:10 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2009-11-05 22:26:10 +0000 |
commit | 10abe6bf36363fc8004785a70e350f013bd02c4a (patch) | |
tree | b6f02b801de93a1af23a10b411a7ead5c618483f /gdb/symfile.c | |
parent | 69a943f00538328c36e1d1005f5357a61a71c7fc (diff) | |
download | gdb-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/symfile.c')
-rw-r--r-- | gdb/symfile.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gdb/symfile.c b/gdb/symfile.c index 117f17f..5ce20a6 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -2402,6 +2402,8 @@ reread_symbols (void) objfile->psymbol_cache = bcache_xmalloc (); bcache_xfree (objfile->macro_cache); objfile->macro_cache = bcache_xmalloc (); + bcache_xfree (objfile->filename_cache); + objfile->filename_cache = bcache_xmalloc (); if (objfile->demangled_names_hash != NULL) { htab_delete (objfile->demangled_names_hash); @@ -2424,6 +2426,7 @@ reread_symbols (void) objfile->psymbol_cache = bcache_xmalloc (); objfile->macro_cache = bcache_xmalloc (); + objfile->filename_cache = bcache_xmalloc (); /* obstack_init also initializes the obstack so it is empty. We could use obstack_specify_allocation but gdb_obstack.h specifies the alloc/dealloc @@ -2746,8 +2749,8 @@ allocate_symtab (char *filename, struct objfile *objfile) symtab = (struct symtab *) obstack_alloc (&objfile->objfile_obstack, sizeof (struct symtab)); memset (symtab, 0, sizeof (*symtab)); - symtab->filename = obsavestring (filename, strlen (filename), - &objfile->objfile_obstack); + symtab->filename = (char *) bcache (filename, strlen (filename) + 1, + objfile->filename_cache); symtab->fullname = NULL; symtab->language = deduce_language_from_filename (filename); symtab->debugformat = "unknown"; @@ -2777,8 +2780,8 @@ allocate_psymtab (char *filename, struct objfile *objfile) sizeof (struct partial_symtab)); memset (psymtab, 0, sizeof (struct partial_symtab)); - psymtab->filename = obsavestring (filename, strlen (filename), - &objfile->objfile_obstack); + psymtab->filename = (char *) bcache (filename, strlen (filename) + 1, + objfile->filename_cache); psymtab->symtab = NULL; /* Prepend it to the psymtab list for the objfile it belongs to. |