gdb/
authorJan Kratochvil <jan.kratochvil@redhat.com>
Sun, 3 Feb 2013 16:03:07 +0000 (16:03 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Sun, 3 Feb 2013 16:03:07 +0000 (16:03 +0000)
Code cleanup.
* dwarf2read.c (dw2_expand_symtabs_with_filename): Rename to ...
(dw2_expand_symtabs_with_fullname): ... here.  Rename parameter
filename to fullname.  Rename variable this_name to this_fullname.
Lowercase FILENAME_CMP call.
(dw2_find_symbol_file): New comment for the returned string.
(dwarf2_gdb_index_functions): Rename the function to
dw2_expand_symtabs_with_fullname.
* psymtab.c (read_psymtabs_with_filename): Rename to ...
(read_psymtabs_with_fullname): ... here.  Rename parameter filename to
fullname.
(psym_functions): Rename the function to read_psymtabs_with_fullname.
* symfile.h (struct quick_symbol_functions): Rename field
expand_symtabs_with_filename to expand_symtabs_with_fullname and its
parameter filename to fullname.  Document returned string meaning for
find_symbol_file.
* symtab.c (find_line_symtab): Rename the called function to
expand_symtabs_with_fullname.

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

index 4a71f5271486b522a897c5b0039d83e173b4b0dc..2b3899fe191fcda2bee8063d7a25a9bfae220a41 100644 (file)
@@ -1,3 +1,24 @@
+2013-02-03  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Code cleanup.
+       * dwarf2read.c (dw2_expand_symtabs_with_filename): Rename to ...
+       (dw2_expand_symtabs_with_fullname): ... here.  Rename parameter
+       filename to fullname.  Rename variable this_name to this_fullname.
+       Lowercase FILENAME_CMP call.
+       (dw2_find_symbol_file): New comment for the returned string.
+       (dwarf2_gdb_index_functions): Rename the function to
+       dw2_expand_symtabs_with_fullname.
+       * psymtab.c (read_psymtabs_with_filename): Rename to ...
+       (read_psymtabs_with_fullname): ... here.  Rename parameter filename to
+       fullname.
+       (psym_functions): Rename the function to read_psymtabs_with_fullname.
+       * symfile.h (struct quick_symbol_functions): Rename field
+       expand_symtabs_with_filename to expand_symtabs_with_fullname and its
+       parameter filename to fullname.  Document returned string meaning for
+       find_symbol_file.
+       * symtab.c (find_line_symtab): Rename the called function to
+       expand_symtabs_with_fullname.
+
 2013-02-03  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        Code cleanup.
index 51ab2b40840608e4a596a65ee267870b6caae8ae..924b6b8dbea622968221edea4e52cede78ce3d71 100644 (file)
@@ -3343,8 +3343,8 @@ dw2_expand_all_symtabs (struct objfile *objfile)
 }
 
 static void
-dw2_expand_symtabs_with_filename (struct objfile *objfile,
-                                 const char *filename)
+dw2_expand_symtabs_with_fullname (struct objfile *objfile,
+                                 const char *fullname)
 {
   int i;
 
@@ -3371,8 +3371,9 @@ dw2_expand_symtabs_with_filename (struct objfile *objfile,
 
       for (j = 0; j < file_data->num_file_names; ++j)
        {
-         const char *this_name = file_data->file_names[j];
-         if (FILENAME_CMP (this_name, filename) == 0)
+         const char *this_fullname = file_data->file_names[j];
+
+         if (filename_cmp (this_fullname, fullname) == 0)
            {
              dw2_instantiate_symtab (per_cu);
              break;
@@ -3423,7 +3424,10 @@ dw2_find_symbol_file (struct objfile *objfile, const char *name)
          struct symbol *sym = lookup_block_symbol (block, name, VAR_DOMAIN);
 
          if (sym)
-           return SYMBOL_SYMTAB (sym)->filename;
+           {
+             /* Only file extension of returned filename is recognized.  */
+             return SYMBOL_SYMTAB (sym)->filename;
+           }
        }
       return NULL;
     }
@@ -3440,11 +3444,15 @@ dw2_find_symbol_file (struct objfile *objfile, const char *name)
   per_cu = dw2_get_cu (GDB_INDEX_CU_VALUE (MAYBE_SWAP (vec[1])));
 
   if (per_cu->v.quick->symtab != NULL)
-    return per_cu->v.quick->symtab->filename;
+    {
+      /* Only file extension of returned filename is recognized.  */
+      return per_cu->v.quick->symtab->filename;
+    }
 
   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;
 }
 
@@ -3743,7 +3751,7 @@ const struct quick_symbol_functions dwarf2_gdb_index_functions =
   dw2_relocate,
   dw2_expand_symtabs_for_function,
   dw2_expand_all_symtabs,
-  dw2_expand_symtabs_with_filename,
+  dw2_expand_symtabs_with_fullname,
   dw2_find_symbol_file,
   dw2_map_matching_symbols,
   dw2_expand_symtabs_matching,
index 4e5ffb8da18e109187ae2ccbf159c028aece89be..c6f994e5f7648717a58f3085997ca35550cc329e 100644 (file)
@@ -1096,7 +1096,7 @@ expand_partial_symbol_tables (struct objfile *objfile)
 }
 
 static void
-read_psymtabs_with_filename (struct objfile *objfile, const char *filename)
+read_psymtabs_with_fullname (struct objfile *objfile, const char *fullname)
 {
   struct partial_symtab *p;
 
@@ -1106,7 +1106,7 @@ read_psymtabs_with_filename (struct objfile *objfile, const char *filename)
       if (p->anonymous)
        continue;
 
-      if (filename_cmp (filename, p->filename) == 0)
+      if (filename_cmp (fullname, p->filename) == 0)
        psymtab_to_symtab (objfile, p);
     }
 }
@@ -1401,7 +1401,7 @@ const struct quick_symbol_functions psym_functions =
   relocate_psymtabs,
   read_symtabs_for_function,
   expand_partial_symbol_tables,
-  read_psymtabs_with_filename,
+  read_psymtabs_with_fullname,
   find_symbol_file_from_partial,
   map_matching_symbols_psymtab,
   expand_symtabs_matching_via_partial,
index aec21486b781d0be5905d51680d2f0ef28f926e9..2a0d65682f638a5425f2b8c59306539ea487848d 100644 (file)
@@ -212,16 +212,17 @@ struct quick_symbol_functions
   /* Read all symbol tables associated with OBJFILE.  */
   void (*expand_all_symtabs) (struct objfile *objfile);
 
-  /* Read all symbol tables associated with OBJFILE which have the
-     file name FILENAME.
+  /* Read all symbol tables associated with OBJFILE which have
+     symtab_to_fullname equal to FULLNAME.
      This is for the purposes of examining code only, e.g., expand_line_sal.
      The routine may ignore debug info that is known to not be useful with
      code, e.g., DW_TAG_type_unit for dwarf debug info.  */
-  void (*expand_symtabs_with_filename) (struct objfile *objfile,
-                                       const char *filename);
+  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.  */
+     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 
index 15c845e66cb5d615a30a22721e42772ae9100eea..690cda1ff55e4b027554644d665a48d3fd0ae173 100644 (file)
@@ -2501,7 +2501,7 @@ find_line_symtab (struct symtab *symtab, int line,
       ALL_OBJFILES (objfile)
       {
        if (objfile->sf)
-         objfile->sf->qf->expand_symtabs_with_filename (objfile,
+         objfile->sf->qf->expand_symtabs_with_fullname (objfile,
                                                         symtab->filename);
       }