[review] Propagate endianity to subrange types

Message ID gerrit.1574880479000.I2998ab919dc28aeff097763c4242f9bfb90823a3@gnutoolchain-gerrit.osci.io
State New
Headers show
Series
  • [review] Propagate endianity to subrange types
Related show

Commit Message

Tankut Baris Aktemur (Code Review) Nov. 27, 2019, 6:48 p.m.
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(-)




-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: I2998ab919dc28aeff097763c4242f9bfb90823a3
Gerrit-Change-Number: 730
Gerrit-PatchSet: 1
Gerrit-Owner: Tom Tromey <tromey@sourceware.org>
Gerrit-MessageType: newchange

Comments

Tankut Baris Aktemur (Code Review) Nov. 27, 2019, 10:09 p.m. | #1
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?


-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: I2998ab919dc28aeff097763c4242f9bfb90823a3
Gerrit-Change-Number: 730
Gerrit-PatchSet: 1
Gerrit-Owner: Tom Tromey <tromey@sourceware.org>
Gerrit-CC: Simon Marchi <simon.marchi@polymtl.ca>
Gerrit-Comment-Date: Wed, 27 Nov 2019 22:09:46 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Tankut Baris Aktemur (Code Review) Dec. 4, 2019, 2:27 p.m. | #2
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.


-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: I2998ab919dc28aeff097763c4242f9bfb90823a3
Gerrit-Change-Number: 730
Gerrit-PatchSet: 1
Gerrit-Owner: Tom Tromey <tromey@sourceware.org>
Gerrit-Reviewer: Tom Tromey <tromey@sourceware.org>
Gerrit-CC: Simon Marchi <simon.marchi@polymtl.ca>
Gerrit-Comment-Date: Wed, 04 Dec 2019 14:27:47 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Tankut Baris Aktemur (Code Review) Dec. 4, 2019, 3:46 p.m. | #3
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


-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: I2998ab919dc28aeff097763c4242f9bfb90823a3
Gerrit-Change-Number: 730
Gerrit-PatchSet: 2
Gerrit-Owner: Tom Tromey <tromey@sourceware.org>
Gerrit-Reviewer: Simon Marchi <simon.marchi@polymtl.ca>
Gerrit-Reviewer: Tom Tromey <tromey@sourceware.org>
Gerrit-Comment-Date: Wed, 04 Dec 2019 15:46:16 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

Patch

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 58f7f46..590ad25 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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)
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 31bfa47..c4e49ef 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -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;
 }