aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-12-18 14:18:10 -0700
committerTom Tromey <tromey@redhat.com>2014-02-19 07:48:02 -0700
commit92155eeb1460f2963cbd5bf15323469123d968b5 (patch)
treeb936e38e2ccee04363c2f00940b40af759c3d608
parentd6522a229d3baf2659c63a65b60947dff58ea200 (diff)
downloadgdb-92155eeb1460f2963cbd5bf15323469123d968b5.zip
gdb-92155eeb1460f2963cbd5bf15323469123d968b5.tar.gz
gdb-92155eeb1460f2963cbd5bf15323469123d968b5.tar.bz2
convert to_traceframe_info
2014-02-19 Tom Tromey <tromey@redhat.com> * target-delegates.c: Rebuild. * target.c (update_current_target): Don't inherit or default to_traceframe_info. (return_null): Remove. * target.h (struct target_ops) <to_traceframe_info>: Use TARGET_DEFAULT_RETURN.
-rw-r--r--gdb/ChangeLog9
-rw-r--r--gdb/target-delegates.c16
-rw-r--r--gdb/target.c13
-rw-r--r--gdb/target.h3
4 files changed, 28 insertions, 13 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 535040c..384faad 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -2,6 +2,15 @@
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
+ to_traceframe_info.
+ (return_null): Remove.
+ * target.h (struct target_ops) <to_traceframe_info>: 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_static_tracepoint_markers_by_strid.
* target.h (struct target_ops)
<to_static_tracepoint_markers_by_strid>: Use
diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c
index b0ada5c..a06a8e5 100644
--- a/gdb/target-delegates.c
+++ b/gdb/target-delegates.c
@@ -971,6 +971,19 @@ tdefault_static_tracepoint_markers_by_strid (struct target_ops *self, const char
tcomplain ();
}
+static struct traceframe_info *
+delegate_traceframe_info (struct target_ops *self)
+{
+ self = self->beneath;
+ return self->to_traceframe_info (self);
+}
+
+static struct traceframe_info *
+tdefault_traceframe_info (struct target_ops *self)
+{
+ return 0;
+}
+
static int
delegate_supports_btrace (struct target_ops *self)
{
@@ -1151,6 +1164,8 @@ install_delegators (struct target_ops *ops)
ops->to_static_tracepoint_marker_at = delegate_static_tracepoint_marker_at;
if (ops->to_static_tracepoint_markers_by_strid == NULL)
ops->to_static_tracepoint_markers_by_strid = delegate_static_tracepoint_markers_by_strid;
+ if (ops->to_traceframe_info == NULL)
+ ops->to_traceframe_info = delegate_traceframe_info;
if (ops->to_supports_btrace == NULL)
ops->to_supports_btrace = delegate_supports_btrace;
}
@@ -1240,5 +1255,6 @@ install_dummy_methods (struct target_ops *ops)
ops->to_set_permissions = tdefault_set_permissions;
ops->to_static_tracepoint_marker_at = tdefault_static_tracepoint_marker_at;
ops->to_static_tracepoint_markers_by_strid = tdefault_static_tracepoint_markers_by_strid;
+ ops->to_traceframe_info = tdefault_traceframe_info;
ops->to_supports_btrace = tdefault_supports_btrace;
}
diff --git a/gdb/target.c b/gdb/target.c
index cd10f2f..2b4f2aa 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -66,8 +66,6 @@ static int nomemory (CORE_ADDR, char *, int, int, struct target_ops *);
static int return_zero (void);
-static void *return_null (void);
-
void target_ignore (void);
static void target_command (char *, int);
@@ -712,7 +710,7 @@ update_current_target (void)
/* Do not inherit to_set_permissions. */
/* Do not inherit to_static_tracepoint_marker_at. */
/* Do not inherit to_static_tracepoint_markers_by_strid. */
- INHERIT (to_traceframe_info, t);
+ /* Do not inherit to_traceframe_info. */
INHERIT (to_use_agent, t);
INHERIT (to_can_use_agent, t);
INHERIT (to_augmented_libraries_svr4_read, t);
@@ -750,9 +748,6 @@ update_current_target (void)
(void (*) (struct target_ops *, ptid_t))
target_ignore);
current_target.to_read_description = NULL;
- de_fault (to_traceframe_info,
- (struct traceframe_info * (*) (struct target_ops *))
- return_null);
de_fault (to_supports_evaluation_of_breakpoint_conditions,
(int (*) (struct target_ops *))
return_zero);
@@ -3478,12 +3473,6 @@ return_zero (void)
return 0;
}
-static void *
-return_null (void)
-{
- return 0;
-}
-
/*
* Find the next target down the stack from the specified target.
*/
diff --git a/gdb/target.h b/gdb/target.h
index 457479e..a8c982e 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -958,7 +958,8 @@ struct target_ops
is available in the read-only sections. This method should not
cache data; higher layers take care of caching, invalidating,
and re-fetching when necessary. */
- struct traceframe_info *(*to_traceframe_info) (struct target_ops *);
+ struct traceframe_info *(*to_traceframe_info) (struct target_ops *)
+ TARGET_DEFAULT_RETURN (0);
/* Ask the target to use or not to use agent according to USE. Return 1
successful, 0 otherwise. */