aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-12-18 11:12:28 -0700
committerTom Tromey <tromey@redhat.com>2014-02-19 07:47:35 -0700
commit53e1cfc77f60479a222bf52261b6a1f77bc3a445 (patch)
tree771c7f136b6c9d81d1563b66d4a65b1547555f89 /gdb
parent9bb9d61d2fbf706a34b8ddf0d87b9d1fc642d728 (diff)
downloadgdb-53e1cfc77f60479a222bf52261b6a1f77bc3a445.zip
gdb-53e1cfc77f60479a222bf52261b6a1f77bc3a445.tar.gz
gdb-53e1cfc77f60479a222bf52261b6a1f77bc3a445.tar.bz2
convert to_can_execute_reverse
2014-02-19 Tom Tromey <tromey@redhat.com> * target-delegates.c: Rebuild. * target.c (update_current_target): Don't inherit or default to_can_execute_reverse. * target.h (struct target_ops) <to_can_execute_reverse>: Use TARGET_DEFAULT_RETURN. (target_can_execute_reverse): Unconditionally delegate.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog9
-rw-r--r--gdb/target-delegates.c16
-rw-r--r--gdb/target.c2
-rw-r--r--gdb/target.h6
4 files changed, 29 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d68cd3f..4894019 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_can_execute_reverse.
+ * target.h (struct target_ops) <to_can_execute_reverse>: Use
+ TARGET_DEFAULT_RETURN.
+ (target_can_execute_reverse): Unconditionally delegate.
+
+2014-02-19 Tom Tromey <tromey@redhat.com>
+
+ * target-delegates.c: Rebuild.
+ * target.c (update_current_target): Don't inherit or default
to_goto_bookmark.
(dummy_goto_bookmark): Remove.
(init_dummy_target): Don't inherit or default to_goto_bookmark.
diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c
index cb03f54..573f9b5 100644
--- a/gdb/target-delegates.c
+++ b/gdb/target-delegates.c
@@ -565,6 +565,19 @@ tdefault_xfer_partial (struct target_ops *self, enum target_object arg1, const
}
static int
+delegate_can_execute_reverse (struct target_ops *self)
+{
+ self = self->beneath;
+ return self->to_can_execute_reverse (self);
+}
+
+static int
+tdefault_can_execute_reverse (struct target_ops *self)
+{
+ return 0;
+}
+
+static int
delegate_supports_btrace (struct target_ops *self)
{
self = self->beneath;
@@ -678,6 +691,8 @@ install_delegators (struct target_ops *ops)
ops->to_goto_bookmark = delegate_goto_bookmark;
if (ops->to_xfer_partial == NULL)
ops->to_xfer_partial = delegate_xfer_partial;
+ if (ops->to_can_execute_reverse == NULL)
+ ops->to_can_execute_reverse = delegate_can_execute_reverse;
if (ops->to_supports_btrace == NULL)
ops->to_supports_btrace = delegate_supports_btrace;
}
@@ -734,5 +749,6 @@ install_dummy_methods (struct target_ops *ops)
ops->to_get_bookmark = tdefault_get_bookmark;
ops->to_goto_bookmark = tdefault_goto_bookmark;
ops->to_xfer_partial = tdefault_xfer_partial;
+ ops->to_can_execute_reverse = tdefault_can_execute_reverse;
ops->to_supports_btrace = tdefault_supports_btrace;
}
diff --git a/gdb/target.c b/gdb/target.c
index 5aefda9..1f60aa0 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -673,7 +673,7 @@ update_current_target (void)
/* Do not inherit to_get_bookmark. */
/* Do not inherit to_goto_bookmark. */
/* Do not inherit to_get_thread_local_address. */
- INHERIT (to_can_execute_reverse, t);
+ /* Do not inherit to_can_execute_reverse. */
INHERIT (to_execution_direction, t);
INHERIT (to_thread_architecture, t);
/* Do not inherit to_read_description. */
diff --git a/gdb/target.h b/gdb/target.h
index 05a6b1a..9b0ad98 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -701,7 +701,8 @@ struct target_ops
CORE_ADDR *found_addrp);
/* Can target execute in reverse? */
- int (*to_can_execute_reverse) (struct target_ops *);
+ int (*to_can_execute_reverse) (struct target_ops *)
+ TARGET_DEFAULT_RETURN (0);
/* The direction the target is currently executing. Must be
implemented on targets that support reverse execution and async
@@ -1759,8 +1760,7 @@ extern int target_masked_watch_num_registers (CORE_ADDR addr, CORE_ADDR mask);
/* Target can execute in reverse? */
#define target_can_execute_reverse \
- (current_target.to_can_execute_reverse ? \
- current_target.to_can_execute_reverse (&current_target) : 0)
+ current_target.to_can_execute_reverse (&current_target)
extern const struct target_desc *target_read_description (struct target_ops *);