From 15908a11ba92bcc30a92b70ee75e2576d915e0c1 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 22 Feb 2021 09:47:37 -0700 Subject: Change target_bfd_reopen to take a gdb_bfd_ref_ptr While looking at Andrew's recent target sections series, I saw that target_bfd_reopen took a "bfd *", leading to a call to new_reference. However, because the only caller of target_bfd_reopen is already using gdb_bfd_ref_ptr, this code can be simplified and the explicit call to new_reference can be removed. gdb/ChangeLog 2021-02-22 Tom Tromey * solib-svr4.c (enable_break): Update. * bfd-target.c (class target_bfd) : Change parameter type. (target_bfd_reopen): Change parameter type. * bfd-target.h (target_bfd_reopen): Change parameter type. --- gdb/bfd-target.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'gdb/bfd-target.h') diff --git a/gdb/bfd-target.h b/gdb/bfd-target.h index 199ada8..3d37b5f 100644 --- a/gdb/bfd-target.h +++ b/gdb/bfd-target.h @@ -20,12 +20,11 @@ #ifndef BFD_TARGET_H #define BFD_TARGET_H -struct bfd; +#include "gdb_bfd.h" + struct target_ops; -/* Given an existing BFD, re-open it as a "struct target_ops". This - acquires a new reference to the BFD. This reference will be - released when the target is closed. */ -struct target_ops *target_bfd_reopen (struct bfd *bfd); +/* Given an existing BFD, re-open it as a "struct target_ops". */ +struct target_ops *target_bfd_reopen (const gdb_bfd_ref_ptr &bfd); #endif -- cgit v1.1