aboutsummaryrefslogtreecommitdiff
path: root/gdb/progspace.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2020-10-29 15:04:33 -0600
committerTom Tromey <tom@tromey.com>2020-10-29 15:04:37 -0600
commit19f6550ebbc922f88026c5c7ebeb04019d47cac2 (patch)
treef91c94262757e994e4074118d041bae0a687e94b /gdb/progspace.h
parent7e10abd146dbd17dc1b4e9701210e5724df2b2b0 (diff)
downloadgdb-19f6550ebbc922f88026c5c7ebeb04019d47cac2.zip
gdb-19f6550ebbc922f88026c5c7ebeb04019d47cac2.tar.gz
gdb-19f6550ebbc922f88026c5c7ebeb04019d47cac2.tar.bz2
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.
Diffstat (limited to 'gdb/progspace.h')
-rw-r--r--gdb/progspace.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/progspace.h b/gdb/progspace.h
index 5e49083..8150d8a 100644
--- a/gdb/progspace.h
+++ b/gdb/progspace.h
@@ -279,13 +279,13 @@ struct program_space
/* Return the exec BFD for this program space. */
bfd *exec_bfd () const
{
- return ebfd;
+ return ebfd.get ();
}
/* Set the exec BFD for this program space to ABFD. */
- void set_exec_bfd (bfd *abfd)
+ void set_exec_bfd (gdb_bfd_ref_ptr &&abfd)
{
- ebfd = abfd;
+ ebfd = std::move (abfd);
}
/* Unique ID number. */
@@ -295,7 +295,7 @@ struct program_space
managed by the exec target. */
/* The BFD handle for the main executable. */
- bfd *ebfd = NULL;
+ gdb_bfd_ref_ptr ebfd;
/* The last-modified time, from when the exec was brought in. */
long ebfd_mtime = 0;
/* Similar to bfd_get_filename (exec_bfd) but in original form given