From: Andrew Cagney Date: Mon, 29 May 2000 13:18:15 +0000 (+0000) Subject: Purge symtab of make_cleanup_func. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5bd987222faa869dc0524071f9694c41688d1ece;p=binutils-gdb.git Purge symtab of make_cleanup_func. Pass correct arg to make_cleanup_free_search_symbols. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 69124c0d31e..112129bf922 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,12 @@ +Mon May 29 15:41:10 2000 Andrew Cagney + + * symtab.h (make_cleanup_free_search_symbols): Add declaration. + * symtab.c (make_cleanup_free_search_symbols, + do_free_search_symbols_cleanup): New functions. + (search_symbols, symtab_symbol_info, rbreak_command): Update. + (search_symbols): Pass ``sr'', and not its address, to + make_cleanup_free_search_symbols. + 2000-05-28 Kevin Buettner * config/nm-linux.h (GDB_GREGSET_T, GDB_FPREGSET_T): Fix typos. diff --git a/gdb/symtab.c b/gdb/symtab.c index 4e1589603c0..41c23aa6b14 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -3564,6 +3564,19 @@ free_search_symbols (symbols) } } +static void +do_free_search_symbols_cleanup (void *symbols) +{ + free_search_symbols (symbols); +} + +struct cleanup * +make_cleanup_free_search_symbols (struct symbol_search *symbols) +{ + return make_cleanup (do_free_search_symbols_cleanup, symbols); +} + + /* Search the symbol table for matches to the regular expression REGEXP, returning the results in *MATCHES. @@ -3796,8 +3809,7 @@ search_symbols (regexp, kind, nfiles, files, matches) if (tail == NULL) { sr = psr; - old_chain = make_cleanup ((make_cleanup_func) - free_search_symbols, sr); + old_chain = make_cleanup_free_search_symbols (sr); } else tail->next = psr; @@ -3841,8 +3853,7 @@ search_symbols (regexp, kind, nfiles, files, matches) if (tail == NULL) { sr = psr; - old_chain = make_cleanup ((make_cleanup_func) - free_search_symbols, &sr); + old_chain = make_cleanup_free_search_symbols (sr); } else tail->next = psr; @@ -3957,7 +3968,7 @@ symtab_symbol_info (regexp, kind, from_tty) /* must make sure that if we're interrupted, symbols gets freed */ search_symbols (regexp, kind, 0, (char **) NULL, &symbols); - old_chain = make_cleanup ((make_cleanup_func) free_search_symbols, symbols); + old_chain = make_cleanup_free_search_symbols (symbols); printf_filtered (regexp ? "All %ss matching regular expression \"%s\":\n" @@ -4045,7 +4056,7 @@ rbreak_command (regexp, from_tty) struct cleanup *old_chain; search_symbols (regexp, FUNCTIONS_NAMESPACE, 0, (char **) NULL, &ss); - old_chain = make_cleanup ((make_cleanup_func) free_search_symbols, ss); + old_chain = make_cleanup_free_search_symbols (ss); for (p = ss; p != NULL; p = p->next) { diff --git a/gdb/symtab.h b/gdb/symtab.h index 334d266a9f0..d846f3edfca 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -1441,5 +1441,6 @@ struct symbol_search extern void search_symbols (char *, namespace_enum, int, char **, struct symbol_search **); extern void free_search_symbols (struct symbol_search *); +extern struct cleanup *make_cleanup_free_search_symbols (struct symbol_search *); #endif /* !defined(SYMTAB_H) */