summaryrefslogtreecommitdiff
path: root/gdb/breakpoint.h
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-06-18 19:57:48 +0000
committerTom Tromey <tromey@redhat.com>2013-06-18 19:57:48 +0000
commit611aa2b284bbfd7e29b585bc03d31ec6e57c5bf3 (patch)
tree57cfd31219e75140caa0c3e060a4494944af295a /gdb/breakpoint.h
parentc1bdf45d7ac94dbf6d82ef03d4d29eb406a244c7 (diff)
downloadgdb-611aa2b284bbfd7e29b585bc03d31ec6e57c5bf3.tar.gz
Fix PR cli/15603
This fixes PR cli/15603. The bug here is that when a software watchpoint is being used, gdb will stop responding to C-c. This is a regression caused by the "catch signal" patch. The problem is that software watchpoints always end up on the bpstat list. However, this makes bpstat_explains_signal return BPSTAT_SIGNAL_HIDE, causing infrun to think that the signal is not a "random signal". The fix is to change bpstat_explains_signal to handle this better. I chose to do it in a "clean API" way, by passing the signal value to bpstat_explains_signal and then adding an explains_signal method for watchpoints, which handles the specifics. Built and regtested on x86-64 Fedora 18. New test case included. * break-catch-sig.c (signal_catchpoint_explains_signal): Add 'sig' argument. * breakpoint.c (bpstat_explains_signal): Add 'sig' argument. Special case signals other than GDB_SIGNAL_TRAP. (explains_signal_watchpoint): New function. (base_breakpoint_explains_signal): Add 'sig' argument. (initialize_breakpoint_ops): Set 'explains_signal' method for watchpoints. * breakpoint.h (struct breakpoint_ops) <explains_signal>: Add signal argument. (bpstat_explains_signal): Likewise. * infrun.c (handle_syscall_event, handle_inferior_event): Update. * gdb.base/random-signal.c: New file. * gdb.base/random-signal.exp: New file.
Diffstat (limited to 'gdb/breakpoint.h')
-rw-r--r--gdb/breakpoint.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
index 94210f4c205..43ab906757f 100644
--- a/gdb/breakpoint.h
+++ b/gdb/breakpoint.h
@@ -613,7 +613,8 @@ struct breakpoint_ops
should still be delivered to the inferior. This is used to make
'catch signal' interact properly with 'handle'; see
bpstat_explains_signal. */
- enum bpstat_signal_value (*explains_signal) (struct breakpoint *);
+ enum bpstat_signal_value (*explains_signal) (struct breakpoint *,
+ enum gdb_signal);
};
/* Helper for breakpoint_ops->print_recreate implementations. Prints
@@ -1009,7 +1010,8 @@ bpstat bpstat_find_breakpoint (bpstat, struct breakpoint *);
/* Nonzero if a signal that we got in wait() was due to circumstances
explained by the bpstat; and the signal should therefore not be
delivered. */
-extern enum bpstat_signal_value bpstat_explains_signal (bpstat);
+extern enum bpstat_signal_value bpstat_explains_signal (bpstat,
+ enum gdb_signal);
/* Nonzero is this bpstat causes a stop. */
extern int bpstat_causes_stop (bpstat);