binutils-gdb/gdb/compile
Tom Tromey 268e4f0914 Make the objfile destructor private
The idea behind this is that, in the long run, some code will need to
be able to hold onto an objfile after it is unlinked from the program
space.  In particular, this is needed for some functionality to be
moved to worker threads -- otherwise the objfile can be deleted while
still in use.

So, this makes ~objfile private, replacing it with an "unlink" method,
making it more obvious which operation is intended at the calling
points.

gdb/ChangeLog
2019-12-12  Tom Tromey  <tom@tromey.com>

	* symfile.c (syms_from_objfile_1): Use objfile_up.
	(syms_from_objfile_1, remove_symbol_file_command): Call unlink
	method.
	(reread_symbols): Use objfile_up.
	* solib.c (update_solib_list, reload_shared_libraries_1): Call
	unlink method.
	* objfiles.h (struct objfile) <~objfile>: Now private.
	<unlink>: New method.
	(struct objfile_deleter): New.
	(objfile_up): New typedef.
	* objfiles.c (objfile::unlink): New method.
	(free_objfile_separate_debug, free_all_objfiles)
	(objfile_purge_solibs): Use it.
	* jit.c (jit_unregister_code): Remove.
	(jit_inferior_exit_hook, jit_event_handler): Call unlink on
	objfile.
	* compile/compile-object-run.c (do_module_cleanup): Call unlink on
	objfile.
	* compile/compile-object-load.c (compile_object_load): Use
	objfile_up.

Change-Id: I934bee70b26b8b24e1735828fb1e60fe8a05714f
2019-12-12 15:50:52 -07:00
..
compile-c-support.c Move gdb-dlfcn.[ch] to gdbsupport/ 2019-08-23 13:13:18 -04:00
compile-c-symbols.c Replace SYMBOL_*_NAME accessors with member functions 2019-11-22 12:05:14 -06:00
compile-c-types.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
compile-c.h Rename common to gdbsupport 2019-07-09 07:45:38 -06:00
compile-cplus-symbols.c Replace SYMBOL_*_NAME accessors with member functions 2019-11-22 12:05:14 -06:00
compile-cplus-types.c Replace SYMBOL_*_NAME accessors with member functions 2019-11-22 12:05:14 -06:00
compile-cplus.h Don't include gdbarch.h from defs.h 2019-07-10 14:53:53 -06:00
compile-internal.h Change boolean options to bool instead of int 2019-09-18 09:35:12 +09:00
compile-loc2c.c Replace SYMBOL_*_NAME accessors with member functions 2019-11-22 12:05:14 -06:00
compile-object-load.c Make the objfile destructor private 2019-12-12 15:50:52 -07:00
compile-object-load.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
compile-object-run.c Make the objfile destructor private 2019-12-12 15:50:52 -07:00
compile-object-run.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
compile.c Change gcc_target_options to return std::string 2019-10-15 11:03:57 -06:00
compile.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
gcc-c-plugin.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00
gcc-cp-plugin.h Normalize include guards in gdb 2019-02-07 03:27:23 -07:00