* gdbarch.sh (displaced_step_hw_singlestep): New callback.
[deliverable/binutils-gdb.git] / gdb / infrun.c
index 1a83a259ec842455972e559bee1e8eb78641110c..ff7c6b9cb7fac87c65e561aeb5b08363ced505d9 100644 (file)
@@ -1002,10 +1002,11 @@ displaced_step_fixup (ptid_t event_ptid, enum target_signal signal)
              displaced_step_dump_bytes (gdb_stdlog, buf, sizeof (buf));
            }
 
-         if (gdbarch_software_single_step_p (gdbarch))
-           target_resume (ptid, 0, TARGET_SIGNAL_0);
-         else
+         if (gdbarch_displaced_step_hw_singlestep
+               (gdbarch, displaced_step_closure))
            target_resume (ptid, 1, TARGET_SIGNAL_0);
+         else
+           target_resume (ptid, 0, TARGET_SIGNAL_0);
 
          /* Done, we're stepping a thread.  */
          break;
@@ -1114,19 +1115,15 @@ maybe_software_singlestep (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
   int hw_step = 1;
 
-  if (gdbarch_software_single_step_p (gdbarch))
+  if (gdbarch_software_single_step_p (gdbarch)
+      && gdbarch_software_single_step (gdbarch, get_current_frame ()))
     {
-      if (use_displaced_stepping (gdbarch))
-        hw_step = 0;
-      else if (gdbarch_software_single_step (gdbarch, get_current_frame ()))
-       {
-         hw_step = 0;
-         /* Do not pull these breakpoints until after a `wait' in
-            `wait_for_inferior' */
-         singlestep_breakpoints_inserted_p = 1;
-         singlestep_ptid = inferior_ptid;
-         singlestep_pc = pc;
-       }
+      hw_step = 0;
+      /* Do not pull these breakpoints until after a `wait' in
+        `wait_for_inferior' */
+      singlestep_breakpoints_inserted_p = 1;
+      singlestep_ptid = inferior_ptid;
+      singlestep_pc = pc;
     }
   return hw_step;
 }
@@ -1208,10 +1205,13 @@ a command like `return' or `jump' to continue execution."));
          discard_cleanups (old_cleanups);
          return;
        }
+
+      step = gdbarch_displaced_step_hw_singlestep
+              (gdbarch, displaced_step_closure);
     }
 
   /* Do we need to do it the hard way, w/temp breakpoints?  */
-  if (step)
+  else if (step)
     step = maybe_software_singlestep (gdbarch, pc);
 
   if (should_resume)
This page took 0.026772 seconds and 4 git commands to generate.