* psympriv.h (struct partial_symtab): New member "anonymous".
authorDoug Evans <dje@google.com>
Tue, 10 Jul 2012 20:17:30 +0000 (20:17 +0000)
committerDoug Evans <dje@google.com>
Tue, 10 Jul 2012 20:17:30 +0000 (20:17 +0000)
* psymtab.c (partial_map_symtabs_matching_filename): Ignore
anonymous psymtabs.
(read_psymtabs_with_filename): Ditto.
(map_symbol_filenames_psymtab, psymtab_to_fullname): Ditto.
(expand_symtabs_matching_via_partial): Ditto.
(dump_psymtab): Update.

gdb/ChangeLog
gdb/psympriv.h
gdb/psymtab.c

index ea490d9d41d3a91e86cb244bcfebde251991947a..0b3ec5593a3cf466b5f66b3e075bf5be7781e12e 100644 (file)
@@ -1,5 +1,12 @@
 2012-07-10  Doug Evans  <dje@google.com>
 
+       * psympriv.h (struct partial_symtab): New member "anonymous".
+       * psymtab.c (partial_map_symtabs_matching_filename): Ignore
+       anonymous psymtabs.
+       (read_psymtabs_with_filename): Ditto.
+       (map_symbol_filenames_psymtab, psymtab_to_fullname): Ditto.
+       (expand_symtabs_matching_via_partial): Ditto.
+       (dump_psymtab): Update.
        * dictionary.c (dict_add_pending): New function.
        * dictionary.h (dict_add_pending): Declare.
 
index 370ce86b3159ff83b7879e8fcb4cf0cadcf64e83..16b9b83f902e61cd823ac408524f8e3c09eec1f3 100644 (file)
@@ -82,7 +82,9 @@ struct partial_symtab
 
   struct partial_symtab *next;
 
-  /* Name of the source file which this partial_symtab defines.  */
+  /* Name of the source file which this partial_symtab defines,
+     or if the psymtab is anonymous then a descriptive name for
+     debugging purposes, or "".  It must not be NULL.  */
 
   const char *filename;
 
@@ -182,6 +184,10 @@ struct partial_symtab
 
   unsigned char psymtabs_addrmap_supported;
 
+  /* True if the name of this partial symtab is not a source file name.  */
+
+  unsigned char anonymous;
+
   /* A flag that is temporarily used when searching psymtabs.  */
 
   ENUM_BITFIELD (psymtab_search_status) searched_flag : 2;
index 5366d947393952fecc5a972798ceb2b55ce06c91..6e84094758767355b36282e120aaa80f8612892d 100644 (file)
@@ -174,6 +174,10 @@ partial_map_symtabs_matching_filename (struct objfile *objfile,
     if (pst->user != NULL)
       continue;
 
+    /* Anonymous psymtabs don't have a file name.  */
+    if (pst->anonymous)
+      continue;
+
     if (FILENAME_CMP (name, pst->filename) == 0
        || (!is_abs && compare_filenames_for_search (pst->filename,
                                                     name, name_len)))
@@ -973,8 +977,16 @@ dump_psymtab (struct objfile *objfile, struct partial_symtab *psymtab,
   struct gdbarch *gdbarch = get_objfile_arch (objfile);
   int i;
 
-  fprintf_filtered (outfile, "\nPartial symtab for source file %s ",
-                   psymtab->filename);
+  if (psymtab->anonymous)
+    {
+      fprintf_filtered (outfile, "\nAnonymous partial symtab (%s) ",
+                       psymtab->filename);
+    }
+  else
+    {
+      fprintf_filtered (outfile, "\nPartial symtab for source file %s ",
+                       psymtab->filename);
+    }
   fprintf_filtered (outfile, "(object ");
   gdb_print_host_address (psymtab, outfile);
   fprintf_filtered (outfile, ")\n\n");
@@ -1124,6 +1136,10 @@ read_psymtabs_with_filename (struct objfile *objfile, const char *filename)
 
   ALL_OBJFILE_PSYMTABS_REQUIRED (objfile, p)
     {
+      /* Anonymous psymtabs don't have a name of a source file.  */
+      if (p->anonymous)
+       continue;
+
       if (filename_cmp (filename, p->filename) == 0)
        psymtab_to_symtab (p);
     }
@@ -1143,6 +1159,10 @@ map_symbol_filenames_psymtab (struct objfile *objfile,
       if (ps->readin)
        continue;
 
+      /* Anonymous psymtabs don't have a file name.  */
+      if (ps->anonymous)
+       continue;
+
       QUIT;
       if (need_fullname)
        fullname = psymtab_to_fullname (ps);
@@ -1167,6 +1187,8 @@ psymtab_to_fullname (struct partial_symtab *ps)
 
   if (!ps)
     return NULL;
+  if (ps->anonymous)
+    return NULL;
 
   /* Use cached copy if we have it.
      We rely on forget_cached_source_info being called appropriately
@@ -1377,8 +1399,13 @@ expand_symtabs_matching_via_partial
       if (ps->user != NULL)
        continue;
 
-      if (file_matcher && ! (*file_matcher) (ps->filename, data))
-       continue;
+      if (file_matcher)
+       {
+         if (ps->anonymous)
+           continue;
+         if (! (*file_matcher) (ps->filename, data))
+           continue;
+       }
 
       if (recursively_search_psymtabs (ps, objfile, kind, name_matcher, data))
        psymtab_to_symtab (ps);
This page took 0.036911 seconds and 4 git commands to generate.