mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-02 19:46:09 +08:00
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
This commit is contained in:
@ -632,9 +632,9 @@ compile_object_load (const compile_file_names &file_names,
|
||||
|
||||
/* SYMFILE_VERBOSE is not passed even if FROM_TTY, user is not interested in
|
||||
"Reading symbols from ..." message for automatically generated file. */
|
||||
std::unique_ptr<struct objfile> objfile_holder
|
||||
(symbol_file_add_from_bfd (abfd.get (), filename.get (),
|
||||
0, NULL, 0, NULL));
|
||||
objfile_up objfile_holder (symbol_file_add_from_bfd (abfd.get (),
|
||||
filename.get (),
|
||||
0, NULL, 0, NULL));
|
||||
objfile = objfile_holder.get ();
|
||||
|
||||
func_sym = lookup_global_symbol_from_objfile (objfile,
|
||||
|
Reference in New Issue
Block a user