Change program_space::ebfd to a gdb_bfd_ref_ptr

This changes program_space::ebfd to a gdb_bfd_ref_ptr, removing some
manual management.

gdb/ChangeLog
2020-10-29  Tom Tromey  <tom@tromey.com>

	* exec.c (exec_file_attach): Update.
	* progspace.c (program_space::exec_close): Update.
	* progspace.h (struct program_space) <ebfd>: Now a
	gdb_bfd_ref_ptr.
	<set_exec_bfd>: Change argument type.
	<exec_bfd>: Update.
This commit is contained in:
Tom Tromey
2020-10-29 15:04:33 -06:00
parent 7e10abd146
commit 19f6550ebb
4 changed files with 16 additions and 9 deletions

View File

@@ -453,7 +453,7 @@ exec_file_attach (const char *filename, int from_tty)
FOPEN_RUB, scratch_chan);
else
temp = gdb_bfd_open (canonical_pathname, gnutarget, scratch_chan);
current_program_space->set_exec_bfd (temp.release ());
current_program_space->set_exec_bfd (std::move (temp));
if (!current_program_space->exec_bfd ())
{