Add a new target method to_record_stop_replaying to stop replaying.
gdb/
* record-btrace.c (record_btrace_resume): Call
target_record_stop_replaying.
(record_btrace_stop_replaying_all): New.
(init_record_btrace_ops): Initialize to_record_stop_replaying.
* record-full.c (record_full_stop_replaying): New.
(init_record_full_ops ): Initialize to_record_stop_replaying.
* target-delegates.c: Regenerated.
* target.c (target_record_stop_replaying): New.
* target.h (struct target_ops) <to_record_stop_replaying>: New.
(target_record_stop_replaying): New.
+2015-09-18 Markus Metzger <markus.t.metzger@intel.com>
+
+ * record-btrace.c (record_btrace_resume): Call
+ target_record_stop_replaying.
+ (record_btrace_stop_replaying_all): New.
+ (init_record_btrace_ops): Initialize to_record_stop_replaying.
+ * record-full.c (record_full_stop_replaying): New.
+ (init_record_full_ops ): Initialize to_record_stop_replaying.
+ * target-delegates.c: Regenerated.
+ * target.c (target_record_stop_replaying): New.
+ * target.h (struct target_ops) <to_record_stop_replaying>: New.
+ (target_record_stop_replaying): New.
+
2015-09-18 Markus Metzger <markus.t.metzger@intel.com>
* record-btrace.c (record_btrace_xfer_partial)
/* ...and we stop replaying other threads if the thread to resume is not
replaying. */
if (!btrace_is_replaying (tp) && execution_direction != EXEC_REVERSE)
- ALL_NON_EXITED_THREADS (tp)
- record_btrace_stop_replaying (tp);
+ target_record_stop_replaying ();
}
/* As long as we're not replaying, just forward the request.
record_btrace_set_replay (tp, &it);
}
+/* The to_record_stop_replaying method of target record-btrace. */
+
+static void
+record_btrace_stop_replaying_all (struct target_ops *self)
+{
+ struct thread_info *tp;
+
+ ALL_NON_EXITED_THREADS (tp)
+ record_btrace_stop_replaying (tp);
+}
+
/* The to_execution_direction target method. */
static enum exec_direction_kind
ops->to_call_history_from = record_btrace_call_history_from;
ops->to_call_history_range = record_btrace_call_history_range;
ops->to_record_is_replaying = record_btrace_is_replaying;
+ ops->to_record_stop_replaying = record_btrace_stop_replaying_all;
ops->to_xfer_partial = record_btrace_xfer_partial;
ops->to_remove_breakpoint = record_btrace_remove_breakpoint;
ops->to_insert_breakpoint = record_btrace_insert_breakpoint;
record_full_goto_entry (p);
}
+/* The "to_record_stop_replaying" target method. */
+
+static void
+record_full_stop_replaying (struct target_ops *self)
+{
+ record_full_goto_end (self);
+}
+
static void
init_record_full_ops (void)
{
record_full_ops.to_save_record = record_full_save;
record_full_ops.to_delete_record = record_full_delete;
record_full_ops.to_record_is_replaying = record_full_is_replaying;
+ record_full_ops.to_record_stop_replaying = record_full_stop_replaying;
record_full_ops.to_goto_record_begin = record_full_goto_begin;
record_full_ops.to_goto_record_end = record_full_goto_end;
record_full_ops.to_goto_record = record_full_goto;
return result;
}
+static void
+delegate_record_stop_replaying (struct target_ops *self)
+{
+ self = self->beneath;
+ self->to_record_stop_replaying (self);
+}
+
+static void
+tdefault_record_stop_replaying (struct target_ops *self)
+{
+}
+
+static void
+debug_record_stop_replaying (struct target_ops *self)
+{
+ fprintf_unfiltered (gdb_stdlog, "-> %s->to_record_stop_replaying (...)\n", debug_target.to_shortname);
+ debug_target.to_record_stop_replaying (&debug_target);
+ fprintf_unfiltered (gdb_stdlog, "<- %s->to_record_stop_replaying (", debug_target.to_shortname);
+ target_debug_print_struct_target_ops_p (&debug_target);
+ fputs_unfiltered (")\n", gdb_stdlog);
+}
+
static void
delegate_goto_record_begin (struct target_ops *self)
{
ops->to_delete_record = delegate_delete_record;
if (ops->to_record_is_replaying == NULL)
ops->to_record_is_replaying = delegate_record_is_replaying;
+ if (ops->to_record_stop_replaying == NULL)
+ ops->to_record_stop_replaying = delegate_record_stop_replaying;
if (ops->to_goto_record_begin == NULL)
ops->to_goto_record_begin = delegate_goto_record_begin;
if (ops->to_goto_record_end == NULL)
ops->to_save_record = tdefault_save_record;
ops->to_delete_record = tdefault_delete_record;
ops->to_record_is_replaying = tdefault_record_is_replaying;
+ ops->to_record_stop_replaying = tdefault_record_stop_replaying;
ops->to_goto_record_begin = tdefault_goto_record_begin;
ops->to_goto_record_end = tdefault_goto_record_end;
ops->to_goto_record = tdefault_goto_record;
ops->to_save_record = debug_save_record;
ops->to_delete_record = debug_delete_record;
ops->to_record_is_replaying = debug_record_is_replaying;
+ ops->to_record_stop_replaying = debug_record_stop_replaying;
ops->to_goto_record_begin = debug_goto_record_begin;
ops->to_goto_record_end = debug_goto_record_end;
ops->to_goto_record = debug_goto_record;
/* See target.h. */
+void
+target_record_stop_replaying (void)
+{
+ current_target.to_record_stop_replaying (¤t_target);
+}
+
+/* See target.h. */
+
void
target_goto_record_begin (void)
{
int (*to_record_is_replaying) (struct target_ops *, ptid_t ptid)
TARGET_DEFAULT_RETURN (0);
+ /* Stop replaying. */
+ void (*to_record_stop_replaying) (struct target_ops *)
+ TARGET_DEFAULT_IGNORE ();
+
/* Go to the begin of the execution trace. */
void (*to_goto_record_begin) (struct target_ops *)
TARGET_DEFAULT_NORETURN (tcomplain ());
/* See to_record_is_replaying in struct target_ops. */
extern int target_record_is_replaying (ptid_t ptid);
+/* See to_record_stop_replaying in struct target_ops. */
+extern void target_record_stop_replaying (void);
+
/* See to_goto_record_begin in struct target_ops. */
extern void target_goto_record_begin (void);