Rename a private data member in tui_source_window
[deliverable/binutils-gdb.git] / gdb / symmisc.c
index bb4fdfd1ed92e54ceb21eaeda1a276f481e3eef7..4699fd09206e06c4ce569a3c40d84f86635043a6 100644 (file)
@@ -52,7 +52,7 @@ FILE *std_err;
 
 /* Prototypes for local functions */
 
-static int block_depth (struct block *);
+static int block_depth (const struct block *);
 
 static void print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
                          int depth, ui_file *outfile);
@@ -69,13 +69,11 @@ print_symbol_bcache_statistics (void)
        QUIT;
        printf_filtered (_("Byte cache statistics for '%s':\n"),
                         objfile_name (objfile));
-       print_bcache_statistics
-         (psymbol_bcache_get_bcache (objfile->partial_symtabs->psymbol_cache),
-          "partial symbol cache");
-       print_bcache_statistics (objfile->per_bfd->macro_cache,
-                                "preprocessor macro cache");
-       print_bcache_statistics (objfile->per_bfd->filename_cache,
-                                "file name cache");
+       objfile->partial_symtabs->psymbol_cache.print_statistics
+         ("partial symbol cache");
+       objfile->per_bfd->macro_cache.print_statistics
+         ("preprocessor macro cache");
+       objfile->per_bfd->filename_cache.print_statistics ("file name cache");
       }
 }
 
@@ -136,12 +134,11 @@ print_objfile_statistics (void)
                                                       ->storage_obstack)));
       printf_filtered
        (_("  Total memory used for psymbol cache: %d\n"),
-        bcache_memory_used (psymbol_bcache_get_bcache
-                            (objfile->partial_symtabs->psymbol_cache)));
+        objfile->partial_symtabs->psymbol_cache.memory_used ());
       printf_filtered (_("  Total memory used for macro cache: %d\n"),
-                      bcache_memory_used (objfile->per_bfd->macro_cache));
+                      objfile->per_bfd->macro_cache.memory_used ());
       printf_filtered (_("  Total memory used for file name cache: %d\n"),
-                      bcache_memory_used (objfile->per_bfd->filename_cache));
+                      objfile->per_bfd->filename_cache.memory_used ());
     }
 }
 
@@ -247,8 +244,7 @@ dump_msymbols (struct objfile *objfile, struct ui_file *outfile)
        {
          if (section->the_bfd_section != NULL)
            fprintf_filtered (outfile, " section %s",
-                             bfd_section_name (objfile->obfd,
-                                               section->the_bfd_section));
+                             bfd_section_name (section->the_bfd_section));
          else
            fprintf_filtered (outfile, " spurious section %ld",
                              (long) (section - objfile->sections));
@@ -281,7 +277,7 @@ dump_symtab_1 (struct symtab *symtab, struct ui_file *outfile)
   struct linetable *l;
   const struct blockvector *bv;
   struct symbol *sym;
-  struct block *b;
+  const struct block *b;
   int depth;
 
   fprintf_filtered (outfile, "\nSymtab for file %s\n",
@@ -352,16 +348,15 @@ dump_symtab_1 (struct symtab *symtab, struct ui_file *outfile)
             block, not any blocks from included symtabs.  */
          ALL_DICT_SYMBOLS (BLOCK_MULTIDICT (b), miter, sym)
            {
-             TRY
+             try
                {
                  print_symbol (gdbarch, sym, depth + 1, outfile);
                }
-             CATCH (ex, RETURN_MASK_ERROR)
+             catch (const gdb_exception_error &ex)
                {
                  exception_fprintf (gdb_stderr, ex,
                                     "Error printing symbol:\n");
                }
-             END_CATCH
            }
        }
       fprintf_filtered (outfile, "\n");
@@ -387,13 +382,9 @@ dump_symtab (struct symtab *symtab, struct ui_file *outfile)
   if (symtab->language != language_unknown
       && symtab->language != language_auto)
     {
-      enum language saved_lang;
-
-      saved_lang = set_language (symtab->language);
-
+      scoped_restore_current_language save_lang;
+      set_language (symtab->language);
       dump_symtab_1 (symtab, outfile);
-
-      set_language (saved_lang);
     }
   else
     dump_symtab_1 (symtab, outfile);
@@ -533,8 +524,7 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
                      outfile);
       if (section)
        fprintf_filtered (outfile, " section %s\n",
-                         bfd_section_name (section->the_bfd_section->owner,
-                                           section->the_bfd_section));
+                         bfd_section_name (section->the_bfd_section));
       else
        fprintf_filtered (outfile, "\n");
       return;
@@ -590,8 +580,8 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
            unsigned i;
            struct type *type = check_typedef (SYMBOL_TYPE (symbol));
 
-           fprintf_filtered (outfile, "const %u hex bytes:",
-                             TYPE_LENGTH (type));
+           fprintf_filtered (outfile, "const %s hex bytes:",
+                             pulongest (TYPE_LENGTH (type)));
            for (i = 0; i < TYPE_LENGTH (type); i++)
              fprintf_filtered (outfile, " %02x",
                                (unsigned) SYMBOL_VALUE_BYTES (symbol)[i]);
@@ -604,8 +594,7 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
                          outfile);
          if (section)
            fprintf_filtered (outfile, " section %s",
-                             bfd_section_name (section->the_bfd_section->owner,
-                                               section->the_bfd_section));
+                             bfd_section_name (section->the_bfd_section));
          break;
 
        case LOC_REGISTER:
@@ -646,8 +635,7 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
                          outfile);
          if (section)
            fprintf_filtered (outfile, " section %s",
-                             bfd_section_name (section->the_bfd_section->owner,
-                                               section->the_bfd_section));
+                             bfd_section_name (section->the_bfd_section));
          break;
 
        case LOC_BLOCK:
@@ -663,8 +651,7 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
                          outfile);
          if (section)
            fprintf_filtered (outfile, " section %s",
-                             bfd_section_name (section->the_bfd_section->owner,
-                                               section->the_bfd_section));
+                             bfd_section_name (section->the_bfd_section));
          break;
 
        case LOC_COMPUTED:
@@ -957,7 +944,7 @@ maintenance_expand_symtabs (const char *args, int from_tty)
 /* Return the nexting depth of a block within other blocks in its symtab.  */
 
 static int
-block_depth (struct block *block)
+block_depth (const struct block *block)
 {
   int i = 0;
 
This page took 0.026256 seconds and 4 git commands to generate.