aboutsummaryrefslogtreecommitdiff
path: root/gdb/breakpoint.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2013-11-14 19:43:27 +0000
committerPedro Alves <palves@redhat.com>2013-11-14 19:51:15 +0000
commit47591c29add16c520c7bc2c7ace227deeb08f4a5 (patch)
tree2e29df0efaa19bfe74dfb8028c2552304c4e737f /gdb/breakpoint.c
parentbac7d97b66867e7654a1c27b00e7164e24243da0 (diff)
downloadgdb-47591c29add16c520c7bc2c7ace227deeb08f4a5.zip
gdb-47591c29add16c520c7bc2c7ace227deeb08f4a5.tar.gz
gdb-47591c29add16c520c7bc2c7ace227deeb08f4a5.tar.bz2
Eliminate enum bpstat_signal_value, simplify random signal checks further.
After the previous patch, there's actually no breakpoint type that returns BPSTAT_SIGNAL_HIDE, so we can go back to having bpstat_explains_signal return a boolean. The signal hiding actually disappears. gdb/ 2013-11-14 Pedro Alves <palves@redhat.com> * break-catch-sig.c (signal_catchpoint_explains_signal): Adjust to return a boolean. * breakpoint.c (bpstat_explains_signal): Adjust to return a boolean. (explains_signal_watchpoint, base_breakpoint_explains_signal): Adjust to return a boolean. * breakpoint.h (enum bpstat_signal_value): Delete. (struct breakpoint_ops) <explains_signal>: New returns a boolean. (bpstat_explains_signal): Likewise. * infrun.c (handle_inferior_event) <random signal checks>: bpstat_explains_signal now returns a boolean - adjust. No longer consider hiding signals.
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r--gdb/breakpoint.c34
1 files changed, 13 insertions, 21 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index e8ea0c3..260021e 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -4222,35 +4222,27 @@ bpstat_find_breakpoint (bpstat bsp, struct breakpoint *breakpoint)
/* See breakpoint.h. */
-enum bpstat_signal_value
+int
bpstat_explains_signal (bpstat bsp, enum gdb_signal sig)
{
- enum bpstat_signal_value result = BPSTAT_SIGNAL_NO;
-
for (; bsp != NULL; bsp = bsp->next)
{
- /* Ensure that, if we ever entered this loop, then we at least
- return BPSTAT_SIGNAL_HIDE. */
- enum bpstat_signal_value newval;
-
if (bsp->breakpoint_at == NULL)
{
/* A moribund location can never explain a signal other than
GDB_SIGNAL_TRAP. */
if (sig == GDB_SIGNAL_TRAP)
- newval = BPSTAT_SIGNAL_PASS;
- else
- newval = BPSTAT_SIGNAL_NO;
+ return 1;
}
else
- newval = bsp->breakpoint_at->ops->explains_signal (bsp->breakpoint_at,
- sig);
-
- if (newval > result)
- result = newval;
+ {
+ if (bsp->breakpoint_at->ops->explains_signal (bsp->breakpoint_at,
+ sig))
+ return 1;
+ }
}
- return result;
+ return 0;
}
/* Put in *NUM the breakpoint number of the first breakpoint we are
@@ -10771,15 +10763,15 @@ print_recreate_watchpoint (struct breakpoint *b, struct ui_file *fp)
/* Implement the "explains_signal" breakpoint_ops method for
watchpoints. */
-static enum bpstat_signal_value
+static int
explains_signal_watchpoint (struct breakpoint *b, enum gdb_signal sig)
{
/* A software watchpoint cannot cause a signal other than
GDB_SIGNAL_TRAP. */
if (b->type == bp_watchpoint && sig != GDB_SIGNAL_TRAP)
- return BPSTAT_SIGNAL_NO;
+ return 0;
- return BPSTAT_SIGNAL_PASS;
+ return 1;
}
/* The breakpoint_ops structure to be used in hardware watchpoints. */
@@ -12887,10 +12879,10 @@ base_breakpoint_decode_linespec (struct breakpoint *b, char **s,
/* The default 'explains_signal' method. */
-static enum bpstat_signal_value
+static int
base_breakpoint_explains_signal (struct breakpoint *b, enum gdb_signal sig)
{
- return BPSTAT_SIGNAL_PASS;
+ return 1;
}
/* The default "after_condition_true" method. */