target: add to_record_stop_replaying target method
[deliverable/binutils-gdb.git] / gdb / record-btrace.c
index 481d22d616e562f11e3cce839cfbb558f01d2716..e0b79a882875867607e82ca0f443e1a4f734b58b 100644 (file)
@@ -1160,7 +1160,7 @@ record_btrace_xfer_partial (struct target_ops *ops, enum target_object object,
   /* Filter out requests that don't make sense during replay.  */
   if (replay_memory_access == replay_memory_access_read_only
       && !record_btrace_generating_corefile
-      && record_btrace_is_replaying (ops, minus_one_ptid))
+      && record_btrace_is_replaying (ops, inferior_ptid))
     {
       switch (object)
        {
@@ -1314,8 +1314,8 @@ record_btrace_store_registers (struct target_ops *ops,
   struct target_ops *t;
 
   if (!record_btrace_generating_corefile
-      && record_btrace_is_replaying (ops, minus_one_ptid))
-    error (_("This record target does not allow writing registers."));
+      && record_btrace_is_replaying (ops, inferior_ptid))
+    error (_("Cannot write registers while replaying."));
 
   gdb_assert (may_write_registers != 0);
 
@@ -1332,7 +1332,7 @@ record_btrace_prepare_to_store (struct target_ops *ops,
   struct target_ops *t;
 
   if (!record_btrace_generating_corefile
-      && record_btrace_is_replaying (ops, minus_one_ptid))
+      && record_btrace_is_replaying (ops, inferior_ptid))
     return;
 
   t = ops->beneath;
@@ -1910,8 +1910,7 @@ record_btrace_resume (struct target_ops *ops, ptid_t ptid, int step,
       /* ...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.
@@ -2596,6 +2595,17 @@ record_btrace_goto (struct target_ops *self, ULONGEST insn)
   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
@@ -2647,6 +2657,7 @@ init_record_btrace_ops (void)
   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;
This page took 0.02411 seconds and 4 git commands to generate.