X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Finfrun.c;h=de09bb038359b26495bde1d654c97009cf3670cb;hb=65a7e4d60ff61d720e7b1755937fa7e871ef8e4b;hp=90d5b2717e39c8e1c2024b24760f214e8fdbe136;hpb=5514706f739978e0897d01ec9fa25fa61861c263;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/infrun.c b/gdb/infrun.c index 90d5b2717e..de09bb0383 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -1603,15 +1603,15 @@ show_can_use_displaced_stepping (struct ui_file *file, int from_tty, "to step over breakpoints is %s.\n"), value); } -/* Return true if the gdbarch implements the required methods to use - displaced stepping. */ +/* Return true if the target behing THREAD supports displaced stepping. */ static bool -gdbarch_supports_displaced_stepping (gdbarch *arch) +target_supports_displaced_stepping (thread_info *thread) { - /* Only check for the presence of `prepare`. `finish` is required by the - gdbarch verification to be provided if `prepare` is provided. */ - return gdbarch_displaced_step_prepare_p (arch); + inferior *inf = thread->inf; + target_ops *target = inf->top_target (); + + return target->supports_displaced_step (thread); } /* Return non-zero if displaced stepping can/should be used to step @@ -1630,11 +1630,8 @@ use_displaced_stepping (thread_info *tp) && !target_is_non_stop_p ()) return false; - gdbarch *gdbarch = get_thread_regcache (tp)->arch (); - - /* If the architecture doesn't implement displaced stepping, don't use - it. */ - if (!gdbarch_supports_displaced_stepping (gdbarch)) + /* If the target doesn't support displaced stepping, don't use it. */ + if (!target_supports_displaced_stepping (tp)) return false; /* If recording, don't use displaced stepping. */ @@ -1702,9 +1699,9 @@ displaced_step_prepare_throw (thread_info *tp) displaced_step_thread_state *thread_disp_step_state = get_displaced_stepping_state (tp); - /* We should never reach this function if the architecture does not + /* We should never reach this function if the target does not support displaced stepping. */ - gdb_assert (gdbarch_supports_displaced_stepping (gdbarch)); + gdb_assert (target_supports_displaced_stepping (tp)); /* Nor if the thread isn't meant to step over a breakpoint. */ gdb_assert (tp->control.trap_expected);