fixed_point_binop did not account for division by zero. This would
lead to gdb getting SIGFPE and subsequently cause some test cases to
hang.
gdb/ChangeLog
2020-12-14 Tom Tromey <tromey@adacore.com>
* valarith.c (fixed_point_binop): Call error on division by zero.
gdb/testsuite/ChangeLog
2020-12-14 Tom Tromey <tromey@adacore.com>
* gdb.dwarf2/dw2-fixed-point.exp: Add test for division by zero.
+2020-12-14 Tom Tromey <tromey@adacore.com>
+
+ * valarith.c (fixed_point_binop): Call error on division by zero.
+
2020-12-13 Tom Tromey <tom@tromey.com>
* gdbtypes.c (safe_parse_type): Make argument const.
+2020-12-14 Tom Tromey <tromey@adacore.com>
+
+ * gdb.dwarf2/dw2-fixed-point.exp: Add test for division by zero.
+
2020-12-13 Tom de Vries <tdevries@suse.de>
PR testsuite/26953
gdb_test "print pck.fp3_var / pck.fp3_var" \
" = 1"
+gdb_test "print pck.fp3_var / 0" \
+ "Division by zero"
+
gdb_test "print pck.fp1_range_var - 0.5" \
" = 0.5"
break;
case BINOP_DIV:
+ if (mpq_sgn (v2.val) == 0)
+ error (_("Division by zero"));
mpq_div (res.val, v1.val, v2.val);
val = fixed_point_to_value (res);
break;