]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
type_align: handle range types the same as ints and enums
authorJoel Brobecker <brobecker@adacore.com>
Sun, 17 Feb 2019 15:04:57 +0000 (10:04 -0500)
committerJoel Brobecker <brobecker@adacore.com>
Sun, 17 Feb 2019 15:04:57 +0000 (10:04 -0500)
This commit enhances type_align to handle TYPE_CODE_RANGE types
the same as integers and enums, rather than returning zero,
which means for this function that it could not determine its
alignment.

gdb/ChangeLog:

* gdbtypes.c (type_align): Handle TYPE_CODE_RANGE the same as
        integers and enumeration types.

Tested on x86_64-linux. Also tested on a variety of platforms
(with CPUs being ARM, AArch64, Leon3 (SPARC-like), PowerPC,
PowerPC64, RV64, Visium, x86, x86_64).

gdb/ChangeLog
gdb/gdbtypes.c

index a5945bdc68ce3910358648de5dcb63d2a22386b3..326113a12b82bab669ec053a7ed93df0ff49031d 100644 (file)
@@ -1,3 +1,8 @@
+2019-02-17  Joel Brobecker  <brobecker@adacore.com>
+
+       * gdbtypes.c (type_align): Handle TYPE_CODE_RANGE the same as
+       integers and enumeration types.
+
 2019-02-17  Joel Brobecker  <brobecker@adacore.com>
 
        * ada-lang.c (standard_lookup): Use ada_lookup_encoded_symbol
index d1ca304a9245042b11aeba24385bfc392a48244b..675878337b3287fe2237ae757790e1ae6557c465 100644 (file)
@@ -3003,6 +3003,7 @@ type_align (struct type *type)
     case TYPE_CODE_FUNC:
     case TYPE_CODE_FLAGS:
     case TYPE_CODE_INT:
+    case TYPE_CODE_RANGE:
     case TYPE_CODE_FLT:
     case TYPE_CODE_ENUM:
     case TYPE_CODE_REF:
@@ -3047,7 +3048,6 @@ type_align (struct type *type)
       break;
 
     case TYPE_CODE_SET:
-    case TYPE_CODE_RANGE:
     case TYPE_CODE_STRING:
       /* Not sure what to do here, and these can't appear in C or C++
         anyway.  */