#include <fcntl.h>
#include "regcache.h"
#include "regset.h"
+#include "gdb_bfd.h"
/* The largest amount of memory to read from the target at once. We
must throttle it to limit the amount of memory used by GDB during
bfd *
create_gcore_bfd (char *filename)
{
- bfd *obfd = bfd_openw (filename, default_gcore_target ());
+ bfd *obfd = gdb_bfd_ref (bfd_openw (filename, default_gcore_target ()));
if (!obfd)
error (_("Failed to open '%s' for output."), filename);
bfd *obfd = arg;
const char *filename = obfd->filename;
- bfd_close (arg);
+ gdb_bfd_unref (arg);
unlink (filename);
}
fprintf_filtered (gdb_stdout, "Saved corefile %s\n", corefilename);
discard_cleanups (old_chain);
- bfd_close (obfd);
+ gdb_bfd_unref (obfd);
}
static unsigned long