infrun.c:resume: currently_stepping after clearing stepped_breakpoint
authorPedro Alves <palves@redhat.com>
Mon, 30 Mar 2015 15:39:56 +0000 (16:39 +0100)
committerPedro Alves <palves@redhat.com>
Wed, 1 Apr 2015 14:35:38 +0000 (15:35 +0100)
My all-stop-on-top-of-non-stop series manages to shows regressions due
to this latent bug.  currently_stepping returns true if
stepped_breakpoint is set.  Obviously we should clear
it before checking currently_stepping, not after.

Tested on x86_64 Fedora 20.

gdb/ChangeLog:
2015-04-01  Pedro Alves  <palves@redhat.com>

* infrun.c (resume): Check currently_stepping after clearing
stepped_breakpoint, not before.

gdb/ChangeLog
gdb/infrun.c

index 7f9cc431fb2554e813a8f6b0d74767a11f0e148d..b85b43723c17d8e8e3f21db18945668336e98cf8 100644 (file)
@@ -1,3 +1,8 @@
+2015-04-01  Pedro Alves  <palves@redhat.com>
+
+       * infrun.c (resume): Check currently_stepping after clearing
+       stepped_breakpoint, not before.
+
 2015-04-01  Pedro Alves  <palves@redhat.com>
 
        * infrun.c (print_target_wait_results): Print all the ptid
index 4b38fce859353d128a3ed4f99311c0f9ad6e7fed..f5faa0a22af2cb58a62ea614eebaef675b216b58 100644 (file)
@@ -2084,12 +2084,15 @@ resume (enum gdb_signal sig)
      This can decay from a step to a continue, if e.g., we need to
      implement single-stepping with breakpoints (software
      single-step).  */
-  int step = currently_stepping (tp);
+  int step;
 
   tp->stepped_breakpoint = 0;
 
   QUIT;
 
+  /* Depends on stepped_breakpoint.  */
+  step = currently_stepping (tp);
+
   if (current_inferior ()->waiting_for_vfork_done)
     {
       /* Don't try to single-step a vfork parent that is waiting for