* ada-lang.c (ada_coerce_to_simple_array_type): Use builtin_type_int32
instead of builtin_type_int as default unspecified integral type. (ada_index_type, ada_array_bound_from_type, ada_variant_discrim_type, assign_component, to_fixed_range_type): Likewise. * ada-typeprint.c (print_range, print_range_bound, print_range_type_named): Likewise. * ada-valprint.c (print_optional_low_bound, ada_val_print_1): Likewise. * eval.c (evaluate_subexp_standard): Likewise. * gnu-v2-abi.c (gnuv2_virtual_fn_field): Likewise. * gnu-v3-abi.c (gnuv3_get_virtual_fn, gnuv3_baseclass_offset, build_gdb_vtable_type): Likewise. * jv-lang.c (java_array_type): Likewise. * m2-typeprint.c (m2_print_bounds, m2_is_long_set_of_type): Likewise. * m2-valprint.c (m2_print_long_set): Likewise. * parse.c (follow_types): Likewise. * p-typeprint.c (pascal_type_print_base): Likewise. * valops.c (value_one, value_array, value_string, value_bitstring): Likewise. * value.c (allocate_repeat_value, value_from_string): Likewise. * varobj.c (c_describe_child): Likewise. * mt-tdep.c (mt_register_type): Likewise. * sh-tdep.c (sh_sh4_build_float_register_type): Likewise. * sh64-tdep.c (sh64_build_float_register_type): Likewise.
This commit is contained in:
parent
8b9b9e1a3a
commit
6d84d3d833
@ -1,3 +1,29 @@
|
||||
2008-09-11 Ulrich Weigand <uweigand@de.ibm.com>
|
||||
|
||||
* ada-lang.c (ada_coerce_to_simple_array_type): Use builtin_type_int32
|
||||
instead of builtin_type_int as default unspecified integral type.
|
||||
(ada_index_type, ada_array_bound_from_type, ada_variant_discrim_type,
|
||||
assign_component, to_fixed_range_type): Likewise.
|
||||
* ada-typeprint.c (print_range, print_range_bound,
|
||||
print_range_type_named): Likewise.
|
||||
* ada-valprint.c (print_optional_low_bound, ada_val_print_1): Likewise.
|
||||
* eval.c (evaluate_subexp_standard): Likewise.
|
||||
* gnu-v2-abi.c (gnuv2_virtual_fn_field): Likewise.
|
||||
* gnu-v3-abi.c (gnuv3_get_virtual_fn, gnuv3_baseclass_offset,
|
||||
build_gdb_vtable_type): Likewise.
|
||||
* jv-lang.c (java_array_type): Likewise.
|
||||
* m2-typeprint.c (m2_print_bounds, m2_is_long_set_of_type): Likewise.
|
||||
* m2-valprint.c (m2_print_long_set): Likewise.
|
||||
* parse.c (follow_types): Likewise.
|
||||
* p-typeprint.c (pascal_type_print_base): Likewise.
|
||||
* valops.c (value_one, value_array, value_string,
|
||||
value_bitstring): Likewise.
|
||||
* value.c (allocate_repeat_value, value_from_string): Likewise.
|
||||
* varobj.c (c_describe_child): Likewise.
|
||||
* mt-tdep.c (mt_register_type): Likewise.
|
||||
* sh-tdep.c (sh_sh4_build_float_register_type): Likewise.
|
||||
* sh64-tdep.c (sh64_build_float_register_type): Likewise.
|
||||
|
||||
2008-09-11 Ulrich Weigand <uweigand@de.ibm.com>
|
||||
|
||||
* gdbtypes.h (struct builtin_type): Remove builtin_true_char
|
||||
|
@ -1759,7 +1759,7 @@ struct type *
|
||||
ada_coerce_to_simple_array_type (struct type *type)
|
||||
{
|
||||
struct value *mark = value_mark ();
|
||||
struct value *dummy = value_from_longest (builtin_type_long, 0);
|
||||
struct value *dummy = value_from_longest (builtin_type_int32, 0);
|
||||
struct type *result;
|
||||
deprecated_set_value_type (dummy, type);
|
||||
result = ada_type_of_array (dummy, 0);
|
||||
@ -2500,7 +2500,7 @@ ada_index_type (struct type *type, int n)
|
||||
has a target type of TYPE_CODE_UNDEF. We compensate here, but
|
||||
perhaps stabsread.c would make more sense. */
|
||||
if (result_type == NULL || TYPE_CODE (result_type) == TYPE_CODE_UNDEF)
|
||||
result_type = builtin_type_int;
|
||||
result_type = builtin_type_int32;
|
||||
|
||||
return result_type;
|
||||
}
|
||||
@ -2528,7 +2528,7 @@ ada_array_bound_from_type (struct type * arr_type, int n, int which,
|
||||
if (arr_type == NULL || !ada_is_simple_array_type (arr_type))
|
||||
{
|
||||
if (typep != NULL)
|
||||
*typep = builtin_type_int;
|
||||
*typep = builtin_type_int32;
|
||||
return (LONGEST) - which;
|
||||
}
|
||||
|
||||
@ -5842,7 +5842,7 @@ ada_variant_discrim_type (struct type *var_type, struct type *outer_type)
|
||||
struct type *type =
|
||||
ada_lookup_struct_elt_type (outer_type, name, 1, 1, NULL);
|
||||
if (type == NULL)
|
||||
return builtin_type_int;
|
||||
return builtin_type_int32;
|
||||
else
|
||||
return type;
|
||||
}
|
||||
@ -8054,7 +8054,7 @@ assign_component (struct value *container, struct value *lhs, LONGEST index,
|
||||
struct value *elt;
|
||||
if (TYPE_CODE (value_type (lhs)) == TYPE_CODE_ARRAY)
|
||||
{
|
||||
struct value *index_val = value_from_longest (builtin_type_int, index);
|
||||
struct value *index_val = value_from_longest (builtin_type_int32, index);
|
||||
elt = unwrap_value (ada_value_subscript (lhs, 1, &index_val));
|
||||
}
|
||||
else
|
||||
@ -9504,7 +9504,7 @@ to_fixed_range_type (char *name, struct value *dval, struct objfile *objfile)
|
||||
char *subtype_info;
|
||||
|
||||
if (raw_type == NULL)
|
||||
base_type = builtin_type_int;
|
||||
base_type = builtin_type_int32;
|
||||
else if (TYPE_CODE (raw_type) == TYPE_CODE_RANGE)
|
||||
base_type = TYPE_TARGET_TYPE (raw_type);
|
||||
else
|
||||
|
@ -149,7 +149,7 @@ print_range (struct type *type, struct ui_file *stream)
|
||||
case TYPE_CODE_ENUM:
|
||||
break;
|
||||
default:
|
||||
target_type = builtin_type_int;
|
||||
target_type = builtin_type_int32;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -197,11 +197,11 @@ print_range_bound (struct type *type, char *bounds, int *n,
|
||||
the upper bound of the 0 .. -1 range types to be printed as
|
||||
a very large unsigned number instead of -1.
|
||||
To workaround this stabs deficiency, we replace the TYPE by
|
||||
builtin_type_long when we detect that the bound is negative,
|
||||
builtin_type_int32 when we detect that the bound is negative,
|
||||
and the type is a TYPE_CODE_INT. The bound is negative when
|
||||
'm' is the last character of the number scanned in BOUNDS. */
|
||||
if (bounds[*n - 1] == 'm' && TYPE_CODE (type) == TYPE_CODE_INT)
|
||||
type = builtin_type_long;
|
||||
type = builtin_type_int32;
|
||||
ada_print_scalar (type, B, stream);
|
||||
if (bounds[*n] == '_')
|
||||
*n += 2;
|
||||
@ -258,7 +258,7 @@ print_range_type_named (char *name, struct ui_file *stream)
|
||||
char *subtype_info;
|
||||
|
||||
if (raw_type == NULL)
|
||||
base_type = builtin_type_int;
|
||||
base_type = builtin_type_int32;
|
||||
else if (TYPE_CODE (raw_type) == TYPE_CODE_RANGE)
|
||||
base_type = TYPE_TARGET_TYPE (raw_type);
|
||||
else
|
||||
|
@ -122,7 +122,7 @@ print_optional_low_bound (struct ui_file *stream, struct type *type)
|
||||
return 0;
|
||||
break;
|
||||
case TYPE_CODE_UNDEF:
|
||||
index_type = builtin_type_long;
|
||||
index_type = builtin_type_int32;
|
||||
/* FALL THROUGH */
|
||||
default:
|
||||
if (low_bound == 1)
|
||||
@ -753,7 +753,7 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr0,
|
||||
make_pointer_type
|
||||
(create_array_type
|
||||
(NULL, builtin_type_true_char,
|
||||
create_range_type (NULL, builtin_type_int, 0, 32)), NULL);
|
||||
create_range_type (NULL, builtin_type_int32, 0, 32)), NULL);
|
||||
|
||||
printable_val =
|
||||
value_ind (value_cast (parray_of_char,
|
||||
|
@ -2028,7 +2028,7 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
|
||||
/* Construct a value node with the value of the offset */
|
||||
|
||||
arg2 = value_from_longest (builtin_type_f_integer, offset_item);
|
||||
arg2 = value_from_longest (builtin_type_int32, offset_item);
|
||||
|
||||
/* Let us now play a dirty trick: we will take arg1
|
||||
which is a value node pointing to the topmost level
|
||||
|
@ -97,7 +97,7 @@ gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j,
|
||||
struct value *entry;
|
||||
struct value *vfn;
|
||||
struct value *vtbl;
|
||||
struct value *vi = value_from_longest (builtin_type_int,
|
||||
struct value *vi = value_from_longest (builtin_type_int32,
|
||||
(LONGEST) TYPE_FN_FIELD_VOFFSET (f, j));
|
||||
struct type *fcontext = TYPE_FN_FIELD_FCONTEXT (f, j);
|
||||
struct type *context;
|
||||
|
@ -132,7 +132,7 @@ build_gdb_vtable_type (struct gdbarch *arch)
|
||||
FIELD_NAME (*field) = "vcall_and_vbase_offsets";
|
||||
FIELD_TYPE (*field)
|
||||
= create_array_type (0, ptrdiff_type,
|
||||
create_range_type (0, builtin_type_int, 0, -1));
|
||||
create_range_type (0, builtin_type_int32, 0, -1));
|
||||
FIELD_BITPOS (*field) = offset * TARGET_CHAR_BIT;
|
||||
offset += TYPE_LENGTH (FIELD_TYPE (*field));
|
||||
field++;
|
||||
@ -155,7 +155,7 @@ build_gdb_vtable_type (struct gdbarch *arch)
|
||||
FIELD_NAME (*field) = "virtual_functions";
|
||||
FIELD_TYPE (*field)
|
||||
= create_array_type (0, ptr_to_void_fn_type,
|
||||
create_range_type (0, builtin_type_int, 0, -1));
|
||||
create_range_type (0, builtin_type_int32, 0, -1));
|
||||
FIELD_BITPOS (*field) = offset * TARGET_CHAR_BIT;
|
||||
offset += TYPE_LENGTH (FIELD_TYPE (*field));
|
||||
field++;
|
||||
@ -326,7 +326,7 @@ gnuv3_get_virtual_fn (struct value *container, struct type *fntype,
|
||||
|
||||
/* Fetch the appropriate function pointer from the vtable. */
|
||||
vfn = value_subscript (value_field (vtable, vtable_field_virtual_functions),
|
||||
value_from_longest (builtin_type_int, vtable_index));
|
||||
value_from_longest (builtin_type_int32, vtable_index));
|
||||
|
||||
/* If this architecture uses function descriptors directly in the vtable,
|
||||
then the address of the vtable entry is actually a "function pointer"
|
||||
@ -429,7 +429,7 @@ gnuv3_baseclass_offset (struct type *type, int index, const bfd_byte *valaddr,
|
||||
address));
|
||||
vtable = value_at_lazy (vtable_type,
|
||||
vtable_address - vtable_address_point_offset ());
|
||||
offset_val = value_from_longest(builtin_type_int, cur_base_offset);
|
||||
offset_val = value_from_longest(builtin_type_int32, cur_base_offset);
|
||||
vbase_array = value_field (vtable, vtable_field_vcall_and_vbase_offsets);
|
||||
base_offset = value_as_long (value_subscript (vbase_array, offset_val));
|
||||
return base_offset;
|
||||
|
@ -775,7 +775,7 @@ java_array_type (struct type *type, int dims)
|
||||
|
||||
while (dims-- > 0)
|
||||
{
|
||||
range_type = create_range_type (NULL, builtin_type_int, 0, 0);
|
||||
range_type = create_range_type (NULL, builtin_type_int32, 0, 0);
|
||||
/* FIXME This is bogus! Java arrays are not gdb arrays! */
|
||||
type = create_array_type (NULL, type, range_type);
|
||||
}
|
||||
|
@ -287,7 +287,7 @@ m2_print_bounds (struct type *type,
|
||||
struct type *target = TYPE_TARGET_TYPE (type);
|
||||
|
||||
if (target == NULL)
|
||||
target = builtin_type_int;
|
||||
target = builtin_type_int32;
|
||||
|
||||
if (TYPE_NFIELDS(type) == 0)
|
||||
return;
|
||||
@ -394,7 +394,7 @@ m2_is_long_set_of_type (struct type *type, struct type **of_type)
|
||||
range = TYPE_INDEX_TYPE (TYPE_FIELD_TYPE (type, i));
|
||||
target = TYPE_TARGET_TYPE (range);
|
||||
if (target == NULL)
|
||||
target = builtin_type_int;
|
||||
target = builtin_type_int32;
|
||||
|
||||
l1 = TYPE_LOW_BOUND (TYPE_INDEX_TYPE (TYPE_FIELD_TYPE (type, i)));
|
||||
h1 = TYPE_HIGH_BOUND (TYPE_INDEX_TYPE (TYPE_FIELD_TYPE (type, len-1)));
|
||||
|
@ -119,7 +119,7 @@ m2_print_long_set (struct type *type, const gdb_byte *valaddr,
|
||||
|
||||
target = TYPE_TARGET_TYPE (range);
|
||||
if (target == NULL)
|
||||
target = builtin_type_int;
|
||||
target = builtin_type_int32;
|
||||
|
||||
if (get_discrete_bounds (range, &field_low, &field_high) >= 0)
|
||||
{
|
||||
@ -165,7 +165,7 @@ m2_print_long_set (struct type *type, const gdb_byte *valaddr,
|
||||
break;
|
||||
target = TYPE_TARGET_TYPE (range);
|
||||
if (target == NULL)
|
||||
target = builtin_type_int;
|
||||
target = builtin_type_int32;
|
||||
}
|
||||
}
|
||||
if (element_seen)
|
||||
|
@ -258,7 +258,7 @@ mt_register_type (struct gdbarch *arch, int regnum)
|
||||
if (copro_type == NULL)
|
||||
{
|
||||
struct type *temp;
|
||||
temp = create_range_type (NULL, builtin_type_unsigned_int, 0, 1);
|
||||
temp = create_range_type (NULL, builtin_type_int32, 0, 1);
|
||||
copro_type = create_array_type (NULL, builtin_type_int16, temp);
|
||||
}
|
||||
switch (regnum)
|
||||
|
@ -756,7 +756,7 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show,
|
||||
{
|
||||
struct type *target = TYPE_TARGET_TYPE (type);
|
||||
if (target == NULL)
|
||||
target = builtin_type_long;
|
||||
target = builtin_type_int32;
|
||||
print_type_scalar (target, TYPE_LOW_BOUND (type), stream);
|
||||
fputs_filtered ("..", stream);
|
||||
print_type_scalar (target, TYPE_HIGH_BOUND (type), stream);
|
||||
|
@ -1262,7 +1262,7 @@ follow_types (struct type *follow_type)
|
||||
done with it. */
|
||||
range_type =
|
||||
create_range_type ((struct type *) NULL,
|
||||
builtin_type_int, 0,
|
||||
builtin_type_int32, 0,
|
||||
array_size >= 0 ? array_size - 1 : 0);
|
||||
follow_type =
|
||||
create_array_type ((struct type *) NULL,
|
||||
|
@ -2148,7 +2148,7 @@ sh_sh4_build_float_register_type (int high)
|
||||
{
|
||||
struct type *temp;
|
||||
|
||||
temp = create_range_type (NULL, builtin_type_int, 0, high);
|
||||
temp = create_range_type (NULL, builtin_type_int32, 0, high);
|
||||
return create_array_type (NULL, builtin_type_float, temp);
|
||||
}
|
||||
|
||||
|
@ -1499,7 +1499,7 @@ sh64_build_float_register_type (int high)
|
||||
{
|
||||
struct type *temp;
|
||||
|
||||
temp = create_range_type (NULL, builtin_type_int, 0, high);
|
||||
temp = create_range_type (NULL, builtin_type_int32, 0, high);
|
||||
return create_array_type (NULL, builtin_type_float, temp);
|
||||
}
|
||||
|
||||
|
10
gdb/valops.c
10
gdb/valops.c
@ -529,11 +529,11 @@ value_one (struct type *type, enum lval_type lv)
|
||||
|
||||
if (TYPE_CODE (type1) == TYPE_CODE_DECFLOAT)
|
||||
{
|
||||
struct value *int_one = value_from_longest (builtin_type_int, 1);
|
||||
struct value *int_one = value_from_longest (builtin_type_int32, 1);
|
||||
struct value *val;
|
||||
gdb_byte v[16];
|
||||
|
||||
decimal_from_integral (int_one, v, TYPE_LENGTH (builtin_type_int));
|
||||
decimal_from_integral (int_one, v, TYPE_LENGTH (builtin_type_int32));
|
||||
val = value_from_decfloat (type, v);
|
||||
}
|
||||
else if (TYPE_CODE (type1) == TYPE_CODE_FLT)
|
||||
@ -1247,7 +1247,7 @@ value_array (int lowbound, int highbound, struct value **elemvec)
|
||||
}
|
||||
|
||||
rangetype = create_range_type ((struct type *) NULL,
|
||||
builtin_type_int,
|
||||
builtin_type_int32,
|
||||
lowbound, highbound);
|
||||
arraytype = create_array_type ((struct type *) NULL,
|
||||
value_enclosing_type (elemvec[0]),
|
||||
@ -1291,7 +1291,7 @@ value_string (char *ptr, int len)
|
||||
struct value *val;
|
||||
int lowbound = current_language->string_lower_bound;
|
||||
struct type *rangetype = create_range_type ((struct type *) NULL,
|
||||
builtin_type_int,
|
||||
builtin_type_int32,
|
||||
lowbound,
|
||||
len + lowbound - 1);
|
||||
struct type *stringtype
|
||||
@ -1321,7 +1321,7 @@ value_bitstring (char *ptr, int len)
|
||||
{
|
||||
struct value *val;
|
||||
struct type *domain_type = create_range_type (NULL,
|
||||
builtin_type_int,
|
||||
builtin_type_int32,
|
||||
0, len - 1);
|
||||
struct type *type = create_set_type ((struct type *) NULL,
|
||||
domain_type);
|
||||
|
@ -249,7 +249,7 @@ allocate_repeat_value (struct type *type, int count)
|
||||
/* FIXME-type-allocation: need a way to free this type when we are
|
||||
done with it. */
|
||||
struct type *range_type
|
||||
= create_range_type ((struct type *) NULL, builtin_type_int,
|
||||
= create_range_type ((struct type *) NULL, builtin_type_int32,
|
||||
low_bound, count + low_bound - 1);
|
||||
/* FIXME-type-allocation: need a way to free this type when we are
|
||||
done with it. */
|
||||
@ -1638,7 +1638,7 @@ value_from_string (char *ptr)
|
||||
struct type *stringtype;
|
||||
|
||||
rangetype = create_range_type ((struct type *) NULL,
|
||||
builtin_type_int,
|
||||
builtin_type_int32,
|
||||
lowbound, len + lowbound - 1);
|
||||
string_char_type = language_string_char_type (current_language,
|
||||
current_gdbarch);
|
||||
|
@ -2072,7 +2072,7 @@ c_describe_child (struct varobj *parent, int index,
|
||||
{
|
||||
int real_index = index + TYPE_LOW_BOUND (TYPE_INDEX_TYPE (type));
|
||||
struct value *indval =
|
||||
value_from_longest (builtin_type_int, (LONGEST) real_index);
|
||||
value_from_longest (builtin_type_int32, (LONGEST) real_index);
|
||||
gdb_value_subscript (value, indval, cvalue);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user