]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/18216: displaced step+deliver signal, a thread needs step-over, crash
authorPedro Alves <palves@redhat.com>
Fri, 10 Apr 2015 09:36:23 +0000 (10:36 +0100)
committerPedro Alves <palves@redhat.com>
Fri, 10 Apr 2015 09:36:23 +0000 (10:36 +0100)
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.

gdb/ChangeLog
gdb/infrun.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.threads/multiple-step-overs.exp

index be8eabbb3bcb76321f3104adb71ac0d6f7e95869..83f9df63a0b316161278fdc4379e05a1618a1d41 100644 (file)
@@ -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.
index d52b8ada21c3d5e1c75ff586de1df5817d888c16..3fcc55f6af7b0229daf362263c52ac4a20994224 100644 (file)
@@ -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)
        {
index 2d19d457a4464b00e97b2636343e5d929a707085..c47c6ac100bee4f80e30ae055a22554cfc6bd349 100644 (file)
@@ -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.
index bfa4ad1519381e596bfbc2e17ce80b02729960c6..475e0f40b081efa88c75c333abd552b3ee72d3fe 100644 (file)
@@ -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
-                   }
                }
            }
        }