gdb: don't require displaced step copy_insn to be implemented in prepare/finish are
[deliverable/binutils-gdb.git] / gdb / gdbarch.c
index e7d94a3b47a13e9a56abb352add596a4cf8524d7..597e10735cb83ef14ba398f2be431dae46ea04dd 100644 (file)
@@ -443,7 +443,6 @@ gdbarch_alloc (const struct gdbarch_info *info,
   gdbarch->skip_permanent_breakpoint = default_skip_permanent_breakpoint;
   gdbarch->displaced_step_hw_singlestep = default_displaced_step_hw_singlestep;
   gdbarch->displaced_step_fixup = NULL;
-  gdbarch->displaced_step_prepare = NULL;
   gdbarch->displaced_step_finish = NULL;
   gdbarch->relocate_instruction = NULL;
   gdbarch->has_shared_address_space = default_has_shared_address_space;
@@ -655,9 +654,8 @@ verify_gdbarch (struct gdbarch *gdbarch)
   /* Skip verify of displaced_step_copy_insn, has predicate.  */
   /* Skip verify of displaced_step_hw_singlestep, invalid_p == 0 */
   /* Skip verify of displaced_step_fixup, has predicate.  */
-  if ((! gdbarch->displaced_step_prepare) != (! gdbarch->displaced_step_copy_insn))
-    log.puts ("\n\tdisplaced_step_prepare");
-  if ((! gdbarch->displaced_step_finish) != (! gdbarch->displaced_step_copy_insn))
+  /* Skip verify of displaced_step_prepare, has predicate.  */
+  if ((! gdbarch->displaced_step_finish) != (! gdbarch->displaced_step_prepare))
     log.puts ("\n\tdisplaced_step_finish");
   /* Skip verify of relocate_instruction, has predicate.  */
   /* Skip verify of overlay_update, has predicate.  */
@@ -927,6 +925,9 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
   fprintf_unfiltered (file,
                       "gdbarch_dump: displaced_step_hw_singlestep = <%s>\n",
                       host_address_to_string (gdbarch->displaced_step_hw_singlestep));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_displaced_step_prepare_p() = %d\n",
+                      gdbarch_displaced_step_prepare_p (gdbarch));
   fprintf_unfiltered (file,
                       "gdbarch_dump: displaced_step_prepare = <%s>\n",
                       host_address_to_string (gdbarch->displaced_step_prepare));
@@ -3992,6 +3993,13 @@ set_gdbarch_displaced_step_fixup (struct gdbarch *gdbarch,
   gdbarch->displaced_step_fixup = displaced_step_fixup;
 }
 
+int
+gdbarch_displaced_step_prepare_p (struct gdbarch *gdbarch)
+{
+  gdb_assert (gdbarch != NULL);
+  return gdbarch->displaced_step_prepare != NULL;
+}
+
 displaced_step_prepare_status
 gdbarch_displaced_step_prepare (struct gdbarch *gdbarch, thread_info *thread)
 {
This page took 0.023697 seconds and 4 git commands to generate.