aboutsummaryrefslogtreecommitdiff
path: root/gdb/symfile.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2000-05-22 09:02:23 +0000
committerAndrew Cagney <cagney@redhat.com>2000-05-22 09:02:23 +0000
commit74b7792f0fcae41f7c7da524527b7261a3fd68c4 (patch)
treeb88a9a20c59780f3b51c4819b6dea5acce3ec446 /gdb/symfile.c
parent32c092c3fab0ca778242005a793cc4641c3e1b4b (diff)
downloadgdb-74b7792f0fcae41f7c7da524527b7261a3fd68c4.zip
gdb-74b7792f0fcae41f7c7da524527b7261a3fd68c4.tar.gz
gdb-74b7792f0fcae41f7c7da524527b7261a3fd68c4.tar.bz2
Purge (almost) make_cleanup_func.
Diffstat (limited to 'gdb/symfile.c')
-rw-r--r--gdb/symfile.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 8fc4fe7..6f2edf3 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -72,6 +72,8 @@ void (*pre_add_symbol_hook) PARAMS ((char *));
void (*post_add_symbol_hook) PARAMS ((void));
void (*target_new_objfile_hook) PARAMS ((struct objfile *));
+static void clear_symtab_users_cleanup (void *ignore);
+
/* Global variables owned by this file */
int readnow_symbol_files; /* Read full symbols immediately */
@@ -605,13 +607,13 @@ syms_from_objfile (objfile, addrs, mainline, verbo)
/* Make sure that partially constructed symbol tables will be cleaned up
if an error occurs during symbol reading. */
- old_chain = make_cleanup ((make_cleanup_func) free_objfile, objfile);
+ old_chain = make_cleanup_free_objfile (objfile);
if (mainline)
{
/* We will modify the main symbol table, make sure that all its users
will be cleaned up if an error occurs during symbol reading. */
- make_cleanup ((make_cleanup_func) clear_symtab_users, 0);
+ make_cleanup (clear_symtab_users_cleanup, 0 /*ignore*/);
/* Since no error yet, throw away the old symbol table. */
@@ -1657,10 +1659,9 @@ reread_symbols ()
/* If we get an error, blow away this objfile (not sure if
that is the correct response for things like shared
libraries). */
- old_cleanups = make_cleanup ((make_cleanup_func) free_objfile,
- objfile);
+ old_cleanups = make_cleanup_free_objfile (objfile);
/* We need to do this whenever any symbols go away. */
- make_cleanup ((make_cleanup_func) clear_symtab_users, 0);
+ make_cleanup (clear_symtab_users_cleanup, 0 /*ignore*/);
/* Clean up any state BFD has sitting around. We don't need
to close the descriptor but BFD lacks a way of closing the
@@ -2088,6 +2089,12 @@ clear_symtab_users ()
target_new_objfile_hook (NULL);
}
+static void
+clear_symtab_users_cleanup (void *ignore)
+{
+ clear_symtab_users ();
+}
+
/* clear_symtab_users_once:
This function is run after symbol reading, or from a cleanup.