mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-24 18:44:20 +08:00
* 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.
This commit is contained in:
parent
46c3c2015b
commit
52eea4ce26
@ -1,3 +1,9 @@
|
||||
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.
|
||||
|
@ -1102,6 +1102,22 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
|
||||
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);
|
||||
|
||||
@ -1185,6 +1201,24 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
|
||||
}
|
||||
|
||||
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':
|
||||
|
Loading…
Reference in New Issue
Block a user