This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFA] Resubmit reverse debugging [1/5]
- From: Michael Snyder <msnyder at vmware dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Tue, 07 Oct 2008 19:16:04 -0700
- Subject: [RFA] Resubmit reverse debugging [1/5]
The target_ops layer, revised:
2008-10-07 Michael Snyder <msnyder@vmware.com>
Target interface for reverse debugging.
* target.h (enum target_waitkind):
Add new wait event, TARGET_WAITKIND_NO_HISTORY.
(struct target_ops): New method to_can_execute_reverse.
* target.c (update_current_target): Inherit to_can_execute_reverse.
Index: target.c
===================================================================
RCS file: /cvs/src/src/gdb/target.c,v
retrieving revision 1.184
diff -u -p -r1.184 target.c
--- target.c 22 Sep 2008 15:21:30 -0000 1.184
+++ target.c 8 Oct 2008 00:38:57 -0000
@@ -455,6 +455,7 @@ 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_can_execute_reverse, t);
/* Do not inherit to_read_description. */
/* Do not inherit to_search_memory. */
INHERIT (to_magic, t);
Index: target.h
===================================================================
RCS file: /cvs/src/src/gdb/target.h,v
retrieving revision 1.130
diff -u -p -r1.130 target.h
--- target.h 19 Aug 2008 13:22:14 -0000 1.130
+++ target.h 8 Oct 2008 00:38:57 -0000
@@ -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
@@ -523,6 +527,9 @@ struct target_ops
const gdb_byte *pattern, ULONGEST pattern_len,
CORE_ADDR *found_addrp);
+ /* Can target execute in reverse? */
+ int (*to_can_execute_reverse) ();
+
int to_magic;
/* Need sub-structure for target machine related rather than comm related?
*/
@@ -1127,6 +1134,11 @@ extern int target_stopped_data_address_p
#define target_watchpoint_addr_within_range(target, addr, start, length) \
(*target.to_watchpoint_addr_within_range) (target, addr, start, length)
+/* Target can execute in reverse? */
+#define target_can_execute_reverse \
+ (current_target.to_can_execute_reverse ? \
+ current_target.to_can_execute_reverse () : 0)
+
extern const struct target_desc *target_read_description (struct target_ops *);
/* Utility implementation of searching memory. */