convert to_can_use_agent
authorTom Tromey <tromey@redhat.com>
Wed, 18 Dec 2013 21:19:04 +0000 (14:19 -0700)
committerTom Tromey <tromey@redhat.com>
Wed, 19 Feb 2014 14:48:03 +0000 (07:48 -0700)
2014-02-19  Tom Tromey  <tromey@redhat.com>

* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_can_use_agent.
* target.h (struct target_ops) <to_can_use_agent>: Use
TARGET_DEFAULT_RETURN.

gdb/ChangeLog
gdb/target-delegates.c
gdb/target.c
gdb/target.h

index 7289c28..5b76e52 100644 (file)
@@ -2,6 +2,14 @@
 
        * target-delegates.c: Rebuild.
        * target.c (update_current_target): Don't inherit or default
+       to_can_use_agent.
+       * target.h (struct target_ops) <to_can_use_agent>: Use
+       TARGET_DEFAULT_RETURN.
+
+2014-02-19  Tom Tromey  <tromey@redhat.com>
+
+       * target-delegates.c: Rebuild.
+       * target.c (update_current_target): Don't inherit or default
        to_use_agent.
        * target.h (struct target_ops) <to_use_agent>: Use
        TARGET_DEFAULT_NORETURN.
index 204b91e..8e11dfd 100644 (file)
@@ -998,6 +998,19 @@ tdefault_use_agent (struct target_ops *self, int arg1)
 }
 
 static int
+delegate_can_use_agent (struct target_ops *self)
+{
+  self = self->beneath;
+  return self->to_can_use_agent (self);
+}
+
+static int
+tdefault_can_use_agent (struct target_ops *self)
+{
+  return 0;
+}
+
+static int
 delegate_supports_btrace (struct target_ops *self)
 {
   self = self->beneath;
@@ -1181,6 +1194,8 @@ install_delegators (struct target_ops *ops)
     ops->to_traceframe_info = delegate_traceframe_info;
   if (ops->to_use_agent == NULL)
     ops->to_use_agent = delegate_use_agent;
+  if (ops->to_can_use_agent == NULL)
+    ops->to_can_use_agent = delegate_can_use_agent;
   if (ops->to_supports_btrace == NULL)
     ops->to_supports_btrace = delegate_supports_btrace;
 }
@@ -1272,5 +1287,6 @@ install_dummy_methods (struct target_ops *ops)
   ops->to_static_tracepoint_markers_by_strid = tdefault_static_tracepoint_markers_by_strid;
   ops->to_traceframe_info = tdefault_traceframe_info;
   ops->to_use_agent = tdefault_use_agent;
+  ops->to_can_use_agent = tdefault_can_use_agent;
   ops->to_supports_btrace = tdefault_supports_btrace;
 }
index a11cc91..b874ce0 100644 (file)
@@ -712,7 +712,7 @@ update_current_target (void)
       /* Do not inherit to_static_tracepoint_markers_by_strid.  */
       /* Do not inherit to_traceframe_info.  */
       /* Do not inherit to_use_agent.  */
-      INHERIT (to_can_use_agent, t);
+      /* Do not inherit to_can_use_agent.  */
       INHERIT (to_augmented_libraries_svr4_read, t);
       INHERIT (to_magic, t);
       INHERIT (to_supports_evaluation_of_breakpoint_conditions, t);
@@ -754,9 +754,6 @@ update_current_target (void)
   de_fault (to_can_run_breakpoint_commands,
            (int (*) (struct target_ops *))
            return_zero);
-  de_fault (to_can_use_agent,
-           (int (*) (struct target_ops *))
-           return_zero);
   de_fault (to_augmented_libraries_svr4_read,
            (int (*) (struct target_ops *))
            return_zero);
index 4cc20cf..c891192 100644 (file)
@@ -967,7 +967,8 @@ struct target_ops
       TARGET_DEFAULT_NORETURN (tcomplain ());
 
     /* Is the target able to use agent in current state?  */
-    int (*to_can_use_agent) (struct target_ops *);
+    int (*to_can_use_agent) (struct target_ops *)
+      TARGET_DEFAULT_RETURN (0);
 
     /* Check whether the target supports branch tracing.  */
     int (*to_supports_btrace) (struct target_ops *)