From: Tom Tromey Date: Wed, 18 Dec 2013 04:47:15 +0000 (-0700) Subject: Add target_ops argument to to_record_is_replaying X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1c63c99491f9581d3f76d116cedcbfa5f124ca5a;p=binutils-gdb.git Add target_ops argument to to_record_is_replaying 2014-02-19 Tom Tromey * target.h (struct target_ops) : 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. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 30e4bbf1876..2e0590ac200 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,17 @@ +2014-02-19 Tom Tromey + + * target.h (struct target_ops) : 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 * target.h (struct target_ops) : Add argument. diff --git a/gdb/record-btrace.c b/gdb/record-btrace.c index fe827848a78..3d51f93a977 100644 --- a/gdb/record-btrace.c +++ b/gdb/record-btrace.c @@ -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. */ diff --git a/gdb/record-full.c b/gdb/record-full.c index 67296070b5f..d7972db33ed 100644 --- a/gdb/record-full.c +++ b/gdb/record-full.c @@ -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; } diff --git a/gdb/target.c b/gdb/target.c index 9773f578740..5c7bb4a282e 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -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; } diff --git a/gdb/target.h b/gdb/target.h index 004c25fa563..d37db4a8f6f 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -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);