+Tue May 16 10:54:55 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * defs.h (make_cleanup_bfd_close): Add declaration.
+ * utils.c (do_bfd_close_cleanup, make_cleanup_bfd_close): New
+ functions.
+
+ * symfile.c (generic_load), sparcl-tdep.c (download), remote-udi.c
+ (download), remote-e7000.c (e7000_load), corelow.c (core_open,
+ core_file_to_sym_file): Replace calls to make_cleanup.
+
Mon May 15 16:50:45 2000 Andrew Cagney <cagney@b1.cygnus.com>
* TODO: Add notes on register cache.
/* FIXME: should be checking for errors from bfd_close (for one thing,
on error it does not free all the storage associated with the
bfd). */
- make_cleanup ((make_cleanup_func) bfd_close, temp_bfd);
+ make_cleanup_bfd_close (temp_bfd);
error ("\"%s\" is not a core dump: %s",
filename, bfd_errmsg (bfd_get_error ()));
}
/* FIXME: should be checking for errors from bfd_close (for one thing,
on error it does not free all the storage associated with the
bfd). */
- make_cleanup ((make_cleanup_func) bfd_close, temp_bfd);
+ make_cleanup_bfd_close (temp_bfd);
error ("\"%s\" is not a core dump: %s",
core, bfd_errmsg (bfd_get_error ()));
}
struct ui_file;
extern struct cleanup *make_cleanup_ui_file_delete (struct ui_file *);
+extern struct cleanup *make_cleanup_bfd_close (bfd *abfd);
+
extern struct cleanup *make_final_cleanup (make_cleanup_ftype *, void *);
extern struct cleanup *make_my_cleanup (struct cleanup **,
perror_with_name (filename);
return;
}
- old_chain = make_cleanup ((make_cleanup_func) bfd_close, pbfd);
+ old_chain = make_cleanup_bfd_close (pbfd);
if (!bfd_check_format (pbfd, bfd_object))
error ("\"%s\" is not an object file: %s", filename,
/* FIXME: should be checking for errors from bfd_close (for one thing,
on error it does not free all the storage associated with the
bfd). */
- make_cleanup ((make_cleanup_func) bfd_close, pbfd);
+ make_cleanup_bfd_close (pbfd);
QUIT;
immediate_quit++;
perror_with_name (filename);
return;
}
- old_chain = make_cleanup ((make_cleanup_func) bfd_close, pbfd);
+ old_chain = make_cleanup_bfd_close (pbfd);
if (!bfd_check_format (pbfd, bfd_object))
error ("\"%s\" is not an object file: %s", filename,
/* FIXME: should be checking for errors from bfd_close (for one thing,
on error it does not free all the storage associated with the
bfd). */
- make_cleanup ((make_cleanup_func) bfd_close, loadfile_bfd);
+ make_cleanup_bfd_close (loadfile_bfd);
if (!bfd_check_format (loadfile_bfd, bfd_object))
{
return make_my_cleanup (&cleanup_chain, do_freeargv, arg);
}
+static void
+do_bfd_close_cleanup (void *arg)
+{
+ bfd_close (arg);
+}
+
+struct cleanup *
+make_cleanup_bfd_close (bfd *abfd)
+{
+ return make_cleanup (do_bfd_close_cleanup, abfd);
+}
+
static void
do_ui_file_delete (void *arg)
{