aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2020-11-21 09:16:41 -0700
committerTom Tromey <tom@tromey.com>2020-11-21 09:16:41 -0700
commitdab7264398ba8f7c476ffbdc965880270ae55c53 (patch)
tree459daa24c08263ff947fd16f3ba9a510eda15104 /gdb
parentabd20cb637008da9d32018b4b03973e119388a0a (diff)
downloadfsf-binutils-gdb-dab7264398ba8f7c476ffbdc965880270ae55c53.zip
fsf-binutils-gdb-dab7264398ba8f7c476ffbdc965880270ae55c53.tar.gz
fsf-binutils-gdb-dab7264398ba8f7c476ffbdc965880270ae55c53.tar.bz2
Change watchpoint_exp_is_const to return bool
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.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/breakpoint.c8
2 files changed, 8 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 4663f56..3d516df 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+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):
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 27324a0..61fbc3b 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -10084,7 +10084,7 @@ break_range_command (const char *arg, int from_tty)
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;
@@ -10177,7 +10177,7 @@ watchpoint_exp_is_const (const struct expression *exp)
if (SYMBOL_CLASS (s) != LOC_BLOCK
&& SYMBOL_CLASS (s) != LOC_CONST
&& SYMBOL_CLASS (s) != LOC_CONST_BYTES)
- return 0;
+ return false;
break;
}
@@ -10185,11 +10185,11 @@ watchpoint_exp_is_const (const struct expression *exp)
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. */