diff options
author | Michael Snyder <msnyder@vmware.com> | 2006-03-31 20:45:33 +0000 |
---|---|---|
committer | Michael Snyder <msnyder@vmware.com> | 2006-03-31 20:45:33 +0000 |
commit | 1584f937ffcf8555c362e2f8e9bc6216ac189450 (patch) | |
tree | ce8b1c68f2991c7d65f77d7deac877260904147e | |
parent | 1f8a316b13dd3ff6cb8e27aef3a3d3e514af26db (diff) | |
download | fsf-binutils-gdb-1584f937ffcf8555c362e2f8e9bc6216ac189450.zip fsf-binutils-gdb-1584f937ffcf8555c362e2f8e9bc6216ac189450.tar.gz fsf-binutils-gdb-1584f937ffcf8555c362e2f8e9bc6216ac189450.tar.bz2 |
2006-03-31 Michael Snyder <msnyder@redhat.com>
Target interface for reverse execution.
* remote.c (remote_get_execdir, remote_set_execdir): New methods.
(_initialize_remote): Add new methods to remote target vector.
(remote_resume): Check for reverse exec direction, and send
appropriate command to target.
(remote_wait): Check target response for NO_HISTORY status.
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/remote.c | 46 |
2 files changed, 51 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2cc5b60..52d84e8 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -9,6 +9,12 @@ (target_get_execution_direction): New macro. * target.c (update_current_target): Inherit new execdir methods. + * remote.c (remote_get_execdir, remote_set_execdir): New methods. + (_initialize_remote): Add new methods to remote target vector. + (remote_resume): Check for reverse exec direction, and send + appropriate command to target. + (remote_wait): Check target response for NO_HISTORY status. + 2006-03-31 Andrew Stubbs <andrew.stubbs@st.com> * value.h (struct internalvar): Add field 'endian'. diff --git a/gdb/remote.c b/gdb/remote.c index 582a6bf..2a2f458 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -2400,7 +2400,15 @@ remote_resume (ptid_t ptid, int step, enum target_signal siggnal) else set_thread (pid, 0); /* Run this thread. */ - if (siggnal != TARGET_SIGNAL_0) + if (target_get_execution_direction () == EXEC_REVERSE) + { + /* We don't pass signals to the target in reverse exec mode. */ + if (info_verbose && siggnal != TARGET_SIGNAL_0) + warning (" - Can't pass signal %d to target in reverse: ignored.\n", + siggnal); + strcpy (buf, step ? "bs" : "bc"); + } + else if (siggnal != TARGET_SIGNAL_0) { buf[0] = step ? 'S' : 'C'; buf[1] = tohex (((int) siggnal >> 4) & 0xf); @@ -2674,6 +2682,11 @@ remote_wait (ptid_t ptid, struct target_waitstatus *status) switch (buf[0]) { case 'E': /* Error of some sort. */ + if (buf[1] == '0' && buf[2] == '6') + { + status->kind = TARGET_WAITKIND_NO_HISTORY; + goto got_status; + } warning (_("Remote failure reply: %s"), buf); continue; case 'F': /* File-I/O request. */ @@ -5180,6 +5193,35 @@ remote_get_thread_local_address (ptid_t ptid, CORE_ADDR lm, CORE_ADDR offset) return 0; } +/* Reverse execution. + FIXME: set up as a capability. */ +static enum exec_direction_kind remote_execdir = EXEC_FORWARD; + +static enum exec_direction_kind remote_get_execdir (void) +{ + if (remote_debug && info_verbose) + printf_filtered ("remote execdir is %s\n", + remote_execdir == EXEC_FORWARD ? "forward" : + remote_execdir == EXEC_REVERSE ? "reverse" : + "unknown"); + return remote_execdir; +} + +static int remote_set_execdir (enum exec_direction_kind dir) +{ + if (remote_debug && info_verbose) + printf_filtered ("Set remote execdir: %s\n", + dir == EXEC_FORWARD ? "forward" : + dir == EXEC_REVERSE ? "reverse" : + "bad direction"); + + /* FIXME: check target for capability. */ + if (dir == EXEC_FORWARD || dir == EXEC_REVERSE) + return (remote_execdir = dir); + else + return EXEC_ERROR; +} + static void init_remote_ops (void) { @@ -5227,6 +5269,8 @@ Specify the serial device it is connected to\n\ remote_ops.to_has_registers = 1; remote_ops.to_has_execution = 1; remote_ops.to_has_thread_control = tc_schedlock; /* can lock scheduler */ + remote_ops.to_get_execdir = remote_get_execdir; + remote_ops.to_set_execdir = remote_set_execdir; remote_ops.to_magic = OPS_MAGIC; } |