diff options
author | Tom Tromey <tom@tromey.com> | 2016-09-22 13:47:48 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2016-10-21 14:17:33 -0600 |
commit | 873a915e0ad44cb303b071638536f27569491030 (patch) | |
tree | 6209436a7e32b15b891764df1e5e2738e33a4ec5 /gdb/machoread.c | |
parent | 4b6749b9a4680e79affdb9c02ea2f5ba39a54587 (diff) | |
download | gdb-873a915e0ad44cb303b071638536f27569491030.zip gdb-873a915e0ad44cb303b071638536f27569491030.tar.gz gdb-873a915e0ad44cb303b071638536f27569491030.tar.bz2 |
Introduce minimal_symbol_reader
This patch introduced minimal_symbol_reader, a RAII-based class which
replaces the current make_cleanup_discard_minimal_symbols.
2016-10-21 Tom Tromey <tom@tromey.com>
* xcoffread.c (xcoff_initial_scan): Use
minimal_symbol_reader.
* mipsread.c (mipscoff_symfile_read): Use
minimal_symbol_reader.
* minsyms.h (minimal_symbol_reader): New class.
(init_minimal_symbol_collection)
(make_cleanup_discard_minimal_symbols, install_minimal_symbols):
Don't declare.
* minsyms.c (minimal_symbol_reader): Renamed from
init_minimal_symbol_collection, turned into constructor.
(~minimal_symbol_reader): Renamed from
do_discard_minimal_symbols_cleanup, turned into destructor.
(make_cleanup_discard_minimal_symbols): Remove.
(minimal_symbol_reader::install): Rename form
install_minimal_symbols.
* mdebugread.c (elfmdebug_build_psymtabs): Use
minimal_symbol_reader.
* machoread.c (macho_symfile_read): Use
minimal_symbol_reader.
* elfread.c (elf_read_minimal_symbols): Use
minimal_symbol_reader.
* dbxread.c (dbx_symfile_read): Use minimal_symbol_reader.
* coffread.c (coff_symfile_read): Use
minimal_symbol_reader.
Diffstat (limited to 'gdb/machoread.c')
-rw-r--r-- | gdb/machoread.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/gdb/machoread.c b/gdb/machoread.c index 2eff534..45ae67b 100644 --- a/gdb/machoread.c +++ b/gdb/machoread.c @@ -855,8 +855,7 @@ macho_symfile_read (struct objfile *objfile, int symfile_flags) symbol_table = (asymbol **) xmalloc (storage_needed); make_cleanup (xfree, symbol_table); - init_minimal_symbol_collection (); - make_cleanup_discard_minimal_symbols (); + minimal_symbol_reader reader; symcount = bfd_canonicalize_symtab (objfile->obfd, symbol_table); @@ -867,7 +866,7 @@ macho_symfile_read (struct objfile *objfile, int symfile_flags) macho_symtab_read (objfile, symcount, symbol_table, &oso_vector); - install_minimal_symbols (objfile); + reader.install (objfile); } /* Try to read .eh_frame / .debug_frame. */ |