Add target_ops argument to to_record_is_replaying

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.
This commit is contained in:
Tom Tromey 2013-12-17 21:47:15 -07:00
parent d1b55219eb
commit 1c63c99491
5 changed files with 26 additions and 12 deletions

View file

@ -1,3 +1,17 @@
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> 2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_delete_record>: Add argument. * target.h (struct target_ops) <to_delete_record>: Add argument.

View 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. */ /* The to_record_is_replaying method of target record-btrace. */
static int static int
record_btrace_is_replaying (void) record_btrace_is_replaying (struct target_ops *self)
{ {
struct thread_info *tp; struct thread_info *tp;
@ -811,7 +811,7 @@ record_btrace_xfer_partial (struct target_ops *ops, enum target_object object,
struct target_ops *t; struct target_ops *t;
/* Filter out requests that don't make sense during replay. */ /* 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) switch (object)
{ {
@ -965,7 +965,7 @@ record_btrace_store_registers (struct target_ops *ops,
{ {
struct target_ops *t; struct target_ops *t;
if (record_btrace_is_replaying ()) if (record_btrace_is_replaying (ops))
error (_("This record target does not allow writing registers.")); error (_("This record target does not allow writing registers."));
gdb_assert (may_write_registers != 0); gdb_assert (may_write_registers != 0);
@ -988,7 +988,7 @@ record_btrace_prepare_to_store (struct target_ops *ops,
{ {
struct target_ops *t; struct target_ops *t;
if (record_btrace_is_replaying ()) if (record_btrace_is_replaying (ops))
return; return;
for (t = ops->beneath; t != NULL; t = t->beneath) 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); record_btrace_stop_replaying (other);
/* As long as we're not replaying, just forward the request. */ /* 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) for (ops = ops->beneath; ops != NULL; ops = ops->beneath)
if (ops->to_resume != NULL) 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); DEBUG ("wait %s (0x%x)", target_pid_to_str (ptid), options);
/* As long as we're not replaying, just forward the request. */ /* 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) for (ops = ops->beneath; ops != NULL; ops = ops->beneath)
if (ops->to_wait != NULL) 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 /* When replaying, we do not actually execute the breakpoint instruction
so there is no need to adjust the PC after hitting a breakpoint. */ 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 0;
return forward_target_decr_pc_after_break (ops->beneath, gdbarch); 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) record_btrace_find_new_threads (struct target_ops *ops)
{ {
/* Don't expect new threads if we're replaying. */ /* Don't expect new threads if we're replaying. */
if (record_btrace_is_replaying ()) if (record_btrace_is_replaying (ops))
return; return;
/* Forward the request. */ /* Forward the request. */
@ -1760,7 +1760,7 @@ static int
record_btrace_thread_alive (struct target_ops *ops, ptid_t ptid) record_btrace_thread_alive (struct target_ops *ops, ptid_t ptid)
{ {
/* We don't add or remove threads during replay. */ /* 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; return find_thread_ptid (ptid) != NULL;
/* Forward the request. */ /* Forward the request. */

View file

@ -1825,7 +1825,7 @@ record_full_delete (struct target_ops *self)
/* The "to_record_is_replaying" target method. */ /* The "to_record_is_replaying" target method. */
static int static int
record_full_is_replaying (void) record_full_is_replaying (struct target_ops *self)
{ {
return RECORD_FULL_IS_REPLAY; return RECORD_FULL_IS_REPLAY;
} }

View file

@ -4347,7 +4347,7 @@ target_record_is_replaying (void)
for (t = current_target.beneath; t != NULL; t = t->beneath) for (t = current_target.beneath; t != NULL; t = t->beneath)
if (t->to_record_is_replaying != NULL) if (t->to_record_is_replaying != NULL)
return t->to_record_is_replaying (); return t->to_record_is_replaying (t);
return 0; return 0;
} }

View file

@ -939,7 +939,7 @@ struct target_ops
void (*to_delete_record) (struct target_ops *); void (*to_delete_record) (struct target_ops *);
/* Query if the record target is currently replaying. */ /* 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. */ /* Go to the begin of the execution trace. */
void (*to_goto_record_begin) (void); void (*to_goto_record_begin) (void);