instead of builtin_type_int32 type.
(ada_evaluate_subexp) [OP_ATR_SIZE]: Likewise.
* ax-gdb.c (gen_expr) [UNOP_NEG]: Use platform-specific integer type
instead of builtin_type_int8 type.
* valarith.c (value_x_unop): Likewise.
* python/python-value.c (valpy_absolute): Avoid reference to
builtin_type_int8 type.
* eval.c (evaluate_subexp_standard): Use platform-specific integer
type instead of builtin_type_int8 as EVAL_SKIP return value type.
* ada-lang.c (ada_evaluate_subexp): Likewise.
* jv-lang.c (evaluate_subexp_java): Likewise.
* m2-lang.c (evaluate_subexp_modula2): Likewise.
* scm-lang.c (evaluate_exp): Likewise.
* value.h (value_bitstring): Add INDEX_TYPE argument.
* valops.c (value_bitstring): Add INDEX_TYPE argument, use it instead
of builtin_type_int32 as base range type.
* eval.c (evaluate_subexp_standard): Update value_bitstring call.
+2009-07-02 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * ada-lang.c (assign_component): Use platform-specific integer type
+ instead of builtin_type_int32 type.
+ (ada_evaluate_subexp) [OP_ATR_SIZE]: Likewise.
+
+ * ax-gdb.c (gen_expr) [UNOP_NEG]: Use platform-specific integer type
+ instead of builtin_type_int8 type.
+ * valarith.c (value_x_unop): Likewise.
+ * python/python-value.c (valpy_absolute): Avoid reference to
+ builtin_type_int8 type.
+
+ * eval.c (evaluate_subexp_standard): Use platform-specific integer
+ type instead of builtin_type_int8 as EVAL_SKIP return value type.
+ * ada-lang.c (ada_evaluate_subexp): Likewise.
+ * jv-lang.c (evaluate_subexp_java): Likewise.
+ * m2-lang.c (evaluate_subexp_modula2): Likewise.
+ * scm-lang.c (evaluate_exp): Likewise.
+
+ * value.h (value_bitstring): Add INDEX_TYPE argument.
+ * valops.c (value_bitstring): Add INDEX_TYPE argument, use it instead
+ of builtin_type_int32 as base range type.
+ * eval.c (evaluate_subexp_standard): Update value_bitstring call.
+
2009-07-02 Ulrich Weigand <uweigand@de.ibm.com>
* gdbtypes.c (lookup_array_range_type): Add prototype.
struct value *elt;
if (TYPE_CODE (value_type (lhs)) == TYPE_CODE_ARRAY)
{
- struct value *index_val = value_from_longest (builtin_type_int32, index);
+ struct type *index_type = builtin_type (exp->gdbarch)->builtin_int;
+ struct value *index_val = value_from_longest (index_type, index);
elt = unwrap_value (ada_value_subscript (lhs, 1, &index_val));
}
else
if (noside == EVAL_SKIP)
goto nosideret;
else if (noside == EVAL_AVOID_SIDE_EFFECTS)
- return value_zero (builtin_type_int32, not_lval);
+ return value_zero (builtin_type (exp->gdbarch)->builtin_int, not_lval);
else
- return value_from_longest (builtin_type_int32,
+ return value_from_longest (builtin_type (exp->gdbarch)->builtin_int,
TARGET_CHAR_BIT * TYPE_LENGTH (type));
case OP_ATR_VAL:
}
nosideret:
- return value_from_longest (builtin_type_int8, (LONGEST) 1);
+ return value_from_longest (builtin_type (exp->gdbarch)->builtin_int, 1);
}
\f
case UNOP_NEG:
(*pc)++;
/* -FOO is equivalent to 0 - FOO. */
- gen_int_literal (ax, &value1, (LONGEST) 0, builtin_type_int8);
+ gen_int_literal (ax, &value1, 0,
+ builtin_type (exp->gdbarch)->builtin_int);
gen_usual_unary (exp, ax, &value1); /* shouldn't do much */
gen_expr (exp, pc, ax, &value2);
gen_usual_unary (exp, ax, &value2);
+= 3 + BYTES_TO_EXP_ELEM ((tem + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT);
if (noside == EVAL_SKIP)
goto nosideret;
- return value_bitstring (&exp->elts[pc + 2].string, tem);
+ return value_bitstring (&exp->elts[pc + 2].string, tem,
+ builtin_type (exp->gdbarch)->builtin_int);
break;
case OP_ARRAY:
}
nosideret:
- return value_from_longest (builtin_type_int8, (LONGEST) 1);
+ return value_from_longest (builtin_type (exp->gdbarch)->builtin_int, 1);
}
\f
/* Evaluate a subexpression of EXP, at index *POS,
standard:
return evaluate_subexp_standard (expect_type, exp, pos, noside);
nosideret:
- return value_from_longest (builtin_type_int8, (LONGEST) 1);
+ return value_from_longest (builtin_type (exp->gdbarch)->builtin_int, 1);
}
static char *java_demangle (const char *mangled, int options)
}
nosideret:
- return value_from_longest (builtin_type_int8, (LONGEST) 1);
+ return value_from_longest (builtin_type (exp->gdbarch)->builtin_int, 1);
}
\f
static PyObject *
valpy_absolute (PyObject *self)
{
- if (value_less (((value_object *) self)->value,
- value_from_longest (builtin_type_int8, 0)))
+ struct value *value = ((value_object *) self)->value;
+ if (value_less (value, value_zero (value_type (value), not_lval)))
return valpy_negative (self);
else
return valpy_positive (self);
}
return evaluate_subexp_standard (expect_type, exp, pos, noside);
nosideret:
- return value_from_longest (builtin_type_int8, (LONGEST) 1);
+ return value_from_longest (builtin_type (exp->gdbarch)->builtin_int, 1);
}
const struct exp_descriptor exp_descriptor_scm =
struct value *
value_x_unop (struct value *arg1, enum exp_opcode op, enum noside noside)
{
+ struct gdbarch *gdbarch = current_gdbarch;
struct value **argvec;
char *ptr, *mangle_ptr;
char tstr[13], mangle_tstr[13];
break;
case UNOP_POSTINCREMENT:
strcpy (ptr, "++");
- argvec[2] = value_from_longest (builtin_type_int8, 0);
+ argvec[2] = value_from_longest (builtin_type (gdbarch)->builtin_int, 0);
argvec[3] = 0;
nargs ++;
break;
case UNOP_POSTDECREMENT:
strcpy (ptr, "--");
- argvec[2] = value_from_longest (builtin_type_int8, 0);
+ argvec[2] = value_from_longest (builtin_type (gdbarch)->builtin_int, 0);
argvec[3] = 0;
nargs ++;
break;
}
struct value *
-value_bitstring (char *ptr, int len)
+value_bitstring (char *ptr, int len, struct type *index_type)
{
struct value *val;
- struct type *domain_type = create_range_type (NULL,
- builtin_type_int32,
- 0, len - 1);
- struct type *type = create_set_type ((struct type *) NULL,
- domain_type);
+ struct type *domain_type
+ = create_range_type (NULL, index_type, 0, len - 1);
+ struct type *type = create_set_type (NULL, domain_type);
TYPE_CODE (type) = TYPE_CODE_BITSTRING;
val = allocate_value (type);
memcpy (value_contents_raw (val), ptr, TYPE_LENGTH (type));
struct type *char_type);
extern struct value *value_string (char *ptr, int len,
struct type *char_type);
-extern struct value *value_bitstring (char *ptr, int len);
+extern struct value *value_bitstring (char *ptr, int len,
+ struct type *index_type);
extern struct value *value_array (int lowbound, int highbound,
struct value **elemvec);