CORE_ADDR original_pc = regcache_read_pc (regcache);
displaced_step_prepare_status status =
- gdbarch_displaced_step_prepare (gdbarch, tp);
+ tp->inf->top_target ()->displaced_step_prepare (tp);
if (status == DISPLACED_STEP_PREPARE_STATUS_ERROR)
{
/* Do the fixup, and release the resources acquired to do the displaced
step. */
displaced_step_finish_status finish_status =
- gdbarch_displaced_step_finish (displaced->get_original_gdbarch (),
- event_thread, signal);
+ event_thread->inf->top_target ()->displaced_step_finish (event_thread,
+ signal);
if (finish_status == DISPLACED_STEP_FINISH_STATUS_OK)
return 1;
target_debug_do_print (host_address_to_string (*(X)))
#define target_debug_print_enum_gdb_signal(X) \
target_debug_do_print (gdb_signal_to_name (X))
+#define target_debug_print_gdb_signal(X) \
+ target_debug_do_print (gdb_signal_to_name (X))
#define target_debug_print_ULONGEST(X) \
target_debug_do_print (hex_string (X))
#define target_debug_print_ULONGEST_p(X) \
target_debug_do_print ((X).c_str ())
#define target_debug_print_gdb_byte_vector(X) \
target_debug_do_print (host_address_to_string (X.data ()))
+#define target_debug_print_displaced_step_finish_status(X) \
+ target_debug_do_print (host_address_to_string (X))
+#define target_debug_print_displaced_step_prepare_status(X) \
+ target_debug_do_print (host_address_to_string (X))
+
static void
target_debug_print_struct_target_waitstatus_p (struct target_waitstatus *status)
const struct frame_unwind *get_tailcall_unwinder () override;
void prepare_to_generate_core () override;
void done_generating_core () override;
+ displaced_step_prepare_status displaced_step_prepare (thread_info *arg0) override;
+ displaced_step_finish_status displaced_step_finish (thread_info *arg0, gdb_signal arg1) override;
};
struct debug_target : public target_ops
const struct frame_unwind *get_tailcall_unwinder () override;
void prepare_to_generate_core () override;
void done_generating_core () override;
+ displaced_step_prepare_status displaced_step_prepare (thread_info *arg0) override;
+ displaced_step_finish_status displaced_step_finish (thread_info *arg0, gdb_signal arg1) override;
};
void
fputs_unfiltered (")\n", gdb_stdlog);
}
+displaced_step_prepare_status
+target_ops::displaced_step_prepare (thread_info *arg0)
+{
+ return this->beneath ()->displaced_step_prepare (arg0);
+}
+
+displaced_step_prepare_status
+dummy_target::displaced_step_prepare (thread_info *arg0)
+{
+ return default_displaced_step_prepare (this, arg0);
+}
+
+displaced_step_prepare_status
+debug_target::displaced_step_prepare (thread_info *arg0)
+{
+ displaced_step_prepare_status result;
+ fprintf_unfiltered (gdb_stdlog, "-> %s->displaced_step_prepare (...)\n", this->beneath ()->shortname ());
+ result = this->beneath ()->displaced_step_prepare (arg0);
+ fprintf_unfiltered (gdb_stdlog, "<- %s->displaced_step_prepare (", this->beneath ()->shortname ());
+ target_debug_print_thread_info_p (arg0);
+ fputs_unfiltered (") = ", gdb_stdlog);
+ target_debug_print_displaced_step_prepare_status (result);
+ fputs_unfiltered ("\n", gdb_stdlog);
+ return result;
+}
+
+displaced_step_finish_status
+target_ops::displaced_step_finish (thread_info *arg0, gdb_signal arg1)
+{
+ return this->beneath ()->displaced_step_finish (arg0, arg1);
+}
+
+displaced_step_finish_status
+dummy_target::displaced_step_finish (thread_info *arg0, gdb_signal arg1)
+{
+ return default_displaced_step_finish (this, arg0, arg1);
+}
+
+displaced_step_finish_status
+debug_target::displaced_step_finish (thread_info *arg0, gdb_signal arg1)
+{
+ displaced_step_finish_status result;
+ fprintf_unfiltered (gdb_stdlog, "-> %s->displaced_step_finish (...)\n", this->beneath ()->shortname ());
+ result = this->beneath ()->displaced_step_finish (arg0, arg1);
+ fprintf_unfiltered (gdb_stdlog, "<- %s->displaced_step_finish (", this->beneath ()->shortname ());
+ target_debug_print_thread_info_p (arg0);
+ fputs_unfiltered (", ", gdb_stdlog);
+ target_debug_print_gdb_signal (arg1);
+ fputs_unfiltered (") = ", gdb_stdlog);
+ target_debug_print_displaced_step_finish_status (result);
+ fputs_unfiltered ("\n", gdb_stdlog);
+ return result;
+}
+
#include "command.h"
#include "disasm.h"
#include "tracepoint.h"
+#include "displaced-stepping.h"
#include "gdbsupport/break-common.h" /* For enum target_hw_bp_type. */
/* Cleanup after generating a core file. */
virtual void done_generating_core ()
TARGET_DEFAULT_IGNORE ();
+
+ virtual displaced_step_prepare_status displaced_step_prepare (thread_info *thread)
+ TARGET_DEFAULT_FUNC (default_displaced_step_prepare);
+
+ virtual displaced_step_finish_status displaced_step_finish (thread_info *thread, gdb_signal sig)
+ TARGET_DEFAULT_FUNC (default_displaced_step_finish);
};
/* Deleter for std::unique_ptr. See comments in