+Mon May 29 15:41:10 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * 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 <kevinb@redhat.com>
* config/nm-linux.h (GDB_GREGSET_T, GDB_FPREGSET_T): Fix typos.
}
}
+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.
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;
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;
/* 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"
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)
{
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) */