PR gdb/15102:
* dwarf2read.c (read_subrange_type): Use result of 'check_typedef'. gdb/testsuite * gdb.dwarf2/subrange.exp: New file.
This commit is contained in:
parent
4f3cee1ca1
commit
4c9ad8c2c0
4 changed files with 100 additions and 5 deletions
|
@ -12736,7 +12736,7 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu)
|
|||
static struct type *
|
||||
read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
|
||||
{
|
||||
struct type *base_type;
|
||||
struct type *base_type, *orig_base_type;
|
||||
struct type *range_type;
|
||||
struct attribute *attr;
|
||||
LONGEST low, high;
|
||||
|
@ -12744,9 +12744,12 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
|
|||
const char *name;
|
||||
LONGEST negative_mask;
|
||||
|
||||
base_type = die_type (die, cu);
|
||||
/* Preserve BASE_TYPE's original type, just set its LENGTH. */
|
||||
check_typedef (base_type);
|
||||
orig_base_type = die_type (die, cu);
|
||||
/* If ORIG_BASE_TYPE is a typedef, it will not be TYPE_UNSIGNED,
|
||||
whereas the real type might be. So, we use ORIG_BASE_TYPE when
|
||||
creating the range type, but we use the result of check_typedef
|
||||
when examining properties of the type. */
|
||||
base_type = check_typedef (orig_base_type);
|
||||
|
||||
/* The die_type call above may have already set the type for this DIE. */
|
||||
range_type = get_die_type (die, cu);
|
||||
|
@ -12876,7 +12879,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
|
|||
if (!TYPE_UNSIGNED (base_type) && (high & negative_mask))
|
||||
high |= negative_mask;
|
||||
|
||||
range_type = create_range_type (NULL, base_type, low, high);
|
||||
range_type = create_range_type (NULL, orig_base_type, low, high);
|
||||
|
||||
/* Mark arrays with dynamic length at least as an array of unspecified
|
||||
length. GDB could check the boundary but before it gets implemented at
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue