aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/remote.c')
-rw-r--r--gdb/remote.c62
1 files changed, 60 insertions, 2 deletions
diff --git a/gdb/remote.c b/gdb/remote.c
index 866c477..0fd8c24 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -2851,7 +2851,15 @@ remote_resume (ptid_t ptid, int step, enum target_signal siggnal)
set_thread (pid, 0); /* Run this thread. */
buf = rs->buf;
- 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);
@@ -3125,6 +3133,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. */
@@ -6110,6 +6123,47 @@ remote_read_description (struct target_ops *target)
return NULL;
}
+/* 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
+remote_doing_call (int starting)
+{
+ struct remote_state *rs = get_remote_state ();
+
+ if (starting)
+ strcpy (rs->buf, "QStartCall");
+ else
+ strcpy (rs->buf, "QEndCall");
+ remote_send (&rs->buf, &rs->buf_size);
+}
+
static void
init_remote_ops (void)
{
@@ -6157,11 +6211,14 @@ 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;
remote_ops.to_memory_map = remote_memory_map;
remote_ops.to_flash_erase = remote_flash_erase;
remote_ops.to_flash_done = remote_flash_done;
remote_ops.to_read_description = remote_read_description;
+ remote_ops.to_doing_call = remote_doing_call;
}
/* Set up the extended remote vector by making a copy of the standard
@@ -6294,7 +6351,8 @@ Specify the serial device it is connected to (e.g. /dev/ttya).";
remote_async_ops.to_memory_map = remote_memory_map;
remote_async_ops.to_flash_erase = remote_flash_erase;
remote_async_ops.to_flash_done = remote_flash_done;
- remote_ops.to_read_description = remote_read_description;
+ remote_async_ops.to_read_description = remote_read_description;
+ remote_async_ops.to_doing_call = remote_doing_call;
}
/* Set up the async extended remote vector by making a copy of the standard