This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] gdb/18216: displaced step+deliver signal, a thread needs step-over, crash
- From: Pedro Alves <palves at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 10 Apr 2015 09:38:25 -0000
- Subject: [binutils-gdb] gdb/18216: displaced step+deliver signal, a thread needs step-over, crash
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=8d707a12ef51ba5f4c3c6a52532e903da7a56b8b
commit 8d707a12ef51ba5f4c3c6a52532e903da7a56b8b
Author: Pedro Alves <palves@redhat.com>
Date: Fri Apr 10 10:36:23 2015 +0100
gdb/18216: displaced step+deliver signal, a thread needs step-over, crash
The problem is that with hardware step targets and displaced stepping,
"signal FOO" when stopped at a breakpoint steps the breakpoint
instruction at the same time it delivers a signal. This results in
tp->stepped_breakpoint set, but no step-resume breakpoint set. When
the next stop event arrives, GDB crashes. Irrespective of whether we
should do something more/different to step past the breakpoint in this
scenario (e.g., PR 18225), it's just wrong to assume there'll be a
step-resume breakpoint set (and was not the original intention).
gdb/ChangeLog:
2015-04-10 Pedro Alves <palves@redhat.com>
PR gdb/18216
* infrun.c (process_event_stop_test): Don't assume a step-resume
is set if tp->stepped_breakpoint is true.
gdb/testsuite/ChangeLog:
2015-04-10 Pedro Alves <palves@redhat.com>
PR gdb/18216
* gdb.threads/multiple-step-overs.exp: Remove expected eof.
Diff:
---
gdb/ChangeLog | 6 ++++++
gdb/infrun.c | 3 ++-
gdb/testsuite/ChangeLog | 5 +++++
gdb/testsuite/gdb.threads/multiple-step-overs.exp | 7 -------
4 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index be8eabb..83f9df6 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2015-04-10 Pedro Alves <palves@redhat.com>
+
+ PR gdb/18216
+ * infrun.c (process_event_stop_test): Don't assume a step-resume
+ is set if tp->stepped_breakpoint is true.
+
2015-04-10 Yao Qi <yao.qi@linaro.org>
* arm-tdep.c (install_alu_reg): Update comment.
diff --git a/gdb/infrun.c b/gdb/infrun.c
index d52b8ad..3fcc55f 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -4961,7 +4961,8 @@ process_event_stop_test (struct execution_control_state *ecs)
struct breakpoint *sr_bp
= ecs->event_thread->control.step_resume_breakpoint;
- if (sr_bp->loc->permanent
+ if (sr_bp != NULL
+ && sr_bp->loc->permanent
&& sr_bp->type == bp_hp_step_resume
&& sr_bp->loc->address == ecs->event_thread->prev_pc)
{
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 2d19d45..c47c6ac 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-10 Pedro Alves <palves@redhat.com>
+
+ PR gdb/18216
+ * gdb.threads/multiple-step-overs.exp: Remove expected eof.
+
2015-04-10 Yao Qi <yao.qi@linaro.org>
* gdb.arch/arm-disp-step.S (main): Call test_add_rn_pc.
diff --git a/gdb/testsuite/gdb.threads/multiple-step-overs.exp b/gdb/testsuite/gdb.threads/multiple-step-overs.exp
index bfa4ad1..475e0f4 100644
--- a/gdb/testsuite/gdb.threads/multiple-step-overs.exp
+++ b/gdb/testsuite/gdb.threads/multiple-step-overs.exp
@@ -118,13 +118,6 @@ foreach displaced { "off" "on" } {
}
fail $msg
}
- eof {
- if {[can_single_step_to_signal_handler]
- && $displaced == "on"} {
- setup_kfail "gdb/18216" "*-*-*"
- }
- fail $msg
- }
}
}
}