aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/remote.c')
-rw-r--r--gdb/remote.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gdb/remote.c b/gdb/remote.c
index 1f86079..b66ecee 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -1428,6 +1428,7 @@ enum {
PACKET_QPassSignals,
PACKET_QCatchSyscalls,
PACKET_QProgramSignals,
+ PACKET_QStartupWithShell,
PACKET_qCRC,
PACKET_qSearch_memory,
PACKET_vAttach,
@@ -4633,6 +4634,8 @@ static const struct protocol_feature remote_protocol_features[] = {
PACKET_QCatchSyscalls },
{ "QProgramSignals", PACKET_DISABLE, remote_supported_packet,
PACKET_QProgramSignals },
+ { "QStartupWithShell", PACKET_DISABLE, remote_supported_packet,
+ PACKET_QStartupWithShell },
{ "QStartNoAckMode", PACKET_DISABLE, remote_supported_packet,
PACKET_QStartNoAckMode },
{ "multiprocess", PACKET_DISABLE, remote_supported_packet,
@@ -9614,6 +9617,20 @@ extended_remote_create_inferior (struct target_ops *ops,
if (extended_remote_supports_disable_randomization (ops))
extended_remote_disable_randomization (disable_randomization);
+ /* If startup-with-shell is on, we inform gdbserver to start the
+ remote inferior using a shell. */
+ if (packet_support (PACKET_QStartupWithShell) != PACKET_DISABLE)
+ {
+ xsnprintf (rs->buf, get_remote_packet_size (),
+ "QStartupWithShell:%d", startup_with_shell ? 1 : 0);
+ putpkt (rs->buf);
+ getpkt (&rs->buf, &rs->buf_size, 0);
+ if (strcmp (rs->buf, "OK") != 0)
+ error (_("\
+Remote replied unexpectedly while setting startup-with-shell: %s"),
+ rs->buf);
+ }
+
/* Now restart the remote server. */
run_worked = extended_remote_run (args) != -1;
if (!run_worked)
@@ -14104,6 +14121,9 @@ Show the maximum size of the address (in bits) in a memory packet."), NULL,
add_packet_config_cmd (&remote_protocol_packets[PACKET_QProgramSignals],
"QProgramSignals", "program-signals", 0);
+ add_packet_config_cmd (&remote_protocol_packets[PACKET_QStartupWithShell],
+ "QStartupWithShell", "startup-with-shell", 0);
+
add_packet_config_cmd (&remote_protocol_packets[PACKET_qSymbol],
"qSymbol", "symbol-lookup", 0);