diff options
author | Tom Tromey <tromey@redhat.com> | 2012-08-22 16:01:09 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2012-08-22 16:01:09 +0000 |
commit | 706e37059fbfed5beb9fe02921483809dfd86e5b (patch) | |
tree | d604042d166fc7545502657f9171d6210f4acc9e /gdb/objfiles.h | |
parent | e992eda4f6cece4cccbad807b1307168de924174 (diff) | |
download | gdb-706e37059fbfed5beb9fe02921483809dfd86e5b.zip gdb-706e37059fbfed5beb9fe02921483809dfd86e5b.tar.gz gdb-706e37059fbfed5beb9fe02921483809dfd86e5b.tar.bz2 |
* elfread.c (elf_symtab_read): Update.
* objfiles.c (objfiles_bfd_data): New global.
(get_objfile_bfd_data, free_objfile_per_bfd_storage)
(objfile_bfd_data_free, set_objfile_per_bfd): New functions.
(allocate_objfile, free_objfile): Update.
(_initialize_objfiles): Initialize objfiles_bfd_data.
* objfiles.h (struct objfile_per_bfd_storage): New.
(struct objfile) <per_bfd>: New field.
<filename_cache>: Remove.
(set_objfile_per_bfd): Declare.
* symfile.c (reread_symbols): Update. Call
set_objfile_per_bfd.
(allocate_symtab): Update.
* symmisc.c (print_symbol_bcache_statistics): Update.
(print_objfile_statistics): Print the size of the BFD obstack.
gdb/testsuite
* gdb.base/maint.exp: Update.
Diffstat (limited to 'gdb/objfiles.h')
-rw-r--r-- | gdb/objfiles.h | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/gdb/objfiles.h b/gdb/objfiles.h index 097f4db..2b95ce4 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -160,6 +160,22 @@ extern void print_symbol_bcache_statistics (void); /* Number of entries in the minimal symbol hash table. */ #define MINIMAL_SYMBOL_HASH_SIZE 2039 +/* Some objfile data is hung off the BFD. This enables sharing of the + data across all objfiles using the BFD. The data is stored in an + instance of this structure, and associated with the BFD using the + registry system. */ + +struct objfile_per_bfd_storage +{ + /* The storage has an obstack of its own. */ + + struct obstack storage_obstack; + + /* Byte cache for file names. */ + + struct bcache *filename_cache; +}; + /* Master structure for keeping track of each file from which gdb reads symbols. There are several ways these get allocated: 1. The main symbol file, symfile_objfile, set by the symbol-file command, @@ -222,6 +238,11 @@ struct objfile bfd *obfd; + /* The per-BFD data. Note that this is treated specially if OBFD + is NULL. */ + + struct objfile_per_bfd_storage *per_bfd; + /* The gdbarch associated with the BFD. Note that this gdbarch is determined solely from BFD information, without looking at target information. The gdbarch determined from a running target may @@ -249,7 +270,6 @@ struct objfile struct psymbol_bcache *psymbol_cache; /* Byte cache for partial syms. */ struct bcache *macro_cache; /* Byte cache for macros. */ - struct bcache *filename_cache; /* Byte cache for file names. */ /* Hash table for mapping symbol names to demangled names. Each entry in the hash table is actually two consecutive strings, @@ -649,4 +669,8 @@ extern void default_iterate_over_objfiles_in_search_order #define MULTI_OBJFILE_P() (object_files && object_files->next) +/* Reset the per-BFD storage area on OBJ. */ + +void set_objfile_per_bfd (struct objfile *obj); + #endif /* !defined (OBJFILES_H) */ |