+2021-02-22 Tom Tromey <tromey@adacore.com>
+
+ * solib-svr4.c (enable_break): Update.
+ * bfd-target.c (class target_bfd) <target_bfd>: Change parameter
+ type.
+ (target_bfd_reopen): Change parameter type.
+ * bfd-target.h (target_bfd_reopen): Change parameter type.
+
2021-02-22 Simon Marchi <simon.marchi@polymtl.ca>
* thread.c (add_thread_silent): Add assert.
class target_bfd : public target_ops
{
public:
- explicit target_bfd (struct bfd *bfd);
+ explicit target_bfd (const gdb_bfd_ref_ptr &bfd);
const target_info &info () const override
{ return target_bfd_target_info; }
return &m_table;
}
-target_bfd::target_bfd (struct bfd *abfd)
- : m_bfd (gdb_bfd_ref_ptr::new_reference (abfd)),
- m_table (build_section_table (abfd))
+target_bfd::target_bfd (const gdb_bfd_ref_ptr &abfd)
+ : m_bfd (abfd),
+ m_table (build_section_table (abfd.get ()))
{
}
target_ops *
-target_bfd_reopen (struct bfd *abfd)
+target_bfd_reopen (const gdb_bfd_ref_ptr &abfd)
{
return new target_bfd (abfd);
}
#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
goto bkpt_at_symbol;
/* Now convert the TMP_BFD into a target. That way target, as
- well as BFD operations can be used. target_bfd_reopen
- acquires its own reference. */
- tmp_bfd_target = target_bfd_reopen (tmp_bfd.get ());
+ well as BFD operations can be used. */
+ tmp_bfd_target = target_bfd_reopen (tmp_bfd);
/* On a running target, we can get the dynamic linker's base
address from the shared library table. */