+2007-02-07 Joel Brobecker <brobecker@adacore.com>
+
+ * stabsread.c (define_symbol): Create an associated STRUCT_DOMAIN
+ symbol for Ada units when the symbol is defined using 't' rather
+ than 'Tt' as symbol descriptor.
+
2007-02-28 Vladimir Prus <vladimir@codesourcery.com>
* config/mips/tm-nbsd.h: Delete file.
break;
case 't':
+ /* In Ada, there is no distinction between typedef and non-typedef;
+ any type declaration implicitly has the equivalent of a typedef,
+ and thus 't' is in fact equivalent to 'Tt'.
+
+ Therefore, for Ada units, we check the character immediately
+ before the 't', and if we do not find a 'T', then make sure to
+ create the associated symbol in the STRUCT_DOMAIN ('t' definitions
+ will be stored in the VAR_DOMAIN). If the symbol was indeed
+ defined as 'Tt' then the STRUCT_DOMAIN symbol will be created
+ elsewhere, so we don't need to take care of that.
+
+ This is important to do, because of forward references:
+ The cleanup of undefined types stored in undef_types only uses
+ STRUCT_DOMAIN symbols to perform the replacement. */
+ synonym = (SYMBOL_LANGUAGE (sym) == language_ada && p[-2] != 'T');
+
/* Typedef */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
}
add_symbol_to_list (sym, &file_symbols);
+
+ if (synonym)
+ {
+ /* Create the STRUCT_DOMAIN clone. */
+ struct symbol *struct_sym = (struct symbol *)
+ obstack_alloc (&objfile->objfile_obstack, sizeof (struct symbol));
+
+ *struct_sym = *sym;
+ SYMBOL_CLASS (struct_sym) = LOC_TYPEDEF;
+ SYMBOL_VALUE (struct_sym) = valu;
+ SYMBOL_DOMAIN (struct_sym) = STRUCT_DOMAIN;
+ if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
+ TYPE_NAME (SYMBOL_TYPE (sym))
+ = obconcat (&objfile->objfile_obstack, "", "",
+ DEPRECATED_SYMBOL_NAME (sym));
+ add_symbol_to_list (struct_sym, &file_symbols);
+ }
+
break;
case 'T':