aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2008-09-11 14:18:34 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2008-09-11 14:18:34 +0000
commita53b7a21e59731ac4d6980b7787edcf2eb61944f (patch)
treea9d7cc16d789835a000e8f975425af184bc6ddda
parent22fe0fbb30429cd8f4f086a1da5d4821433e6a41 (diff)
downloadgdb-a53b7a21e59731ac4d6980b7787edcf2eb61944f.zip
gdb-a53b7a21e59731ac4d6980b7787edcf2eb61944f.tar.gz
gdb-a53b7a21e59731ac4d6980b7787edcf2eb61944f.tar.bz2
* ada-lang.c (cast_to_fixed): Do not cast to builtin_type_double.
(cast_from_fixed_to_double): Rename to ... (cast_from_fixed): ... this. Add TYPE parameter. Use it instead of builtin_type_double. (ada_value_cast): Use cast_from_fixed instead of casting result of cast_from_fixed_to_double. (ada_evaluate_subexp): Update calls to cast_from_fixed_to_double.
-rw-r--r--gdb/ChangeLog10
-rw-r--r--gdb/ada-lang.c14
2 files changed, 17 insertions, 7 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index aedacce..b95c735 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,15 @@
2008-09-11 Ulrich Weigand <uweigand@de.ibm.com>
+ * ada-lang.c (cast_to_fixed): Do not cast to builtin_type_double.
+ (cast_from_fixed_to_double): Rename to ...
+ (cast_from_fixed): ... this. Add TYPE parameter. Use it instead
+ of builtin_type_double.
+ (ada_value_cast): Use cast_from_fixed instead of casting result
+ of cast_from_fixed_to_double.
+ (ada_evaluate_subexp): Update calls to cast_from_fixed_to_double.
+
+2008-09-11 Ulrich Weigand <uweigand@de.ibm.com>
+
* valops.c (value_ind): No longer allow dereferencing an
integer type.
* eval.c (evaluate_subexp_standard): Handle deferencing an
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 75a9828..74b2194 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -7882,8 +7882,7 @@ cast_to_fixed (struct type *type, struct value *arg)
value_as_long (arg)));
else
{
- DOUBLEST argd =
- value_as_double (value_cast (builtin_type_double, value_copy (arg)));
+ DOUBLEST argd = value_as_double (arg);
val = ada_float_to_fixed (type, argd);
}
@@ -7891,11 +7890,11 @@ cast_to_fixed (struct type *type, struct value *arg)
}
static struct value *
-cast_from_fixed_to_double (struct value *arg)
+cast_from_fixed (struct type *type, struct value *arg)
{
DOUBLEST val = ada_fixed_to_float (value_type (arg),
value_as_long (arg));
- return value_from_double (builtin_type_double, val);
+ return value_from_double (type, val);
}
/* Coerce VAL as necessary for assignment to an lval of type TYPE, and
@@ -8349,7 +8348,7 @@ ada_value_cast (struct type *type, struct value *arg2, enum noside noside)
return (cast_to_fixed (type, arg2));
if (ada_is_fixed_point_type (value_type (arg2)))
- return value_cast (type, cast_from_fixed_to_double (arg2));
+ return cast_from_fixed (type, arg2);
return value_cast (type, arg2);
}
@@ -8499,10 +8498,11 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
return value_zero (value_type (arg1), not_lval);
else
{
+ type = builtin_type (exp->gdbarch)->builtin_double;
if (ada_is_fixed_point_type (value_type (arg1)))
- arg1 = cast_from_fixed_to_double (arg1);
+ arg1 = cast_from_fixed (type, arg1);
if (ada_is_fixed_point_type (value_type (arg2)))
- arg2 = cast_from_fixed_to_double (arg2);
+ arg2 = cast_from_fixed (type, arg2);
binop_promote (exp->language_defn, exp->gdbarch, &arg1, &arg2);
return ada_value_binop (arg1, arg2, op);
}