[review] Propagate endianity to subrange types
Commit Message
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/730
......................................................................
Propagate endianity to subrange types
A subrange type should inherit its endianity from its base type.
gdb/ChangeLog
2019-11-27 Tom Tromey <tromey@adacore.com>
* gdbtypes.c (create_range_type): Inherit endianity
from base type.
Change-Id: I2998ab919dc28aeff097763c4242f9bfb90823a3
---
M gdb/ChangeLog
M gdb/gdbtypes.c
2 files changed, 8 insertions(+), 0 deletions(-)
Comments
Simon Marchi has posted comments on this change.
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/730
......................................................................
Patch Set 1:
Does this fix a theoretical problem, or does this fix a test failure?
Tom Tromey has posted comments on this change.
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/730
......................................................................
Patch Set 1:
> Patch Set 1:
>
> Does this fix a theoretical problem, or does this fix a test failure?
We had an internal test that needed this. I should have added it to this
patch, sorry. I've done that now.
I'm going to send an updated series momentarily. It fixes all the review
comments, other than the couple I replied to where I think it doesn't make
sense to make a change.
Simon Marchi has posted comments on this change.
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/730
......................................................................
Patch Set 2: Code-Review+2
@@ -1,5 +1,10 @@
2019-11-27 Tom Tromey <tromey@adacore.com>
+ * gdbtypes.c (create_range_type): Inherit endianity
+ from base type.
+
+2019-11-27 Tom Tromey <tromey@adacore.com>
+
* ada-lang.c (decode_constrained_packed_array)
(ada_value_assign, value_assign_to_component): Update.
* dwarf2loc.c (rw_pieced_value, access_memory)
@@ -945,6 +945,9 @@
if (high_bound->kind == PROP_CONST && high_bound->data.const_val < 0)
TYPE_UNSIGNED (result_type) = 0;
+ TYPE_ENDIANITY_NOT_DEFAULT (result_type)
+ = TYPE_ENDIANITY_NOT_DEFAULT (index_type);
+
return result_type;
}