From: Andrew Cagney Date: Tue, 16 May 2000 04:07:39 +0000 (+0000) Subject: Cleanup discard_minimal_symbols cleanup. X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=56e290f494ab802bbc5c26c445dad0d1e6a7f37b;p=deliverable%2Fbinutils-gdb.git Cleanup discard_minimal_symbols cleanup. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2903feb8fd..aa37cd5386 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,17 @@ +Tue May 16 13:30:08 2000 Andrew Cagney + + * symtab.h (make_cleanup_discard_minimal_symbols): Replace + discard_minimal_symbols. + * minsyms.c (make_cleanup_discard_minimal_symbols): + (do_discard_minimal_symbols_cleanup): New functions. + + * xcoffread.c (xcoff_initial_scan), somread.c (som_symfile_read), + solib.c (solib_add_common_symbols), os9kread.c + (os9k_symfile_read), nlmread.c (nlm_symfile_read), mipsread.c + (mipscoff_symfile_read), elfread.c (elf_symfile_read), dstread.c + (dst_symfile_read), dbxread.c (dbx_symfile_read), coffread.c + (coff_symfile_read): Replace make_cleanup. + Mon May 15 09:32:31 2000 Andrew Cagney * command.h (add_set_cmd): Change VAR parameter to void pointer. diff --git a/gdb/coffread.c b/gdb/coffread.c index 7b9f5af198..010b36aea2 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -670,7 +670,7 @@ coff_symfile_read (objfile, mainline) error ("\"%s\": can't get string table", name); init_minimal_symbol_collection (); - make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0); + make_cleanup_discard_minimal_symbols (); /* Now that the executable file is positioned at symbol table, process it and define symbols accordingly. */ diff --git a/gdb/dbxread.c b/gdb/dbxread.c index 25302de1cc..4c38fb490c 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -624,7 +624,7 @@ dbx_symfile_read (objfile, mainline) back_to = make_cleanup (really_free_pendings, 0); init_minimal_symbol_collection (); - make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0); + make_cleanup_discard_minimal_symbols (); /* Read stabs data from executable file and define symbols. */ diff --git a/gdb/dstread.c b/gdb/dstread.c index c10c1fe18c..8b22b144ae 100644 --- a/gdb/dstread.c +++ b/gdb/dstread.c @@ -288,7 +288,7 @@ dst_symfile_read (objfile, mainline) error ("\"%s\": error reading debugging symbol tables\n", name); init_minimal_symbol_collection (); - make_cleanup (discard_minimal_symbols, 0); + make_cleanup_discard_minimal_symbols (); /* Now that the executable file is positioned at symbol table, process it and define symbols accordingly. */ diff --git a/gdb/elfread.c b/gdb/elfread.c index 60f7988029..4d9376d9c6 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -591,7 +591,7 @@ elf_symfile_read (objfile, mainline) CORE_ADDR offset; init_minimal_symbol_collection (); - back_to = make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0); + back_to = make_cleanup_discard_minimal_symbols (); memset ((char *) &ei, 0, sizeof (ei)); diff --git a/gdb/minsyms.c b/gdb/minsyms.c index a032dd3511..0e24663a35 100644 --- a/gdb/minsyms.c +++ b/gdb/minsyms.c @@ -743,10 +743,8 @@ compare_minimal_symbols (fn1p, fn2p) obstack and then simply blow the obstack away when we are done with it. Is it worth the extra trouble though? */ -/* ARGSUSED */ -void -discard_minimal_symbols (foo) - int foo; +static void +do_discard_minimal_symbols_cleanup (void *arg) { register struct msym_bunch *next; @@ -758,6 +756,13 @@ discard_minimal_symbols (foo) } } +struct cleanup * +make_cleanup_discard_minimal_symbols (void) +{ + return make_cleanup (do_discard_minimal_symbols_cleanup, 0); +} + + /* Compact duplicate entries out of a minimal symbol table by walking through the table and compacting out entries with duplicate addresses diff --git a/gdb/mipsread.c b/gdb/mipsread.c index 9d8f0ff9ea..279541812e 100644 --- a/gdb/mipsread.c +++ b/gdb/mipsread.c @@ -94,7 +94,7 @@ mipscoff_symfile_read (objfile, mainline) struct cleanup *back_to; init_minimal_symbol_collection (); - back_to = make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0); + back_to = make_cleanup_discard_minimal_symbols (); /* Now that the executable file is positioned at symbol table, process it and define symbols accordingly. */ diff --git a/gdb/nlmread.c b/gdb/nlmread.c index 03413b33d8..e83e554f52 100644 --- a/gdb/nlmread.c +++ b/gdb/nlmread.c @@ -192,7 +192,7 @@ nlm_symfile_read (objfile, mainline) struct symbol *mainsym; init_minimal_symbol_collection (); - back_to = make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0); + back_to = make_cleanup_discard_minimal_symbols (); /* FIXME, should take a section_offsets param, not just an offset. */ diff --git a/gdb/os9kread.c b/gdb/os9kread.c index cbc51a75e0..daa45971d0 100644 --- a/gdb/os9kread.c +++ b/gdb/os9kread.c @@ -342,7 +342,7 @@ os9k_symfile_read (objfile, mainline) free_pending_blocks (); back_to = make_cleanup (really_free_pendings, 0); - make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0); + make_cleanup_discard_minimal_symbols (); read_minimal_symbols (objfile); /* Now that the symbol table data of the executable file are all in core, diff --git a/gdb/solib.c b/gdb/solib.c index 1094277d51..0000444f3d 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -445,7 +445,7 @@ solib_add_common_symbols (rtc_symp) } init_minimal_symbol_collection (); - make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0); + make_cleanup_discard_minimal_symbols (); while (rtc_symp) { diff --git a/gdb/somread.c b/gdb/somread.c index 8dda58df9c..b1370abffa 100644 --- a/gdb/somread.c +++ b/gdb/somread.c @@ -366,7 +366,7 @@ som_symfile_read (objfile, mainline) do_pxdb (symfile_bfd_open (objfile->name)); init_minimal_symbol_collection (); - back_to = make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0); + back_to = make_cleanup_discard_minimal_symbols (); /* Read in the import list and the export list. Currently the export list isn't used; the import list is used in diff --git a/gdb/symtab.h b/gdb/symtab.h index dffb26ae06..1d3108f730 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -1267,8 +1267,7 @@ extern CORE_ADDR extern void init_minimal_symbol_collection PARAMS ((void)); -extern void -discard_minimal_symbols PARAMS ((int)); +extern struct cleanup *make_cleanup_discard_minimal_symbols (void); extern void install_minimal_symbols PARAMS ((struct objfile *)); diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index 991c83a372..586cdab544 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -2746,7 +2746,7 @@ xcoff_initial_scan (objfile, mainline) back_to = make_cleanup (really_free_pendings, 0); init_minimal_symbol_collection (); - make_cleanup ((make_cleanup_func) discard_minimal_symbols, 0); + make_cleanup_discard_minimal_symbols (); /* Now that the symbol table data of the executable file are all in core, process them and define symbols accordingly. */