* infrun.c (handle_inferior_event): When receiving a SIGTRAP
authorJoel Brobecker <brobecker@gnat.com>
Fri, 16 Aug 2002 17:56:17 +0000 (17:56 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Fri, 16 Aug 2002 17:56:17 +0000 (17:56 +0000)
        signal, check whether we hit a breakpoint before checking for a
        single step breakpoint. Otherwise, GDB fails to notice that a
        breakpoint has been hit when stepping onto a breakpoint.

gdb/ChangeLog
gdb/infrun.c

index f48858b..0142144 100644 (file)
@@ -1,3 +1,10 @@
+2002-08-16  Joel Brobecker  <brobecker@gnat.com>
+
+       * infrun.c (handle_inferior_event): When receiving a SIGTRAP
+       signal, check whether we hit a breakpoint before checking for a
+       single step breakpoint. Otherwise, GDB fails to notice that a
+       breakpoint has been hit when stepping onto a breakpoint.
+
 2002-08-16  Keith Seitz  <keiths@redhat.com>
 
        * gdb-events.sh (clear_gdb_event_hooks): New function.
index 672d5f9..af0b302 100644 (file)
@@ -1826,10 +1826,11 @@ handle_inferior_event (struct execution_control_state *ecs)
 
   if (stop_signal == TARGET_SIGNAL_TRAP)
     {
-      if (SOFTWARE_SINGLE_STEP_P () && singlestep_breakpoints_inserted_p)
-       ecs->random_signal = 0;
-      else if (breakpoints_inserted
-              && breakpoint_here_p (stop_pc - DECR_PC_AFTER_BREAK))
+      /* Check if a regular breakpoint has been hit before checking
+         for a potential single step breakpoint. Otherwise, GDB will
+         not see this breakpoint hit when stepping onto breakpoints.  */
+      if (breakpoints_inserted
+          && breakpoint_here_p (stop_pc - DECR_PC_AFTER_BREAK))
        {
          ecs->random_signal = 0;
          if (!breakpoint_thread_match (stop_pc - DECR_PC_AFTER_BREAK,
@@ -1885,6 +1886,10 @@ handle_inferior_event (struct execution_control_state *ecs)
                }
            }
        }
+      else if (SOFTWARE_SINGLE_STEP_P () && singlestep_breakpoints_inserted_p)
+        {
+          ecs->random_signal = 0;
+        }
     }
   else
     ecs->random_signal = 1;