I noticed that watchpoint_exp_is_const should return bool; this patch
implements this change.
gdb/ChangeLog
2020-11-21 Tom Tromey <tom@tromey.com>
* breakpoint.c (watchpoint_exp_is_const): Return bool.
+2020-11-21 Tom Tromey <tom@tromey.com>
+
+ * breakpoint.c (watchpoint_exp_is_const): Return bool.
+
2020-11-20 Simon Marchi <simon.marchi@polymtl.ca>
* unittests/gmp-utils-selftests.c (gdb_mpz_read_all_from_small):
some constant expressions and in such case still falsely return
zero. */
-static int
+static bool
watchpoint_exp_is_const (const struct expression *exp)
{
int i = exp->nelts;
if (SYMBOL_CLASS (s) != LOC_BLOCK
&& SYMBOL_CLASS (s) != LOC_CONST
&& SYMBOL_CLASS (s) != LOC_CONST_BYTES)
- return 0;
+ return false;
break;
}
the optimistic approach here: If we don't know something,
then it is not a constant. */
default:
- return 0;
+ return false;
}
}
- return 1;
+ return true;
}
/* Watchpoint destructor. */