This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] type_align: handle range types the same as ints and enums


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=75ba10dc558a450c7dbcdc24f816f6709f2b29f7

commit 75ba10dc558a450c7dbcdc24f816f6709f2b29f7
Author: Joel Brobecker <brobecker@adacore.com>
Date:   Sun Feb 17 10:04:57 2019 -0500

    type_align: handle range types the same as ints and enums
    
    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).

Diff:
---
 gdb/ChangeLog  | 5 +++++
 gdb/gdbtypes.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index a5945bd..326113a 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
 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
 	instead of lookup_symbol_in_language
 	(do_exact_match): New function.
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index d1ca304..6758783 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -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.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]