2003-01-18 Andrew Cagney <ac131313@redhat.com>
[deliverable/binutils-gdb.git] / gdb / symmisc.c
index 370b76e1aa5335f14dd213c356543a6ba7b6e91b..995372d1d05242966eb4beee79c4a37282c6259c 100644 (file)
@@ -1,6 +1,8 @@
 /* Do various things to symbol tables (other than lookup), for GDB.
-   Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
-   1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+
+   Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
+   1995, 1996, 1997, 1998, 1999, 2000, 2002 Free Software Foundation,
+   Inc.
 
    This file is part of GDB.
 
 #include "objfiles.h"
 #include "breakpoint.h"
 #include "command.h"
-#include "obstack.h"
+#include "gdb_obstack.h"
 #include "language.h"
 #include "bcache.h"
 
 #include "gdb_string.h"
+#include <readline/readline.h>
 
 #ifndef DEV_TTY
 #define DEV_TTY "/dev/tty"
@@ -75,7 +78,7 @@ struct print_symbol_args
     struct ui_file *outfile;
   };
 
-static int print_symbol (PTR);
+static int print_symbol (void *);
 
 static void free_symtab_block (struct objfile *, struct block *);
 \f
@@ -95,10 +98,10 @@ free_symtab_block (struct objfile *objfile, struct block *b)
        {
          next_sym = sym->hash_next;
          xmfree (objfile->md, SYMBOL_NAME (sym));
-         xmfree (objfile->md, (PTR) sym);
+         xmfree (objfile->md, sym);
        }
     }
-  xmfree (objfile->md, (PTR) b);
+  xmfree (objfile->md, b);
 }
 
 /* Free all the storage associated with the struct symtab <- S.
@@ -132,7 +135,7 @@ free_symtab (register struct symtab *s)
       for (i = 0; i < n; i++)
        free_symtab_block (s->objfile, BLOCKVECTOR_BLOCK (bv, i));
       /* Free the blockvector itself.  */
-      xmfree (s->objfile->md, (PTR) bv);
+      xmfree (s->objfile->md, bv);
       /* Also free the linetable.  */
 
     case free_linetable:
@@ -140,7 +143,7 @@ free_symtab (register struct symtab *s)
          or by some other symtab, except for our linetable.
          Free that now.  */
       if (LINETABLE (s))
-       xmfree (s->objfile->md, (PTR) LINETABLE (s));
+       xmfree (s->objfile->md, LINETABLE (s));
       break;
     }
 
@@ -150,12 +153,12 @@ free_symtab (register struct symtab *s)
 
   /* Free source-related stuff */
   if (s->line_charpos != NULL)
-    xmfree (s->objfile->md, (PTR) s->line_charpos);
+    xmfree (s->objfile->md, s->line_charpos);
   if (s->fullname != NULL)
     xmfree (s->objfile->md, s->fullname);
   if (s->debugformat != NULL)
     xmfree (s->objfile->md, s->debugformat);
-  xmfree (s->objfile->md, (PTR) s);
+  xmfree (s->objfile->md, s);
 }
 
 void
@@ -167,7 +170,7 @@ print_symbol_bcache_statistics (void)
   ALL_OBJFILES (objfile)
   {
     printf_filtered ("Byte cache statistics for '%s':\n", objfile->name);
-    print_bcache_statistics (&objfile->psymbol_cache, "partial symbol cache");
+    print_bcache_statistics (objfile->psymbol_cache, "partial symbol cache");
   }
   immediate_quit--;
 }
@@ -202,9 +205,9 @@ print_objfile_statistics (void)
     printf_filtered ("  Total memory used for psymbol obstack: %d\n",
                     obstack_memory_used (&objfile->psymbol_obstack));
     printf_filtered ("  Total memory used for psymbol cache: %d\n",
-                    obstack_memory_used (&objfile->psymbol_cache.cache));
+                    bcache_memory_used (objfile->psymbol_cache));
     printf_filtered ("  Total memory used for macro cache: %d\n",
-                    obstack_memory_used (&objfile->macro_cache.cache));
+                    bcache_memory_used (objfile->macro_cache));
     printf_filtered ("  Total memory used for symbol obstack: %d\n",
                     obstack_memory_used (&objfile->symbol_obstack));
     printf_filtered ("  Total memory used for type obstack: %d\n",
@@ -365,7 +368,7 @@ dump_psymtab (struct objfile *objfile, struct partial_symtab *psymtab,
                        "  Full symtab was read (at ");
       gdb_print_host_address (psymtab->symtab, outfile);
       fprintf_filtered (outfile, " by function at ");
-      gdb_print_host_address ((PTR) psymtab->read_symtab, outfile);
+      gdb_print_host_address (psymtab->read_symtab, outfile);
       fprintf_filtered (outfile, ")\n");
     }
 
@@ -562,7 +565,7 @@ Arguments missing: an output file name and an optional symbol file name");
    1 for success.  */
 
 static int
-print_symbol (PTR args)
+print_symbol (void *args)
 {
   struct symbol *symbol = ((struct print_symbol_args *) args)->symbol;
   int depth = ((struct print_symbol_args *) args)->depth;
This page took 0.03126 seconds and 4 git commands to generate.