aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/ada-lang.c11
2 files changed, 17 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 5f58e6c..75b739e 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2014-11-20 Joel Brobecker <brobecker@adacore.com>
+
+ * ada-lang.c (ada_is_redundant_range_encoding): Return 0
+ if the TYPE_CODE of range_type's base type does not match
+ the TYPE_CODE of encoding_type's base type.
+
2014-11-19 Joel Brobecker <brobecker@adacore.com>
* ada-lang.c (ada_unqualified_name): Return DECODED_NAME if
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index e46ad8e..122aaf4 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -8334,6 +8334,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;