Change return type to bool and adjust function comments.
gdb/ChangeLog:
* breakpoint.h (bpstat_explains_signal, bpstat_causes_stop,
bpstat_should_step): Return bool, adjust comments.
* breakpoint.c (bpstat_explains_signal, bpstat_causes_stop,
bpstat_should_step): Likewise.
+2019-07-10 Simon Marchi <simon.marchi@polymtl.ca>
+
+ * breakpoint.h (bpstat_explains_signal, bpstat_causes_stop,
+ bpstat_should_step): Return bool, adjust comments.
+ * breakpoint.c (bpstat_explains_signal, bpstat_causes_stop,
+ bpstat_should_step): Likewise.
+
2019-07-10 Alan Hayward <alan.hayward@arm.com>
* features/Makefile: Use feature target descriptions for Arm.
/* See breakpoint.h. */
-int
+bool
bpstat_explains_signal (bpstat bsp, enum gdb_signal sig)
{
for (; bsp != NULL; bsp = bsp->next)
/* A moribund location can never explain a signal other than
GDB_SIGNAL_TRAP. */
if (sig == GDB_SIGNAL_TRAP)
- return 1;
+ return true;
}
else
{
if (bsp->breakpoint_at->ops->explains_signal (bsp->breakpoint_at,
sig))
- return 1;
+ return true;
}
}
- return 0;
+ return false;
}
/* Put in *NUM the breakpoint number of the first breakpoint we are
}
}
-/* Nonzero if we should step constantly (e.g. watchpoints on machines
- without hardware support). This isn't related to a specific bpstat,
- just to things like whether watchpoints are set. */
+/* See breakpoint.h. */
-int
-bpstat_should_step (void)
+bool
+bpstat_should_step ()
{
struct breakpoint *b;
ALL_BREAKPOINTS (b)
if (breakpoint_enabled (b) && b->type == bp_watchpoint && b->loc != NULL)
- return 1;
- return 0;
+ return true;
+ return false;
}
-int
+/* See breakpoint.h. */
+
+bool
bpstat_causes_stop (bpstat bs)
{
for (; bs != NULL; bs = bs->next)
if (bs->stop)
- return 1;
+ return true;
- return 0;
+ return false;
}
\f
/* Find the bpstat associated with a breakpoint. NULL otherwise. */
bpstat bpstat_find_breakpoint (bpstat, struct breakpoint *);
-/* Nonzero if a signal that we got in target_wait() was due to
+/* True if a signal that we got in target_wait() was due to
circumstances explained by the bpstat; the signal is therefore not
random. */
-extern int bpstat_explains_signal (bpstat, enum gdb_signal);
+extern bool bpstat_explains_signal (bpstat, enum gdb_signal);
-/* Nonzero is this bpstat causes a stop. */
-extern int bpstat_causes_stop (bpstat);
+/* True if this bpstat causes a stop. */
+extern bool bpstat_causes_stop (bpstat);
-/* Nonzero if we should step constantly (e.g. watchpoints on machines
+/* True if we should step constantly (e.g. watchpoints on machines
without hardware support). This isn't related to a specific bpstat,
just to things like whether watchpoints are set. */
-extern int bpstat_should_step (void);
+extern bool bpstat_should_step ();
/* Print a message indicating what happened. Returns nonzero to
say that only the source line should be printed after this (zero