Change minimal_symbol_reader to store objfile

This changes minimal_symbol_reader to require the objfile to be
passed to the constructor.  The class now records the objfile and
automatically uses it later in "install".

This is a minor cleanup that will come in useful in the next patch.
It is separate from the first patch to keep that one a bit simpler to
understand.

2016-10-21  Tom Tromey  <tom@tromey.com>

	* xcoffread.c (xcoff_initial_scan): Update.
	* mipsread.c (mipscoff_symfile_read): Update.
	* minsyms.c (minimal_symbol_reader): Add obj argument.
	Initialize member.
	(install): Remove objfile argument.  Update.
	* mdebugread.c (elfmdebug_build_psymtabs): Update.
	* machoread.c (macho_symfile_read): Update.
	* elfread.c (elf_read_minimal_symbols): Update.
	* dbxread.c (dbx_symfile_read): Update.
	* coffread.c (coff_symfile_read): Update.
	* minsyms.h (minimal_symbol_reader): Add m_objfile member.
	(constructor): Add objfile argument.
	(minimal_symbol_reader::install): Remove objfile argument.
This commit is contained in:
Tom Tromey
2016-09-22 13:57:15 -06:00
parent 873a915e0a
commit d25e871993
10 changed files with 52 additions and 33 deletions

View File

@@ -4875,7 +4875,7 @@ elfmdebug_build_psymtabs (struct objfile *objfile,
information from .mdebug in an ELF file, or whether we will.
Re-initialize the minimal symbol reader in case we do. */
minimal_symbol_reader reader;
minimal_symbol_reader reader (objfile);
info = ((struct ecoff_debug_info *)
obstack_alloc (&objfile->objfile_obstack,
@@ -4887,7 +4887,7 @@ elfmdebug_build_psymtabs (struct objfile *objfile,
mdebug_build_psymtabs (objfile, swap, info);
reader.install (objfile);
reader.install ();
}
void