Cleanup discard_minimal_symbols cleanup.
authorAndrew Cagney <cagney@redhat.com>
Tue, 16 May 2000 04:07:39 +0000 (04:07 +0000)
committerAndrew Cagney <cagney@redhat.com>
Tue, 16 May 2000 04:07:39 +0000 (04:07 +0000)
13 files changed:
gdb/ChangeLog
gdb/coffread.c
gdb/dbxread.c
gdb/dstread.c
gdb/elfread.c
gdb/minsyms.c
gdb/mipsread.c
gdb/nlmread.c
gdb/os9kread.c
gdb/solib.c
gdb/somread.c
gdb/symtab.h
gdb/xcoffread.c

index 2903feb..aa37cd5 100644 (file)
@@ -1,3 +1,17 @@
+Tue May 16 13:30:08 2000  Andrew Cagney  <cagney@b1.cygnus.com>
+
+       * 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  <cagney@b1.cygnus.com>
 
        * command.h (add_set_cmd): Change VAR parameter to void pointer.
index 7b9f5af..010b36a 100644 (file)
@@ -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.  */
index 25302de..4c38fb4 100644 (file)
@@ -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. */
 
index c10c1fe..8b22b14 100644 (file)
@@ -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.  */
index 60f7988..4d9376d 100644 (file)
@@ -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));
 
index a032dd3..0e24663 100644 (file)
@@ -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
index 9d8f0ff..2795418 100644 (file)
@@ -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.  */
index 03413b3..e83e554 100644 (file)
@@ -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.  */
 
index cbc51a7..daa4597 100644 (file)
@@ -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,
index 1094277..0000444 100644 (file)
@@ -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)
     {
index 8dda58d..b1370ab 100644 (file)
@@ -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
index dffb26a..1d3108f 100644 (file)
@@ -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 *));
index 991c83a..586cdab 100644 (file)
@@ -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.  */