aboutsummaryrefslogtreecommitdiff
path: root/gdb/target-delegates.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-12-20 12:19:37 -0700
committerTom Tromey <tromey@redhat.com>2014-02-19 07:48:40 -0700
commite88ef65ce5f5ec33931c71c2c7a1f490b90ddd44 (patch)
treef18ff48f2225f5b8171a2a7c47205e45fa44ff86 /gdb/target-delegates.c
parent86a0854a691a220419785b2008bf2fb0ddd6e46f (diff)
downloadgdb-e88ef65ce5f5ec33931c71c2c7a1f490b90ddd44.zip
gdb-e88ef65ce5f5ec33931c71c2c7a1f490b90ddd44.tar.gz
gdb-e88ef65ce5f5ec33931c71c2c7a1f490b90ddd44.tar.bz2
convert to_can_run
2014-02-19 Tom Tromey <tromey@redhat.com> * target-delegates.c: Rebuild. * target.c (update_current_target): Don't inherit or default to_can_run. (find_default_run_target): Check against delegate_can_run. * target.h (struct target_ops) <to_can_run>: Use TARGET_DEFAULT_RETURN.
Diffstat (limited to 'gdb/target-delegates.c')
-rw-r--r--gdb/target-delegates.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c
index 1565c78..0ffee5a 100644
--- a/gdb/target-delegates.c
+++ b/gdb/target-delegates.c
@@ -530,6 +530,19 @@ delegate_mourn_inferior (struct target_ops *self)
self->to_mourn_inferior (self);
}
+static int
+delegate_can_run (struct target_ops *self)
+{
+ self = self->beneath;
+ return self->to_can_run (self);
+}
+
+static int
+tdefault_can_run (struct target_ops *self)
+{
+ return 0;
+}
+
static void
delegate_pass_signals (struct target_ops *self, int arg1, unsigned char *arg2)
{
@@ -1639,6 +1652,8 @@ install_delegators (struct target_ops *ops)
ops->to_has_exited = delegate_has_exited;
if (ops->to_mourn_inferior == NULL)
ops->to_mourn_inferior = delegate_mourn_inferior;
+ if (ops->to_can_run == NULL)
+ ops->to_can_run = delegate_can_run;
if (ops->to_pass_signals == NULL)
ops->to_pass_signals = delegate_pass_signals;
if (ops->to_program_signals == NULL)
@@ -1857,6 +1872,7 @@ install_dummy_methods (struct target_ops *ops)
ops->to_set_syscall_catchpoint = tdefault_set_syscall_catchpoint;
ops->to_has_exited = tdefault_has_exited;
ops->to_mourn_inferior = default_mourn_inferior;
+ ops->to_can_run = tdefault_can_run;
ops->to_pass_signals = tdefault_pass_signals;
ops->to_program_signals = tdefault_program_signals;
ops->to_thread_alive = tdefault_thread_alive;