summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@specifix.com>2008-09-30 23:36:42 +0000
committerMichael Snyder <msnyder@specifix.com>2008-09-30 23:36:42 +0000
commit67fdd70acf9e26076232f4d9ea6c34d4d6391d1b (patch)
tree9f77c0064c2e44579532946137a9551c30f3dba0
parenta474e947a7f0d6ce93c27392ca5fae94c094ddbd (diff)
downloadgdb-67fdd70acf9e26076232f4d9ea6c34d4d6391d1b.tar.gz
2008-09-30 Michael Snyder <msnyder@vmware.com>
Target interface for reverse debugging. * target.h (enum target_waitkind): Add new wait event, TARGET_WAITKIND_NO_HISTORY. (enum exec_direction_kind): New enum. (struct target_ops): New methods to_set_execdir, to_get_execdir. * target.c (target_get_execdir): New generic method. (target_set_execdir): Ditto.
-rw-r--r--gdb/ChangeLog9
-rw-r--r--gdb/target.c2
-rw-r--r--gdb/target.h31
3 files changed, 41 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index f6d30f1c863..e543b726bc9 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,12 @@
+2008-09-30 Michael Snyder <msnyder@vmware.com>
+ Target interface for reverse debugging.
+ * target.h (enum target_waitkind):
+ Add new wait event, TARGET_WAITKIND_NO_HISTORY.
+ (enum exec_direction_kind): New enum.
+ (struct target_ops): New methods to_set_execdir, to_get_execdir.
+ * target.c (target_get_execdir): New generic method.
+ (target_set_execdir): Ditto.
+
2008-09-30 Paul Hilfinger <hilfinger@adacore.com>
* ada-lang.c (ada_modulus): Correct to avoid sign problem with
diff --git a/gdb/target.c b/gdb/target.c
index a509c173db7..076bb04133b 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -455,6 +455,8 @@ update_current_target (void)
INHERIT (to_find_memory_regions, t);
INHERIT (to_make_corefile_notes, t);
INHERIT (to_get_thread_local_address, t);
+ INHERIT (to_get_execdir, t);
+ INHERIT (to_set_execdir, t);
/* Do not inherit to_read_description. */
/* Do not inherit to_search_memory. */
INHERIT (to_magic, t);
diff --git a/gdb/target.h b/gdb/target.h
index 067c031d8c9..d14c33c0a3e 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -128,7 +128,11 @@ enum target_waitkind
inferior, rather than being stuck in the remote_async_wait()
function. This way the event loop is responsive to other events,
like for instance the user typing. */
- TARGET_WAITKIND_IGNORE
+ TARGET_WAITKIND_IGNORE,
+
+ /* The target has run out of history information,
+ and cannot run backward any further. */
+ TARGET_WAITKIND_NO_HISTORY
};
struct target_waitstatus
@@ -147,6 +151,14 @@ struct target_waitstatus
value;
};
+/* Reverse execution. */
+enum exec_direction_kind
+ {
+ EXEC_FORWARD,
+ EXEC_REVERSE,
+ EXEC_ERROR
+ };
+
/* Possible types of events that the inferior handler will have to
deal with. */
enum inferior_event_type
@@ -523,6 +535,11 @@ struct target_ops
const gdb_byte *pattern, ULONGEST pattern_len,
CORE_ADDR *found_addrp);
+ /* Set execution direction (forward/reverse). */
+ int (*to_set_execdir) (enum exec_direction_kind);
+ /* Get execution direction (forward/reverse). */
+ enum exec_direction_kind (*to_get_execdir) (void);
+
int to_magic;
/* Need sub-structure for target machine related rather than comm related?
*/
@@ -1127,6 +1144,18 @@ extern int target_stopped_data_address_p (struct target_ops *);
#define target_watchpoint_addr_within_range(target, addr, start, length) \
(*target.to_watchpoint_addr_within_range) (target, addr, start, length)
+/* Forward/reverse execution direction.
+ These will only be implemented by a target that supports reverse execution.
+*/
+#define target_get_execution_direction() \
+ (current_target.to_get_execdir ? \
+ (*current_target.to_get_execdir) () : EXEC_ERROR)
+
+#define target_set_execution_direction(DIR) \
+ (current_target.to_set_execdir ? \
+ (*current_target.to_set_execdir) (DIR) : EXEC_ERROR)
+
+
extern const struct target_desc *target_read_description (struct target_ops *);
/* Utility implementation of searching memory. */