+2014-02-19 Tom Tromey <tromey@redhat.com>
+
+ * target-delegates.c: Rebuild.
+ * target.c (target_thread_alive): Unconditionally delegate.
+ * target.h (struct target_ops) <to_thread_alive>: Use
+ TARGET_DEFAULT_RETURN.
+
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
{
}
+static int
+delegate_thread_alive (struct target_ops *self, ptid_t arg1)
+{
+ self = self->beneath;
+ return self->to_thread_alive (self, arg1);
+}
+
+static int
+tdefault_thread_alive (struct target_ops *self, ptid_t arg1)
+{
+ return 0;
+}
+
static void
delegate_find_new_threads (struct target_ops *self)
{
ops->to_pass_signals = delegate_pass_signals;
if (ops->to_program_signals == NULL)
ops->to_program_signals = delegate_program_signals;
+ if (ops->to_thread_alive == NULL)
+ ops->to_thread_alive = delegate_thread_alive;
if (ops->to_find_new_threads == NULL)
ops->to_find_new_threads = delegate_find_new_threads;
if (ops->to_pid_to_str == NULL)
ops->to_mourn_inferior = default_mourn_inferior;
ops->to_pass_signals = tdefault_pass_signals;
ops->to_program_signals = tdefault_program_signals;
+ ops->to_thread_alive = tdefault_thread_alive;
ops->to_find_new_threads = tdefault_find_new_threads;
ops->to_pid_to_str = default_pid_to_str;
ops->to_extra_thread_info = tdefault_extra_thread_info;
int
target_thread_alive (ptid_t ptid)
{
- struct target_ops *t;
-
- for (t = current_target.beneath; t != NULL; t = t->beneath)
- {
- if (t->to_thread_alive != NULL)
- {
- int retval;
-
- retval = t->to_thread_alive (t, ptid);
- if (targetdebug)
- fprintf_unfiltered (gdb_stdlog, "target_thread_alive (%d) = %d\n",
- ptid_get_pid (ptid), retval);
+ int retval;
- return retval;
- }
- }
+ retval = current_target.to_thread_alive (¤t_target, ptid);
+ if (targetdebug)
+ fprintf_unfiltered (gdb_stdlog, "target_thread_alive (%d) = %d\n",
+ ptid_get_pid (ptid), retval);
- return 0;
+ return retval;
}
void
void (*to_program_signals) (struct target_ops *, int, unsigned char *)
TARGET_DEFAULT_IGNORE ();
- int (*to_thread_alive) (struct target_ops *, ptid_t ptid);
+ int (*to_thread_alive) (struct target_ops *, ptid_t ptid)
+ TARGET_DEFAULT_RETURN (0);
void (*to_find_new_threads) (struct target_ops *)
TARGET_DEFAULT_IGNORE ();
char *(*to_pid_to_str) (struct target_ops *, ptid_t)