This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
[rfa/rfc/symtab] make_cleanup (free_search_symbols, &ss) ???
- To: GDB Patches <gdb-patches at sourceware dot cygnus dot com>
- Subject: [rfa/rfc/symtab] make_cleanup (free_search_symbols, &ss) ???
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Mon, 22 May 2000 17:46:20 +1000
- Organization: Cygnus Solutions
Hello,
The attached patch should have purged symtab.c of any uses of
``(make_cleanup_func)''. Unfortunatly it didn't compile with -Werror
:-/ Have a closer look at the original code :-)
I suspect that I should just remove the offending ``&'' operator.
However, an opinion from a set of eyes that are familiar with the code
is probably a very good idea :-)
enjoy,
Andrew
Mon May 22 16:20:31 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.
Index: symtab.c
===================================================================
RCS file: /cvs/src/src/gdb/symtab.c,v
retrieving revision 1.4
diff -p -r1.4 symtab.c
*** symtab.c 2000/05/03 13:45:17 1.4
--- symtab.c 2000/05/22 07:34:31
*************** free_search_symbols (symbols)
*** 3569,3574 ****
--- 3569,3587 ----
}
}
+ 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.
*************** search_symbols (regexp, kind, nfiles, fi
*** 3801,3808 ****
if (tail == NULL)
{
sr = psr;
! old_chain = make_cleanup ((make_cleanup_func)
! free_search_symbols, sr);
}
else
tail->next = psr;
--- 3814,3820 ----
if (tail == NULL)
{
sr = psr;
! old_chain = make_cleanup_free_search_symbols (sr);
}
else
tail->next = psr;
*************** search_symbols (regexp, kind, nfiles, fi
*** 3846,3853 ****
if (tail == NULL)
{
sr = psr;
! old_chain = make_cleanup ((make_cleanup_func)
! free_search_symbols, &sr);
}
else
tail->next = psr;
--- 3858,3864 ----
if (tail == NULL)
{
sr = psr;
! old_chain = make_cleanup_free_search_symbols (&sr);
}
else
tail->next = psr;
*************** symtab_symbol_info (regexp, kind, from_t
*** 3962,3968 ****
/* 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);
printf_filtered (regexp
? "All %ss matching regular expression \"%s\":\n"
--- 3973,3979 ----
/* must make sure that if we're interrupted, symbols gets freed */
search_symbols (regexp, kind, 0, (char **) NULL, &symbols);
! old_chain = make_cleanup_free_search_symbols (symbols);
printf_filtered (regexp
? "All %ss matching regular expression \"%s\":\n"
*************** rbreak_command (regexp, from_tty)
*** 4050,4056 ****
struct cleanup *old_chain;
search_symbols (regexp, FUNCTIONS_NAMESPACE, 0, (char **) NULL, &ss);
! old_chain = make_cleanup ((make_cleanup_func) free_search_symbols, ss);
for (p = ss; p != NULL; p = p->next)
{
--- 4061,4067 ----
struct cleanup *old_chain;
search_symbols (regexp, FUNCTIONS_NAMESPACE, 0, (char **) NULL, &ss);
! old_chain = make_cleanup_free_search_symbols (ss);
for (p = ss; p != NULL; p = p->next)
{
Index: symtab.h
===================================================================
RCS file: /cvs/src/src/gdb/symtab.h,v
retrieving revision 1.7
diff -p -r1.7 symtab.h
*** symtab.h 2000/05/16 04:07:39 1.7
--- symtab.h 2000/05/22 07:34:33
*************** struct symbol_search
*** 1491,1495 ****
--- 1491,1496 ----
extern void search_symbols PARAMS ((char *, namespace_enum, int, char **, struct symbol_search **));
extern void free_search_symbols PARAMS ((struct symbol_search *));
+ extern struct cleanup *make_cleanup_free_search_symbols (struct symbol_search *);
#endif /* !defined(SYMTAB_H) */