]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/target-delegates.c
convert to_load
[thirdparty/binutils-gdb.git] / gdb / target-delegates.c
index 92729d62406895b20d2c2f1dc80c398165aa63ec..80e7ede9c1b311ce54ba550386349012b3354f21 100644 (file)
@@ -297,6 +297,19 @@ delegate_terminal_info (struct target_ops *self, const char *arg1, int arg2)
   self->to_terminal_info (self, arg1, arg2);
 }
 
+static void
+delegate_load (struct target_ops *self, char *arg1, int arg2)
+{
+  self = self->beneath;
+  self->to_load (self, arg1, arg2);
+}
+
+static void
+tdefault_load (struct target_ops *self, char *arg1, int arg2)
+{
+  tcomplain ();
+}
+
 static void
 delegate_rcmd (struct target_ops *self, char *arg1, struct ui_file *arg2)
 {
@@ -412,6 +425,8 @@ install_delegators (struct target_ops *ops)
     ops->to_terminal_save_ours = delegate_terminal_save_ours;
   if (ops->to_terminal_info == NULL)
     ops->to_terminal_info = delegate_terminal_info;
+  if (ops->to_load == NULL)
+    ops->to_load = delegate_load;
   if (ops->to_rcmd == NULL)
     ops->to_rcmd = delegate_rcmd;
   if (ops->to_can_async_p == NULL)
@@ -455,6 +470,7 @@ install_dummy_methods (struct target_ops *ops)
   ops->to_terminal_ours = tdefault_terminal_ours;
   ops->to_terminal_save_ours = tdefault_terminal_save_ours;
   ops->to_terminal_info = default_terminal_info;
+  ops->to_load = tdefault_load;
   ops->to_rcmd = default_rcmd;
   ops->to_can_async_p = find_default_can_async_p;
   ops->to_is_async_p = find_default_is_async_p;