Skip to content

Commit 75ba10d

Browse files
committed
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).
1 parent a2cd4f1 commit 75ba10d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

gdb/ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2019-02-17 Joel Brobecker <[email protected]>
2+
3+
* gdbtypes.c (type_align): Handle TYPE_CODE_RANGE the same as
4+
integers and enumeration types.
5+
16
2019-02-17 Joel Brobecker <[email protected]>
27

38
* ada-lang.c (standard_lookup): Use ada_lookup_encoded_symbol

gdb/gdbtypes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3003,6 +3003,7 @@ type_align (struct type *type)
30033003
case TYPE_CODE_FUNC:
30043004
case TYPE_CODE_FLAGS:
30053005
case TYPE_CODE_INT:
3006+
case TYPE_CODE_RANGE:
30063007
case TYPE_CODE_FLT:
30073008
case TYPE_CODE_ENUM:
30083009
case TYPE_CODE_REF:
@@ -3047,7 +3048,6 @@ type_align (struct type *type)
30473048
break;
30483049

30493050
case TYPE_CODE_SET:
3050-
case TYPE_CODE_RANGE:
30513051
case TYPE_CODE_STRING:
30523052
/* Not sure what to do here, and these can't appear in C or C++
30533053
anyway. */

0 commit comments

Comments
 (0)