aboutsummaryrefslogtreecommitdiff
path: root/gdb/eval.c
diff options
context:
space:
mode:
authorJohn Gilmore <gnu@cygnus>1992-06-19 21:09:54 +0000
committerJohn Gilmore <gnu@cygnus>1992-06-19 21:09:54 +0000
commit8f86a4e465a079a54776a83bef69bfcfa0f6014c (patch)
treebf0fa5e50a470bece6366430275fea81fdb7c857 /gdb/eval.c
parent0b909fe129911866c5db3484f1b1131872ae7df4 (diff)
downloadgdb-8f86a4e465a079a54776a83bef69bfcfa0f6014c.zip
gdb-8f86a4e465a079a54776a83bef69bfcfa0f6014c.tar.gz
gdb-8f86a4e465a079a54776a83bef69bfcfa0f6014c.tar.bz2
* remote.c (getpkt): Error if input exceeds buffer size.
(_initialize_remote): `set remotedebug' enables packet trace. * dbxread.c (process_one_symbol:N_FUN): GCC now produces relative N_SLINE's, etc, just like Sun cc on Solaris2. * am29k-tdep.c (read_register_stack, write_register_stack): Change RSTACK_HIGH_ADDR to rstack_high_address, a user-settable variable. Add `set' and `show' commands for it. * doc/gdb.texinfo: Document it. * eval.c: Avoid residue-by-zero when evaluating without side effects. (Bug and fix found by Pierre Willard.) * sparc-tdep.c: Clean up slightly for Solaris2.
Diffstat (limited to 'gdb/eval.c')
-rw-r--r--gdb/eval.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gdb/eval.c b/gdb/eval.c
index c4ba5ab..9aa3f61 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -178,6 +178,7 @@ evaluate_subexp (expect_type, exp, pos, noside)
(*pos) += 3 + ((tem + sizeof (union exp_element))
/ sizeof (union exp_element));
arg1 = value_struct_elt_for_reference (exp->elts[pc + 1].type,
+ 0,
exp->elts[pc + 1].type,
&exp->elts[pc + 2].string,
expect_type);
@@ -552,7 +553,7 @@ evaluate_subexp (expect_type, exp, pos, noside)
return value_x_binop (arg1, arg2, op, OP_NULL);
else
if (noside == EVAL_AVOID_SIDE_EFFECTS
- && op == BINOP_DIV)
+ && (op == BINOP_DIV || op == BINOP_REM))
return value_zero (VALUE_TYPE (arg1), not_lval);
else
return value_binop (arg1, arg2, op);
@@ -694,8 +695,8 @@ evaluate_subexp (expect_type, exp, pos, noside)
}
else
{
- tem = value_less (arg1, arg2);
- return value_from_longest (builtin_type_int, (LONGEST) ! tem);
+ tem = value_less (arg2, arg1) || value_equal (arg1, arg2);
+ return value_from_longest (builtin_type_int, (LONGEST) tem);
}
case BINOP_LEQ:
@@ -709,8 +710,8 @@ evaluate_subexp (expect_type, exp, pos, noside)
}
else
{
- tem = value_less (arg2, arg1);
- return value_from_longest (builtin_type_int, (LONGEST) ! tem);
+ tem = value_less (arg1, arg2) || value_equal (arg1, arg2);
+ return value_from_longest (builtin_type_int, (LONGEST) tem);
}
case BINOP_REPEAT: