diff options
author | Joel Brobecker <brobecker@gnat.com> | 2007-02-28 05:59:14 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2007-02-28 05:59:14 +0000 |
commit | 52eea4ce26affa9b2ba6e482ca9d752b7c52302a (patch) | |
tree | a814a494f9bfc247e5c697683398281231fcff58 /gdb | |
parent | 46c3c2015bac0ea4d2eda92a95a946506271a8b1 (diff) | |
download | gdb-52eea4ce26affa9b2ba6e482ca9d752b7c52302a.zip gdb-52eea4ce26affa9b2ba6e482ca9d752b7c52302a.tar.gz gdb-52eea4ce26affa9b2ba6e482ca9d752b7c52302a.tar.bz2 |
* 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.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/stabsread.c | 34 |
2 files changed, 40 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1cf9a34..f14397f8 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -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. diff --git a/gdb/stabsread.c b/gdb/stabsread.c index 1e7ae8b..fa2510f 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -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': |