* NEWS: Add entry for stdio gdbserver.
[deliverable/binutils-gdb.git] / gdb / gdbserver / server.c
index b90b9ceced79a895ff769487023163f224679184..74263f12609595a1b227d053ddc2579779f7124e 100644 (file)
@@ -2606,6 +2606,13 @@ main (int argc, char *argv[])
                }
            }
        }
+      else if (strcmp (*next_arg, "-") == 0)
+       {
+         /* "-" specifies a stdio connection and is a form of port
+            specification.  */
+         *next_arg = STDIO_CONNECTION_NAME;
+         break;
+       }
       else if (strcmp (*next_arg, "--disable-randomization") == 0)
        disable_randomization = 1;
       else if (strcmp (*next_arg, "--no-disable-randomization") == 0)
@@ -2636,6 +2643,12 @@ main (int argc, char *argv[])
       exit (1);
     }
 
+  /* We need to know whether the remote connection is stdio before
+     starting the inferior.  Inferiors created in this scenario have
+     stdin,stdout redirected.  So do this here before we call
+     start_inferior.  */
+  remote_prepare (port);
+
   bad_attach = 0;
   pid = 0;
 
@@ -2723,8 +2736,6 @@ main (int argc, char *argv[])
       exit (1);
     }
 
-  remote_prepare (port);
-
   while (1)
     {
       noack_mode = 0;
This page took 0.024648 seconds and 4 git commands to generate.