summaryrefslogtreecommitdiff
path: root/gdb/valarith.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2010-01-20 18:06:13 +0000
committerTom Tromey <tromey@redhat.com>2010-01-20 18:06:13 +0000
commit4f6fe059caecec9e688a2b27fce29a427fd7de9c (patch)
treef16b9b6fc220f8d733dd799977973727c522467e /gdb/valarith.c
parentefca436ee3ce532149a7e568149edf93a75a9a5e (diff)
downloadgdb-4f6fe059caecec9e688a2b27fce29a427fd7de9c.tar.gz
gdb
PR backtrace/10770: * valarith.c (value_binop): Handle BINOP_GTR, BINOP_LEQ, and BINOP_GEQ. Handle BINOP_NOTEQUAL in the signed case. * dwarf2expr.c (new_dwarf_expr_context): Allocate dwarf_stack_values, not CORE_ADDRs. (execute_stack_op): Change DW_OP_div and comparison operators to use signed operands. gdb/testsuite PR backtrace/10770: * gdb.dwarf2/pr10770.exp: New file. * gdb.dwarf2/pr10770.c: New file. * gdb.dwarf2/Makefile.in (EXECUTABLES): Add pr10770.
Diffstat (limited to 'gdb/valarith.c')
-rw-r--r--gdb/valarith.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/gdb/valarith.c b/gdb/valarith.c
index 2b66f850e78..ed76b0960ba 100644
--- a/gdb/valarith.c
+++ b/gdb/valarith.c
@@ -1128,6 +1128,18 @@ value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op)
v = v1 < v2;
break;
+ case BINOP_GTR:
+ v = v1 > v2;
+ break;
+
+ case BINOP_LEQ:
+ v = v1 <= v2;
+ break;
+
+ case BINOP_GEQ:
+ v = v1 >= v2;
+ break;
+
default:
error (_("Invalid binary operation on numbers."));
}
@@ -1237,10 +1249,26 @@ value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op)
v = v1 == v2;
break;
+ case BINOP_NOTEQUAL:
+ v = v1 != v2;
+ break;
+
case BINOP_LESS:
v = v1 < v2;
break;
+ case BINOP_GTR:
+ v = v1 > v2;
+ break;
+
+ case BINOP_LEQ:
+ v = v1 <= v2;
+ break;
+
+ case BINOP_GEQ:
+ v = v1 >= v2;
+ break;
+
default:
error (_("Invalid binary operation on numbers."));
}