diff options
author | Tom Tromey <tom@tromey.com> | 2019-03-02 12:11:26 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2019-03-15 16:02:09 -0600 |
commit | d6797f465c3f67b41a0db38870bbd33384b6551f (patch) | |
tree | 170543bd51da158cd4fd08805038d8973e9e6b1c /gdb/objfiles.h | |
parent | 741d7538b7540fea1086fe6ab962227d2cf7418e (diff) | |
download | gdb-d6797f465c3f67b41a0db38870bbd33384b6551f.zip gdb-d6797f465c3f67b41a0db38870bbd33384b6551f.tar.gz gdb-d6797f465c3f67b41a0db38870bbd33384b6551f.tar.bz2 |
Simplify per-BFD storage management
There's no reason that the objfile_per_bfd_storage must be allocated
via bfd_alloc. This patch changes objfile_per_bfd_storage to be
managed more simply, via ordinary new and delete; and moves some code
into its (new) destructor.
While doing this I also noticed an extra initialization of
language_of_main, and removed it.
gdb/ChangeLog
2019-03-15 Tom Tromey <tom@tromey.com>
* objfiles.h (struct objfile_per_bfd_storage): Declare
destructor.
* objfiles.c (objfile_per_bfd_storage::~objfile_per_bfd_storage):
New.
(get_objfile_bfd_data): Use new. Don't initialize
language_of_main.
(free_objfile_per_bfd_storage): Remove.
(objfile_bfd_data_free, objfile::~objfile): Use delete.
Diffstat (limited to 'gdb/objfiles.h')
-rw-r--r-- | gdb/objfiles.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gdb/objfiles.h b/gdb/objfiles.h index 47df002..6f8eb7f 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -235,6 +235,8 @@ struct objfile_per_bfd_storage : minsyms_read (false) {} + ~objfile_per_bfd_storage (); + /* The storage has an obstack of its own. */ auto_obstack storage_obstack; |