diff options
author | Andrew Cagney <cagney@redhat.com> | 2000-05-22 09:02:23 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2000-05-22 09:02:23 +0000 |
commit | 8bc03e33b431d1eb24d0bf62bd6de8541cc8a587 (patch) | |
tree | 9b21100bd147ba7660ed8beef02555b41563366a /gdb/symfile.c | |
parent | d9d44fe4c56f9fbb4e2db06384fc6ec08aa4bfd9 (diff) | |
download | gdb-8bc03e33b431d1eb24d0bf62bd6de8541cc8a587.tar.gz |
Purge (almost) make_cleanup_func.
Diffstat (limited to 'gdb/symfile.c')
-rw-r--r-- | gdb/symfile.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/gdb/symfile.c b/gdb/symfile.c index 8fc4fe7c962..6f2edf34353 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. |