* symfile.h (quick_symbol_functions): Clarify usage of
authorDoug Evans <dje@google.com>
Wed, 8 Dec 2010 18:04:08 +0000 (18:04 +0000)
committerDoug Evans <dje@google.com>
Wed, 8 Dec 2010 18:04:08 +0000 (18:04 +0000)
expand_symtabs_with_filename.
* dwarf2read.c (dw2_expand_symtabs_with_filename): Only iterate over
comp units, ignore type units.

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

index 17d67afc735ac026d5fc7605a9b50b3cf53f1b23..5b894700be69912dc15dfe0d92cf8cb7c928f23f 100644 (file)
@@ -1,5 +1,10 @@
 2010-12-08  Doug Evans  <dje@google.com>
 
+       * symfile.h (quick_symbol_functions): Clarify usage of
+       expand_symtabs_with_filename.
+       * dwarf2read.c (dw2_expand_symtabs_with_filename): Only iterate over
+       comp units, ignore type units.
+
        * dwarf2read.c (dw2_expand_symtabs_with_filename): Use FILENAME_CMP.
 
 2010-12-07  Doug Evans  <dje@google.com>
index 82cde1bf4f6b759032b04d51eee3a38337543b62..8801fb18f869ec27f7c8d12b1570a2b847d97159 100644 (file)
@@ -2323,8 +2323,13 @@ dw2_expand_symtabs_with_filename (struct objfile *objfile,
   int i;
 
   dw2_setup (objfile);
-  for (i = 0; i < (dwarf2_per_objfile->n_comp_units
-                  + dwarf2_per_objfile->n_type_comp_units); ++i)
+
+  /* We don't need to consider type units here.
+     This is only called for examining code, e.g. expand_line_sal.
+     There can be an order of magnitude (or more) more type units
+     than comp units, and we avoid them if we can.  */
+
+  for (i = 0; i < dwarf2_per_objfile->n_comp_units; ++i)
     {
       int j;
       struct dwarf2_per_cu_data *per_cu = dw2_get_cu (i);
index e989d5c042d6807e995e770eaf72aa4820392e93..297c1818103a7b91de75aa28a0d953f0c6915a02 100644 (file)
@@ -209,7 +209,10 @@ struct quick_symbol_functions
   void (*expand_all_symtabs) (struct objfile *objfile);
 
   /* Read all symbol tables associated with OBJFILE which have the
-     file name FILENAME.  */
+     file name FILENAME.
+     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);