#include "readline/readline.h"
#include "gdbcore.h"
#include "cli/cli-utils.h"
+#include "gdb_bfd.h"
#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
{
bfd *ibfd;
- ibfd = bfd_openr (filename, target);
+ ibfd = gdb_bfd_ref (bfd_openr (filename, target));
if (ibfd == NULL)
error (_("Failed to open %s: %s."), filename,
bfd_errmsg (bfd_get_error ()));
if (*mode == 'w') /* Write: create new file */
{
- obfd = bfd_openw (filename, target);
+ obfd = gdb_bfd_ref (bfd_openw (filename, target));
if (obfd == NULL)
error (_("Failed to open %s: %s."), filename,
bfd_errmsg (bfd_get_error ()));