diff options
author | Joel Brobecker <brobecker@gnat.com> | 2008-04-19 01:33:26 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2008-04-19 01:33:26 +0000 |
commit | 9e3867569f23210a07737188f53486630f2a4049 (patch) | |
tree | c041c02389c6cdba4e462436d92a5ed1ef036e3b | |
parent | eca56c549e55f73cc5cea8712a25969bfef1033f (diff) | |
download | gdb-9e3867569f23210a07737188f53486630f2a4049.zip gdb-9e3867569f23210a07737188f53486630f2a4049.tar.gz gdb-9e3867569f23210a07737188f53486630f2a4049.tar.bz2 |
* stabsread.c (cleanup_undefined_types_1): Add instance flags check
in the search for the matching symbol.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/stabsread.c | 24 |
2 files changed, 28 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2b6bfd2..7207d20 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2008-04-18 Joel Brobecker <brobecker@adacore.com> + + * stabsread.c (cleanup_undefined_types_1): Add instance flags check + in the search for the matching symbol. + 2008-04-17 Marc Khouzam <marc.khouzam@ericsson.com> * breakpoint.c (update_watchpoint): Always reparse diff --git a/gdb/stabsread.c b/gdb/stabsread.c index 3b747b4..6d6b094 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -4294,6 +4294,25 @@ cleanup_undefined_types_1 (void) { struct type **type; + /* Iterate over every undefined type, and look for a symbol whose type + matches our undefined type. The symbol matches if: + 1. It is a typedef in the STRUCT domain; + 2. It has the same name, and same type code; + 3. The instance flags are identical. + + It is important to check the instance flags, because we have seen + examples where the debug info contained definitions such as: + + "foo_t:t30=B31=xefoo_t:" + + In this case, we have created an undefined type named "foo_t" whose + instance flags is null (when processing "xefoo_t"), and then created + another type with the same name, but with different instance flags + ('B' means volatile). I think that the definition above is wrong, + since the same type cannot be volatile and non-volatile at the same + time, but we need to be able to cope with it when it happens. The + approach taken here is to treat these two types as different. */ + for (type = undef_types; type < undef_types + undef_types_length; type++) { switch (TYPE_CODE (*type)) @@ -4329,7 +4348,10 @@ cleanup_undefined_types_1 (void) && SYMBOL_DOMAIN (sym) == STRUCT_DOMAIN && (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE (*type)) - && strcmp (DEPRECATED_SYMBOL_NAME (sym), typename) == 0) + && (TYPE_INSTANCE_FLAGS (*type) == + TYPE_INSTANCE_FLAGS (SYMBOL_TYPE (sym))) + && strcmp (DEPRECATED_SYMBOL_NAME (sym), + typename) == 0) replace_type (*type, SYMBOL_TYPE (sym)); } } |