convert to_enable_btrace

2014-02-19  Tom Tromey  <tromey@redhat.com>

	* target-delegates.c: Rebuild.
	* target.c (target_enable_btrace): Unconditionally delegate.
	* target.h (struct target_ops) <to_enable_btrace>: Use
	TARGET_DEFAULT_NORETURN.
This commit is contained in:
Tom Tromey 2013-12-19 08:19:41 -07:00
parent eb5b20d490
commit 6dc7fcf4c1
4 changed files with 26 additions and 9 deletions

View File

@ -1,3 +1,10 @@
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (target_enable_btrace): Unconditionally delegate.
* target.h (struct target_ops) <to_enable_btrace>: Use
TARGET_DEFAULT_NORETURN.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.

View File

@ -1300,6 +1300,19 @@ tdefault_supports_btrace (struct target_ops *self)
return 0;
}
static struct btrace_target_info *
delegate_enable_btrace (struct target_ops *self, ptid_t arg1)
{
self = self->beneath;
return self->to_enable_btrace (self, arg1);
}
static struct btrace_target_info *
tdefault_enable_btrace (struct target_ops *self, ptid_t arg1)
{
tcomplain ();
}
static void
delegate_disable_btrace (struct target_ops *self, struct btrace_target_info *arg1)
{
@ -1731,6 +1744,8 @@ install_delegators (struct target_ops *ops)
ops->to_can_use_agent = delegate_can_use_agent;
if (ops->to_supports_btrace == NULL)
ops->to_supports_btrace = delegate_supports_btrace;
if (ops->to_enable_btrace == NULL)
ops->to_enable_btrace = delegate_enable_btrace;
if (ops->to_disable_btrace == NULL)
ops->to_disable_btrace = delegate_disable_btrace;
if (ops->to_teardown_btrace == NULL)
@ -1878,6 +1893,7 @@ install_dummy_methods (struct target_ops *ops)
ops->to_use_agent = tdefault_use_agent;
ops->to_can_use_agent = tdefault_can_use_agent;
ops->to_supports_btrace = tdefault_supports_btrace;
ops->to_enable_btrace = tdefault_enable_btrace;
ops->to_disable_btrace = tdefault_disable_btrace;
ops->to_teardown_btrace = tdefault_teardown_btrace;
ops->to_read_btrace = tdefault_read_btrace;

View File

@ -3784,14 +3784,7 @@ target_ranged_break_num_registers (void)
struct btrace_target_info *
target_enable_btrace (ptid_t ptid)
{
struct target_ops *t;
for (t = current_target.beneath; t != NULL; t = t->beneath)
if (t->to_enable_btrace != NULL)
return t->to_enable_btrace (t, ptid);
tcomplain ();
return NULL;
return current_target.to_enable_btrace (&current_target, ptid);
}
/* See target.h. */

View File

@ -1001,7 +1001,8 @@ struct target_ops
/* Enable branch tracing for PTID and allocate a branch trace target
information struct for reading and for disabling branch trace. */
struct btrace_target_info *(*to_enable_btrace) (struct target_ops *,
ptid_t ptid);
ptid_t ptid)
TARGET_DEFAULT_NORETURN (tcomplain ());
/* Disable branch tracing and deallocate TINFO. */
void (*to_disable_btrace) (struct target_ops *,