Correct invalid assumptions made by (mostly) DWARF-2 tests
[deliverable/binutils-gdb.git] / gdb / ada-lang.c
index e46ad8e2a057d37b2cdfa8fb3560b457a8a1541c..3a024d9abeff5358a142da99d187b53c87e09039 100644 (file)
@@ -6153,7 +6153,7 @@ ada_make_symbol_completion_list (const char *text0, const char *word,
   int encoded_p;
   VEC(char_ptr) *completions = VEC_alloc (char_ptr, 128);
   struct symbol *sym;
-  struct symtab *s;
+  struct compunit_symtab *s;
   struct minimal_symbol *msymbol;
   struct objfile *objfile;
   const struct block *b, *surrounding_static_block = 0;
@@ -6232,14 +6232,12 @@ ada_make_symbol_completion_list (const char *text0, const char *word,
     }
 
   /* Go through the symtabs and check the externs and statics for
-     symbols which match.
-     Non-primary symtabs share the block vector with their primary symtabs
-     so we use ALL_PRIMARY_SYMTABS here instead of ALL_SYMTABS.  */
+     symbols which match.  */
 
-  ALL_PRIMARY_SYMTABS (objfile, s)
+  ALL_COMPUNITS (objfile, s)
   {
     QUIT;
-    b = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (s), GLOBAL_BLOCK);
+    b = BLOCKVECTOR_BLOCK (COMPUNIT_BLOCKVECTOR (s), GLOBAL_BLOCK);
     ALL_BLOCK_SYMBOLS (b, iter, sym)
     {
       symbol_completion_add (&completions, SYMBOL_LINKAGE_NAME (sym),
@@ -6248,10 +6246,10 @@ ada_make_symbol_completion_list (const char *text0, const char *word,
     }
   }
 
-  ALL_PRIMARY_SYMTABS (objfile, s)
+  ALL_COMPUNITS (objfile, s)
   {
     QUIT;
-    b = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (s), STATIC_BLOCK);
+    b = BLOCKVECTOR_BLOCK (COMPUNIT_BLOCKVECTOR (s), STATIC_BLOCK);
     /* Don't do this block twice.  */
     if (b == surrounding_static_block)
       continue;
@@ -8334,6 +8332,17 @@ ada_is_redundant_range_encoding (struct type *range_type,
 
   gdb_assert (TYPE_CODE (range_type) == TYPE_CODE_RANGE);
 
+  if (TYPE_CODE (get_base_type (range_type))
+      != TYPE_CODE (get_base_type (encoding_type)))
+    {
+      /* The compiler probably used a simple base type to describe
+        the range type instead of the range's actual base type,
+        expecting us to get the real base type from the encoding
+        anyway.  In this situation, the encoding cannot be ignored
+        as redundant.  */
+      return 0;
+    }
+
   if (is_dynamic_type (range_type))
     return 0;
 
@@ -12932,14 +12941,14 @@ static void
 ada_add_global_exceptions (regex_t *preg, VEC(ada_exc_info) **exceptions)
 {
   struct objfile *objfile;
-  struct symtab *s;
+  struct compunit_symtab *s;
 
   expand_symtabs_matching (NULL, ada_exc_search_name_matches,
                           VARIABLES_DOMAIN, preg);
 
-  ALL_PRIMARY_SYMTABS (objfile, s)
+  ALL_COMPUNITS (objfile, s)
     {
-      const struct blockvector *bv = SYMTAB_BLOCKVECTOR (s);
+      const struct blockvector *bv = COMPUNIT_BLOCKVECTOR (s);
       int i;
 
       for (i = GLOBAL_BLOCK; i <= STATIC_BLOCK; i++)
This page took 0.028688 seconds and 4 git commands to generate.