set_remote_protocol_packet_cmd,
show_remote_protocol_packet_cmd,
&remote_set_cmdlist, &remote_show_cmdlist);
+ /* The command code copies the documentation strings. */
+ xfree (set_doc);
+ xfree (show_doc);
/* set/show remote NAME-packet {auto,on,off} -- legacy. */
if (legacy)
{
PACKET_qXfer_siginfo_write,
PACKET_qAttached,
PACKET_ConditionalTracepoints,
+ PACKET_bc,
+ PACKET_bs,
PACKET_MAX
};
PACKET_qXfer_siginfo_write },
{ "ConditionalTracepoints", PACKET_DISABLE, remote_cond_tracepoint_feature,
PACKET_ConditionalTracepoints },
+ { "ReverseContinue", PACKET_DISABLE, remote_supported_packet,
+ PACKET_bc },
+ { "ReverseStep", PACKET_DISABLE, remote_supported_packet,
+ PACKET_bs },
};
static void
remote_pass_signals ();
/* The vCont packet doesn't need to specify threads via Hc. */
- if (remote_vcont_resume (ptid, step, siggnal))
- goto done;
+ /* No reverse support (yet) for vCont. */
+ if (execution_direction != EXEC_REVERSE)
+ if (remote_vcont_resume (ptid, step, siggnal))
+ goto done;
/* All other supported resume packets do use Hc, so set the continue
thread. */
if (info_verbose && siggnal != TARGET_SIGNAL_0)
warning (" - Can't pass signal %d to target in reverse: ignored.\n",
siggnal);
+
+ if (step
+ && remote_protocol_packets[PACKET_bs].support == PACKET_DISABLE)
+ error (_("Remote reverse-step not supported."));
+ if (!step
+ && remote_protocol_packets[PACKET_bc].support == PACKET_DISABLE)
+ error (_("Remote reverse-continue not supported."));
+
strcpy (buf, step ? "bs" : "bc");
}
else if (siggnal != TARGET_SIGNAL_0)
struct cleanup *old_chain;
struct ui_file *stb;
char *str;
- long length;
stb = mem_fileopen ();
old_chain = make_cleanup_ui_file_delete (stb);
fputstrn_unfiltered (buf, n, 0, stb);
- str = ui_file_xstrdup (stb, &length);
+ str = ui_file_xstrdup (stb, NULL);
do_cleanups (old_chain);
return str;
}
static char buf[64];
struct remote_state *rs = get_remote_state ();
- if (ptid_equal (magic_null_ptid, ptid))
- {
- xsnprintf (buf, sizeof buf, "Thread <main>");
- return buf;
- }
- else if (remote_multi_process_p (rs)
- && ptid_get_tid (ptid) != 0 && ptid_get_pid (ptid) != 0)
+ if (ptid_is_pid (ptid))
{
- xsnprintf (buf, sizeof buf, "Thread %d.%ld",
- ptid_get_pid (ptid), ptid_get_tid (ptid));
- return buf;
+ /* Printing an inferior target id. */
+
+ /* When multi-process extensions are off, there's no way in the
+ remote protocol to know the remote process id, if there's any
+ at all. There's one exception --- when we're connected with
+ target extended-remote, and we manually attached to a process
+ with "attach PID". We don't record anywhere a flag that
+ allows us to distinguish that case from the case of
+ connecting with extended-remote and the stub already being
+ attached to a process, and reporting yes to qAttached, hence
+ no smart special casing here. */
+ if (!remote_multi_process_p (rs))
+ {
+ xsnprintf (buf, sizeof buf, "Remote target");
+ return buf;
+ }
+
+ return normal_pid_to_str (ptid);
}
- else if (ptid_get_tid (ptid) != 0)
+ else
{
- xsnprintf (buf, sizeof buf, "Thread %ld",
- ptid_get_tid (ptid));
+ if (ptid_equal (magic_null_ptid, ptid))
+ xsnprintf (buf, sizeof buf, "Thread <main>");
+ else if (remote_multi_process_p (rs))
+ xsnprintf (buf, sizeof buf, "Thread %d.%ld",
+ ptid_get_pid (ptid), ptid_get_tid (ptid));
+ else
+ xsnprintf (buf, sizeof buf, "Thread %ld",
+ ptid_get_tid (ptid));
return buf;
}
-
- return normal_pid_to_str (ptid);
}
/* Get the address of the thread local variable in OBJFILE which is
help_list (remote_cmdlist, "remote ", -1, gdb_stdout);
}
-static int remote_target_can_reverse = 1;
-
static int
remote_can_execute_reverse (void)
{
- return remote_target_can_reverse;
+ if (remote_protocol_packets[PACKET_bs].support == PACKET_ENABLE
+ || remote_protocol_packets[PACKET_bc].support == PACKET_ENABLE)
+ return 1;
+ else
+ return 0;
}
static int
"qGetTLSAddr", "get-thread-local-storage-address",
0);
+ add_packet_config_cmd (&remote_protocol_packets[PACKET_bc],
+ "bc", "reverse-continue", 0);
+
+ add_packet_config_cmd (&remote_protocol_packets[PACKET_bs],
+ "bs", "reverse-step", 0);
+
add_packet_config_cmd (&remote_protocol_packets[PACKET_qSupported],
"qSupported", "supported-packets", 0);