aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog10
-rw-r--r--gdb/corelow.c4
-rw-r--r--gdb/defs.h2
-rw-r--r--gdb/remote-e7000.c2
-rw-r--r--gdb/remote-udi.c2
-rw-r--r--gdb/sparcl-tdep.c2
-rw-r--r--gdb/symfile.c2
-rw-r--r--gdb/utils.c12
8 files changed, 30 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index f8342fa..085add8 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,13 @@
+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.
diff --git a/gdb/corelow.c b/gdb/corelow.c
index adcfe90..6cdf0d7 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -295,7 +295,7 @@ core_open (filename, from_tty)
/* 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 ()));
}
@@ -493,7 +493,7 @@ core_file_to_sym_file (core)
/* 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 ()));
}
diff --git a/gdb/defs.h b/gdb/defs.h
index aa8987d..390da35 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -332,6 +332,8 @@ extern struct cleanup *make_cleanup_freeargv (char **);
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 **,
diff --git a/gdb/remote-e7000.c b/gdb/remote-e7000.c
index c5ced87..608f116 100644
--- a/gdb/remote-e7000.c
+++ b/gdb/remote-e7000.c
@@ -1580,7 +1580,7 @@ e7000_load (args, from_tty)
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,
diff --git a/gdb/remote-udi.c b/gdb/remote-udi.c
index 12590f8..9a377a0 100644
--- a/gdb/remote-udi.c
+++ b/gdb/remote-udi.c
@@ -1162,7 +1162,7 @@ download (load_arg_string, from_tty)
/* 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++;
diff --git a/gdb/sparcl-tdep.c b/gdb/sparcl-tdep.c
index b6ea064..91499af 100644
--- a/gdb/sparcl-tdep.c
+++ b/gdb/sparcl-tdep.c
@@ -614,7 +614,7 @@ download (target_name, args, from_tty, write_routine, start_routine)
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,
diff --git a/gdb/symfile.c b/gdb/symfile.c
index b01fe33..8fc4fe7 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -1230,7 +1230,7 @@ generic_load (char *args, int from_tty)
/* 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))
{
diff --git a/gdb/utils.c b/gdb/utils.c
index aa1fccd..3fd055ca 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -204,6 +204,18 @@ make_cleanup_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)
{
ui_file_delete (arg);