*** empty log message ***
[deliverable/binutils-gdb.git] / gdb / symmisc.c
index 8199648aded2fbf62cb7c4450cfb9d06ee854bdc..39b10a6a02cf6afea7d08facd90abd42a8b3d4c8 100644 (file)
@@ -89,10 +89,10 @@ free_symtab_block (struct objfile *objfile, struct block *b)
   n = BLOCK_NSYMS (b);
   for (i = 0; i < n; i++)
     {
-      mfree (objfile->md, SYMBOL_NAME (BLOCK_SYM (b, i)));
-      mfree (objfile->md, (PTR) BLOCK_SYM (b, i));
+      xmfree (objfile->md, SYMBOL_NAME (BLOCK_SYM (b, i)));
+      xmfree (objfile->md, (PTR) BLOCK_SYM (b, i));
     }
-  mfree (objfile->md, (PTR) b);
+  xmfree (objfile->md, (PTR) b);
 }
 
 /* Free all the storage associated with the struct symtab <- S.
@@ -126,7 +126,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.  */
-      mfree (s->objfile->md, (PTR) bv);
+      xmfree (s->objfile->md, (PTR) bv);
       /* Also free the linetable.  */
 
     case free_linetable:
@@ -134,22 +134,22 @@ free_symtab (register struct symtab *s)
          or by some other symtab, except for our linetable.
          Free that now.  */
       if (LINETABLE (s))
-       mfree (s->objfile->md, (PTR) LINETABLE (s));
+       xmfree (s->objfile->md, (PTR) LINETABLE (s));
       break;
     }
 
   /* If there is a single block of memory to free, free it.  */
   if (s->free_ptr != NULL)
-    mfree (s->objfile->md, s->free_ptr);
+    xmfree (s->objfile->md, s->free_ptr);
 
   /* Free source-related stuff */
   if (s->line_charpos != NULL)
-    mfree (s->objfile->md, (PTR) s->line_charpos);
+    xmfree (s->objfile->md, (PTR) s->line_charpos);
   if (s->fullname != NULL)
-    mfree (s->objfile->md, s->fullname);
+    xmfree (s->objfile->md, s->fullname);
   if (s->debugformat != NULL)
-    mfree (s->objfile->md, s->debugformat);
-  mfree (s->objfile->md, (PTR) s);
+    xmfree (s->objfile->md, s->debugformat);
+  xmfree (s->objfile->md, (PTR) s);
 }
 
 void
@@ -197,6 +197,8 @@ print_objfile_statistics (void)
                     obstack_memory_used (&objfile->psymbol_obstack));
     printf_filtered ("  Total memory used for psymbol cache: %d\n",
                     obstack_memory_used (&objfile->psymbol_cache.cache));
+    printf_filtered ("  Total memory used for macro cache: %d\n",
+                    obstack_memory_used (&objfile->macro_cache.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",
@@ -410,6 +412,7 @@ dump_symtab (struct objfile *objfile, struct symtab *symtab,
   int len, blen;
   register struct linetable *l;
   struct blockvector *bv;
+  struct symbol *sym;
   register struct block *b;
   int depth;
 
@@ -471,11 +474,12 @@ dump_symtab (struct objfile *objfile, struct symtab *symtab,
          if (BLOCK_GCC_COMPILED (b))
            fprintf_filtered (outfile, ", compiled with gcc%d", BLOCK_GCC_COMPILED (b));
          fprintf_filtered (outfile, "\n");
-         /* Now print each symbol in this block */
-         for (j = 0; j < blen; j++)
+         /* Now print each symbol in this block.  */
+         /* FIXMED: Sort?  */
+         ALL_BLOCK_SYMBOLS (b, j, sym)
            {
              struct print_symbol_args s;
-             s.symbol = BLOCK_SYM (b, j);
+             s.symbol = sym;
              s.depth = depth + 1;
              s.outfile = outfile;
              catch_errors (print_symbol, &s, "Error printing symbol:\n",
@@ -957,7 +961,7 @@ maintenance_check_symtabs (char *ignore, int from_tty)
     while (length--)
       {
        sym = lookup_block_symbol (b, SYMBOL_NAME (*psym),
-                                  SYMBOL_NAMESPACE (*psym));
+                                  NULL, SYMBOL_NAMESPACE (*psym));
        if (!sym)
          {
            printf_filtered ("Static symbol `");
@@ -974,7 +978,7 @@ maintenance_check_symtabs (char *ignore, int from_tty)
     while (length--)
       {
        sym = lookup_block_symbol (b, SYMBOL_NAME (*psym),
-                                  SYMBOL_NAMESPACE (*psym));
+                                  NULL, SYMBOL_NAMESPACE (*psym));
        if (!sym)
          {
            printf_filtered ("Global symbol `");
This page took 0.024644 seconds and 4 git commands to generate.