Add target_ops argument to to_record_is_replaying
authorTom Tromey <tromey@redhat.com>
Wed, 18 Dec 2013 04:47:15 +0000 (21:47 -0700)
committerTom Tromey <tromey@redhat.com>
Wed, 19 Feb 2014 14:46:50 +0000 (07:46 -0700)
2014-02-19  Tom Tromey  <tromey@redhat.com>

* target.h (struct target_ops) <to_record_is_replaying>: Add
argument.
* target.c (target_record_is_replaying): Add argument.
* record-full.c (record_full_is_replaying): Add 'self' argument.
* record-btrace.c (record_btrace_is_replaying): Add 'self'
argument.
(record_btrace_xfer_partial, record_btrace_store_registers)
(record_btrace_prepare_to_store, record_btrace_resume)
(record_btrace_wait, record_btrace_decr_pc_after_break)
(record_btrace_find_new_threads, record_btrace_thread_alive):
Update.

gdb/ChangeLog
gdb/record-btrace.c
gdb/record-full.c
gdb/target.c
gdb/target.h

index 30e4bbf..2e0590a 100644 (file)
@@ -1,5 +1,19 @@
 2014-02-19  Tom Tromey  <tromey@redhat.com>
 
+       * target.h (struct target_ops) <to_record_is_replaying>: Add
+       argument.
+       * target.c (target_record_is_replaying): Add argument.
+       * record-full.c (record_full_is_replaying): Add 'self' argument.
+       * record-btrace.c (record_btrace_is_replaying): Add 'self'
+       argument.
+       (record_btrace_xfer_partial, record_btrace_store_registers)
+       (record_btrace_prepare_to_store, record_btrace_resume)
+       (record_btrace_wait, record_btrace_decr_pc_after_break)
+       (record_btrace_find_new_threads, record_btrace_thread_alive):
+       Update.
+
+2014-02-19  Tom Tromey  <tromey@redhat.com>
+
        * target.h (struct target_ops) <to_delete_record>: Add argument.
        * target.c (target_delete_record): Add argument.
        * record-full.c (record_full_delete): Add 'self' argument.
index fe82784..3d51f93 100644 (file)
@@ -789,7 +789,7 @@ record_btrace_call_history_from (ULONGEST from, int size, int flags)
 /* The to_record_is_replaying method of target record-btrace.  */
 
 static int
-record_btrace_is_replaying (void)
+record_btrace_is_replaying (struct target_ops *self)
 {
   struct thread_info *tp;
 
@@ -811,7 +811,7 @@ record_btrace_xfer_partial (struct target_ops *ops, enum target_object object,
   struct target_ops *t;
 
   /* Filter out requests that don't make sense during replay.  */
-  if (!record_btrace_allow_memory_access && record_btrace_is_replaying ())
+  if (!record_btrace_allow_memory_access && record_btrace_is_replaying (ops))
     {
       switch (object)
        {
@@ -965,7 +965,7 @@ record_btrace_store_registers (struct target_ops *ops,
 {
   struct target_ops *t;
 
-  if (record_btrace_is_replaying ())
+  if (record_btrace_is_replaying (ops))
     error (_("This record target does not allow writing registers."));
 
   gdb_assert (may_write_registers != 0);
@@ -988,7 +988,7 @@ record_btrace_prepare_to_store (struct target_ops *ops,
 {
   struct target_ops *t;
 
-  if (record_btrace_is_replaying ())
+  if (record_btrace_is_replaying (ops))
     return;
 
   for (t = ops->beneath; t != NULL; t = t->beneath)
@@ -1462,7 +1462,7 @@ record_btrace_resume (struct target_ops *ops, ptid_t ptid, int step,
       record_btrace_stop_replaying (other);
 
   /* As long as we're not replaying, just forward the request.  */
-  if (!record_btrace_is_replaying () && execution_direction != EXEC_REVERSE)
+  if (!record_btrace_is_replaying (ops) && execution_direction != EXEC_REVERSE)
     {
       for (ops = ops->beneath; ops != NULL; ops = ops->beneath)
        if (ops->to_resume != NULL)
@@ -1678,7 +1678,7 @@ record_btrace_wait (struct target_ops *ops, ptid_t ptid,
   DEBUG ("wait %s (0x%x)", target_pid_to_str (ptid), options);
 
   /* As long as we're not replaying, just forward the request.  */
-  if (!record_btrace_is_replaying () && execution_direction != EXEC_REVERSE)
+  if (!record_btrace_is_replaying (ops) && execution_direction != EXEC_REVERSE)
     {
       for (ops = ops->beneath; ops != NULL; ops = ops->beneath)
        if (ops->to_wait != NULL)
@@ -1730,7 +1730,7 @@ record_btrace_decr_pc_after_break (struct target_ops *ops,
 {
   /* When replaying, we do not actually execute the breakpoint instruction
      so there is no need to adjust the PC after hitting a breakpoint.  */
-  if (record_btrace_is_replaying ())
+  if (record_btrace_is_replaying (ops))
     return 0;
 
   return forward_target_decr_pc_after_break (ops->beneath, gdbarch);
@@ -1742,7 +1742,7 @@ static void
 record_btrace_find_new_threads (struct target_ops *ops)
 {
   /* Don't expect new threads if we're replaying.  */
-  if (record_btrace_is_replaying ())
+  if (record_btrace_is_replaying (ops))
     return;
 
   /* Forward the request.  */
@@ -1760,7 +1760,7 @@ static int
 record_btrace_thread_alive (struct target_ops *ops, ptid_t ptid)
 {
   /* We don't add or remove threads during replay.  */
-  if (record_btrace_is_replaying ())
+  if (record_btrace_is_replaying (ops))
     return find_thread_ptid (ptid) != NULL;
 
   /* Forward the request.  */
index 6729607..d7972db 100644 (file)
@@ -1825,7 +1825,7 @@ record_full_delete (struct target_ops *self)
 /* The "to_record_is_replaying" target method.  */
 
 static int
-record_full_is_replaying (void)
+record_full_is_replaying (struct target_ops *self)
 {
   return RECORD_FULL_IS_REPLAY;
 }
index 9773f57..5c7bb4a 100644 (file)
@@ -4347,7 +4347,7 @@ target_record_is_replaying (void)
 
   for (t = current_target.beneath; t != NULL; t = t->beneath)
     if (t->to_record_is_replaying != NULL)
-       return t->to_record_is_replaying ();
+       return t->to_record_is_replaying (t);
 
   return 0;
 }
index 004c25f..d37db4a 100644 (file)
@@ -939,7 +939,7 @@ struct target_ops
     void (*to_delete_record) (struct target_ops *);
 
     /* Query if the record target is currently replaying.  */
-    int (*to_record_is_replaying) (void);
+    int (*to_record_is_replaying) (struct target_ops *);
 
     /* Go to the begin of the execution trace.  */
     void (*to_goto_record_begin) (void);