summaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2007-12-28 13:06:17 +0000
committerJoel Brobecker <brobecker@gnat.com>2007-12-28 13:06:17 +0000
commitf0ededda4b122f34a37eec60292e42eb5527ca99 (patch)
treee135e9a8e8dc201da4b90abab060b0ba47057d15 /gdb
parentacdcc9323bc00eec1a87a2aabdeacce9524d5cc2 (diff)
downloadgdb-f0ededda4b122f34a37eec60292e42eb5527ca99.tar.gz
* ada-lang.c (ada_evaluate_subexp): Break two large expressions
using temporary variables.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/ada-lang.c26
2 files changed, 21 insertions, 10 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 6dd38b8103b..cf6379078fa 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2007-12-28 Joel Brobecker <brobecker@adacore.com>
+
+ * ada-lang.c (ada_evaluate_subexp): Break two large expressions
+ using temporary variables.
+
2007-12-27 Joel Brobecker <brobecker@adacore.com>
* ada-lang.c (ada_value_cast): New function, extracted out from
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 1a0422e7f81..93b5dec67ff 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -8163,20 +8163,26 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
case BINOP_LOGICAL_AND:
case BINOP_LOGICAL_OR:
case UNOP_LOGICAL_NOT:
- *pos -= 1;
- return value_cast (LA_BOOL_TYPE,
- evaluate_subexp_standard (expect_type, exp,
- pos, noside));
+ {
+ struct value *val;
+
+ *pos -= 1;
+ val = evaluate_subexp_standard (expect_type, exp, pos, noside);
+ return value_cast (LA_BOOL_TYPE, val);
+ }
case BINOP_BITWISE_AND:
case BINOP_BITWISE_IOR:
case BINOP_BITWISE_XOR:
- arg1 = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_AVOID_SIDE_EFFECTS);
- *pos = pc;
- return value_cast (value_type (arg1),
- evaluate_subexp_standard (expect_type, exp,
- pos, noside));
-
+ {
+ struct value *val;
+
+ arg1 = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_AVOID_SIDE_EFFECTS);
+ *pos = pc;
+ val = evaluate_subexp_standard (expect_type, exp, pos, noside);
+
+ return value_cast (value_type (arg1), val);
+ }
case OP_VAR_VALUE:
*pos -= 1;