Factor out print_unpacked_pointer from generic_val_print
[deliverable/binutils-gdb.git] / gdb / psymtab.c
index 383e4c4540f2330738830c997d475d5565c97466..ba677bcdbe682a355ca1d9285eeff2fe7ebf284b 100644 (file)
@@ -516,7 +516,7 @@ psym_lookup_symbol (struct objfile *objfile,
     if (!ps->readin && lookup_partial_symbol (objfile, ps, name,
                                              psymtab_index, domain))
       {
-       struct symbol *sym = NULL;
+       struct symbol *sym, *with_opaque = NULL;
        struct compunit_symtab *stab = psymtab_to_symtab (objfile, ps);
        /* Note: While psymtab_to_symtab can return NULL if the partial symtab
           is empty, we can assume it won't here because lookup_partial_symbol
@@ -524,18 +524,20 @@ psym_lookup_symbol (struct objfile *objfile,
        const struct blockvector *bv = COMPUNIT_BLOCKVECTOR (stab);
        struct block *block = BLOCKVECTOR_BLOCK (bv, block_index);
 
+       sym = block_find_symbol (block, name, domain,
+                                block_find_non_opaque_type_preferred,
+                                &with_opaque);
+
        /* Some caution must be observed with overloaded functions
-          and methods, since the psymtab will not contain any overload
+          and methods, since the index will not contain any overload
           information (but NAME might contain it).  */
-       sym = block_lookup_symbol (block, name, domain);
-
-       if (sym && strcmp_iw (SYMBOL_SEARCH_NAME (sym), name) == 0)
-         {
-           if (!TYPE_IS_OPAQUE (SYMBOL_TYPE (sym)))
-             return stab;
 
-           stab_best = stab;
-         }
+       if (sym != NULL
+           && strcmp_iw (SYMBOL_SEARCH_NAME (sym), name) == 0)
+         return stab;
+       if (with_opaque != NULL
+           && strcmp_iw (SYMBOL_SEARCH_NAME (with_opaque), name) == 0)
+         stab_best = stab;
 
        /* Keep looking through other psymtabs.  */
       }
@@ -1012,18 +1014,6 @@ dump_psymtab (struct objfile *objfile, struct partial_symtab *psymtab,
       fprintf_filtered (outfile, ")\n");
     }
 
-  fprintf_filtered (outfile, "  Relocate symbols by ");
-  for (i = 0; i < objfile->num_sections; ++i)
-    {
-      if (i != 0)
-       fprintf_filtered (outfile, ", ");
-      wrap_here ("    ");
-      fputs_filtered (paddress (gdbarch,
-                               ANOFFSET (psymtab->section_offsets, i)),
-                     outfile);
-    }
-  fprintf_filtered (outfile, "\n");
-
   fprintf_filtered (outfile, "  Symbols cover text addresses ");
   fputs_filtered (paddress (gdbarch, psymtab->textlow), outfile);
   fprintf_filtered (outfile, "-");
@@ -1524,7 +1514,6 @@ sort_pst_symbols (struct objfile *objfile, struct partial_symtab *pst)
 
 struct partial_symtab *
 start_psymtab_common (struct objfile *objfile,
-                     struct section_offsets *section_offsets,
                      const char *filename,
                      CORE_ADDR textlow, struct partial_symbol **global_syms,
                      struct partial_symbol **static_syms)
@@ -1532,7 +1521,6 @@ start_psymtab_common (struct objfile *objfile,
   struct partial_symtab *psymtab;
 
   psymtab = allocate_psymtab (filename, objfile);
-  psymtab->section_offsets = section_offsets;
   psymtab->textlow = textlow;
   psymtab->texthigh = psymtab->textlow;                /* default */
   psymtab->globals_offset = global_syms - objfile->global_psymbols.list;
This page took 0.024019 seconds and 4 git commands to generate.