gdb: remove TYPE_CODE macro
[deliverable/binutils-gdb.git] / gdb / symfile.c
index 01c3f5af126e55b436cb83463ff8d87be5bdaf79..7c862d5513a276365614751d3decd030ccabe04d 100644 (file)
@@ -852,14 +852,14 @@ init_entry_point_info (struct objfile *objfile)
       /* Make certain that the address points at real code, and not a
         function descriptor.  */
       entry_point
-       = gdbarch_convert_from_func_ptr_addr (get_objfile_arch (objfile),
+       = gdbarch_convert_from_func_ptr_addr (objfile->arch (),
                                              entry_point,
                                              current_top_target ());
 
       /* Remove any ISA markers, so that this matches entries in the
         symbol table.  */
       ei->entry_point
-       = gdbarch_addr_bits_remove (get_objfile_arch (objfile), entry_point);
+       = gdbarch_addr_bits_remove (objfile->arch (), entry_point);
 
       found = 0;
       ALL_OBJFILE_OSECTIONS (objfile, osect)
@@ -1163,7 +1163,7 @@ symbol_file_add_separate (bfd *bfd, const char *name,
   symbol_file_add_with_addrs
     (bfd, name, symfile_flags, &sap,
      objfile->flags & (OBJF_REORDERED | OBJF_SHARED | OBJF_READNOW
-                      | OBJF_USERLOADED),
+                      | OBJF_USERLOADED | OBJF_MAINLINE),
      objfile);
 }
 
@@ -1667,16 +1667,7 @@ symbol_file_command (const char *args, int from_tty)
     }
 }
 
-/* Set the initial language.
-
-   FIXME: A better solution would be to record the language in the
-   psymtab when reading partial symbols, and then use it (if known) to
-   set the language.  This would be a win for formats that encode the
-   language in an easily discoverable place, such as DWARF.  For
-   stabs, we can jump through hoops looking for specially named
-   symbols or try to intuit the language from the specific type of
-   stabs we find, but we can't do that until later when we read in
-   full symbols.  */
+/* Set the initial language.  */
 
 void
 set_initial_language (void)
@@ -2783,9 +2774,7 @@ allocate_symtab (struct compunit_symtab *cust, const char *filename)
   struct symtab *symtab
     = OBSTACK_ZALLOC (&objfile->objfile_obstack, struct symtab);
 
-  symtab->filename
-    = ((const char *) objfile->per_bfd->filename_cache.insert
-       (filename, strlen (filename) + 1));
+  symtab->filename = objfile->intern (filename);
   symtab->fullname = NULL;
   symtab->language = deduce_language_from_filename (filename);
 
@@ -3009,7 +2998,7 @@ section_is_mapped (struct obj_section *osect)
     case ovly_auto:            /* overlay debugging automatic */
       /* Unles there is a gdbarch_overlay_update function,
          there's really nothing useful to do here (can't really go auto).  */
-      gdbarch = get_objfile_arch (osect->objfile);
+      gdbarch = osect->objfile->arch ();
       if (gdbarch_overlay_update_p (gdbarch))
        {
          if (overlay_cache_invalid)
@@ -3208,7 +3197,7 @@ list_overlays_command (const char *args, int from_tty)
        ALL_OBJFILE_OSECTIONS (objfile, osect)
          if (section_is_mapped (osect))
            {
-             struct gdbarch *gdbarch = get_objfile_arch (objfile);
+             struct gdbarch *gdbarch = objfile->arch ();
              const char *name;
              bfd_vma lma, vma;
              int size;
@@ -3360,20 +3349,9 @@ overlay_load_command (const char *args, int from_tty)
     error (_("This target does not know how to read its overlay state."));
 }
 
-/* Function: overlay_command
-   A place-holder for a mis-typed command.  */
-
 /* Command list chain containing all defined "overlay" subcommands.  */
 static struct cmd_list_element *overlaylist;
 
-static void
-overlay_command (const char *args, int from_tty)
-{
-  printf_unfiltered
-    ("\"overlay\" must be followed by the name of an overlay command.\n");
-  help_list (overlaylist, "overlay ", all_commands, gdb_stdout);
-}
-
 /* Target Overlays for the "Simplest" overlay manager:
 
    This is GDB's default target overlay layer.  It works with the
@@ -3475,7 +3453,7 @@ simple_read_overlay_table (void)
       return 0;
     }
 
-  gdbarch = get_objfile_arch (ovly_table_msym.objfile);
+  gdbarch = ovly_table_msym.objfile->arch ();
   word_size = gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT;
   byte_order = gdbarch_byte_order (gdbarch);
 
@@ -3504,7 +3482,7 @@ simple_overlay_update_1 (struct obj_section *osect)
 {
   int i;
   asection *bsect = osect->the_bfd_section;
-  struct gdbarch *gdbarch = get_objfile_arch (osect->objfile);
+  struct gdbarch *gdbarch = osect->objfile->arch ();
   int word_size = gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT;
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
 
@@ -3788,7 +3766,7 @@ expand_symtabs_matching
     {
       if (objfile->sf)
        objfile->sf->qf->expand_symtabs_matching (objfile, file_matcher,
-                                                 lookup_name,
+                                                 &lookup_name,
                                                  symbol_matcher,
                                                  expansion_notify, kind);
     }
@@ -3924,9 +3902,9 @@ When OFFSET is provided, FILE must also be provided.  FILE can be provided\n\
 on its own."), &cmdlist);
   set_cmd_completer (c, filename_completer);
 
-  add_prefix_cmd ("overlay", class_support, overlay_command,
-                 _("Commands for debugging overlays."), &overlaylist,
-                 "overlay ", 0, &cmdlist);
+  add_basic_prefix_cmd ("overlay", class_support,
+                       _("Commands for debugging overlays."), &overlaylist,
+                       "overlay ", 0, &cmdlist);
 
   add_com_alias ("ovly", "overlay", class_alias, 1);
   add_com_alias ("ov", "overlay", class_alias, 1);
This page took 0.027574 seconds and 4 git commands to generate.