remove unused qf method
authorTom Tromey <tromey@redhat.com>
Wed, 7 Aug 2013 20:06:37 +0000 (20:06 +0000)
committerTom Tromey <tromey@redhat.com>
Wed, 7 Aug 2013 20:06:37 +0000 (20:06 +0000)
After the previous patch in the series, nothing uses the "quick"
method find_symbol_file.

This patch removes it.

Tested by rebuilding.

* dwarf2read.c (dw2_get_primary_filename_reader): Remove.
(dwarf2_gdb_index_functions): Update.
* psymtab.c (find_symbol_file_from_partial): Remove.
(psym_functions): Update.
* symfile.h (struct quick_symbol_functions) <find_symbol_file>:
Remove.

gdb/ChangeLog
gdb/dwarf2read.c
gdb/psymtab.c
gdb/symfile.h

index 42e60aaed064fc4585209ec6b0bce2f6536cfb20..67d997fc032f5973b9a4bb6b542146eb01561fdf 100644 (file)
@@ -1,3 +1,12 @@
+2013-08-07  Tom Tromey  <tromey@redhat.com>
+
+       * dwarf2read.c (dw2_get_primary_filename_reader): Remove.
+       (dwarf2_gdb_index_functions): Update.
+       * psymtab.c (find_symbol_file_from_partial): Remove.
+       (psym_functions): Update.
+       * symfile.h (struct quick_symbol_functions) <find_symbol_file>:
+       Remove.
+
 2013-08-07  Tom Tromey  <tromey@redhat.com>
 
        * symfile.c (set_initial_language): Look up "main" symbol
index ff901e9a88dc7afb27fa20af779d349f64fd9210..13cd12fb341861cbabcd31d27d465756c93a04cd 100644 (file)
@@ -3445,83 +3445,6 @@ dw2_expand_symtabs_with_fullname (struct objfile *objfile,
     }
 }
 
-/* A helper function for dw2_find_symbol_file that finds the primary
-   file name for a given CU.  This is a die_reader_func.  */
-
-static void
-dw2_get_primary_filename_reader (const struct die_reader_specs *reader,
-                                const gdb_byte *info_ptr,
-                                struct die_info *comp_unit_die,
-                                int has_children,
-                                void *data)
-{
-  const char **result_ptr = data;
-  struct dwarf2_cu *cu = reader->cu;
-  struct attribute *attr;
-
-  attr = dwarf2_attr (comp_unit_die, DW_AT_name, cu);
-  if (attr == NULL)
-    *result_ptr = NULL;
-  else
-    *result_ptr = DW_STRING (attr);
-}
-
-static const char *
-dw2_find_symbol_file (struct objfile *objfile, const char *name)
-{
-  struct dwarf2_per_cu_data *per_cu;
-  offset_type *vec;
-  const char *filename;
-
-  dw2_setup (objfile);
-
-  /* index_table is NULL if OBJF_READNOW.  */
-  if (!dwarf2_per_objfile->index_table)
-    {
-      struct symtab *s;
-
-      ALL_OBJFILE_PRIMARY_SYMTABS (objfile, s)
-       {
-         struct blockvector *bv = BLOCKVECTOR (s);
-         const struct block *block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
-         struct symbol *sym = lookup_block_symbol (block, name, VAR_DOMAIN);
-
-         if (sym)
-           {
-             /* Only file extension of returned filename is recognized.  */
-             return SYMBOL_SYMTAB (sym)->filename;
-           }
-       }
-      return NULL;
-    }
-
-  if (!find_slot_in_mapped_hash (dwarf2_per_objfile->index_table,
-                                name, &vec))
-    return NULL;
-
-  /* Note that this just looks at the very first one named NAME -- but
-     actually we are looking for a function.  find_main_filename
-     should be rewritten so that it doesn't require a custom hook.  It
-     could just use the ordinary symbol tables.  */
-  /* vec[0] is the length, which must always be >0.  */
-  per_cu = dw2_get_cu (GDB_INDEX_CU_VALUE (MAYBE_SWAP (vec[1])));
-
-  if (per_cu->v.quick->symtab != NULL)
-    {
-      /* Only file extension of returned filename is recognized.  */
-      return per_cu->v.quick->symtab->filename;
-    }
-
-  /* Initialize filename in case there's a problem reading the DWARF,
-     dw2_get_primary_filename_reader may not get called.  */
-  filename = NULL;
-  init_cutu_and_read_dies (per_cu, NULL, 0, 0,
-                          dw2_get_primary_filename_reader, &filename);
-
-  /* Only file extension of returned filename is recognized.  */
-  return filename;
-}
-
 static void
 dw2_map_matching_symbols (const char * name, domain_enum namespace,
                          struct objfile *objfile, int global,
@@ -3845,7 +3768,6 @@ const struct quick_symbol_functions dwarf2_gdb_index_functions =
   dw2_expand_symtabs_for_function,
   dw2_expand_all_symtabs,
   dw2_expand_symtabs_with_fullname,
-  dw2_find_symbol_file,
   dw2_map_matching_symbols,
   dw2_expand_symtabs_matching,
   dw2_find_pc_sect_symtab,
index 10bd8449a46970907b30b2dc1670fec958da5907..3bab7471bc4cf658a62ae88e2b6f0dec789054dc 100644 (file)
@@ -1206,19 +1206,6 @@ psymtab_to_fullname (struct partial_symtab *ps)
   return ps->fullname;
 }
 
-static const char *
-find_symbol_file_from_partial (struct objfile *objfile, const char *name)
-{
-  struct partial_symtab *pst;
-
-  ALL_OBJFILE_PSYMTABS_REQUIRED (objfile, pst)
-    {
-      if (lookup_partial_symbol (objfile, pst, name, 1, VAR_DOMAIN))
-       return pst->filename;
-    }
-  return NULL;
-}
-
 /*  For all symbols, s, in BLOCK that are in NAMESPACE and match NAME
     according to the function MATCH, call CALLBACK(BLOCK, s, DATA).
     BLOCK is assumed to come from OBJFILE.  Returns 1 iff CALLBACK
@@ -1442,7 +1429,6 @@ const struct quick_symbol_functions psym_functions =
   read_symtabs_for_function,
   expand_partial_symbol_tables,
   read_psymtabs_with_fullname,
-  find_symbol_file_from_partial,
   map_matching_symbols_psymtab,
   expand_symtabs_matching_via_partial,
   find_pc_sect_symtab_from_partial,
index c36e6b3737c19b180d5075ced31fe5a102af1d1c..4371cf4732c350557ecc198046877705dacd1123 100644 (file)
@@ -220,11 +220,6 @@ struct quick_symbol_functions
   void (*expand_symtabs_with_fullname) (struct objfile *objfile,
                                        const char *fullname);
 
-  /* Return the file name of the file holding the global symbol in OBJFILE
-     named NAME.  If no such symbol exists in OBJFILE, return NULL.
-     Only file extension of returned filename is recognized.  */
-  const char *(*find_symbol_file) (struct objfile *objfile, const char *name);
-
   /* Find global or static symbols in all tables that are in NAMESPACE 
      and for which MATCH (symbol name, NAME) == 0, passing each to 
      CALLBACK, reading in partial symbol tables as needed.  Look