* Changes from (or inspired by) AMD:
authorJim Kingdon <jkingdon@engr.sgi.com>
Sun, 25 Apr 1993 04:49:34 +0000 (04:49 +0000)
committerJim Kingdon <jkingdon@engr.sgi.com>
Sun, 25 Apr 1993 04:49:34 +0000 (04:49 +0000)
* remote-udi.c (udi_attach): Assignments to Space and Offset were
switched, fix it.
(udi_wait): Make error message (UDIGetStdout) match error.
(udi_wait): Handle UDIStdinNeeded.
* command.c [CANT_FORK]: Use system().
* utils.c (prompt_for_continue): Allow quit with 'q'.

gdb/ChangeLog
gdb/command.c
gdb/remote-udi.c

index 8c96318..7d4318c 100644 (file)
@@ -1,5 +1,13 @@
 Sat Apr 24 19:59:54 1993  Jim Kingdon  (kingdon@cygnus.com)
 
+       * Changes from (or inspired by) AMD:
+       * remote-udi.c (udi_attach): Assignments to Space and Offset were
+       switched, fix it.
+       (udi_wait): Make error message (UDIGetStdout) match error.
+       (udi_wait): Handle UDIStdinNeeded.
+       * command.c [CANT_FORK]: Use system().
+       * utils.c (prompt_for_continue): Allow quit with 'q'.
+
        * solib.c (solib_add): Don't call special_symbol_handling if there
        were errors in symbol_add_stub.  Also set so->from_tty before
        calling symbol_add_stub.
index 4eac4a6..dc5a92f 100644 (file)
@@ -1163,13 +1163,17 @@ cmd_show_list (list, from_tty, prefix)
   }
 }
 
-#ifndef CANT_FORK
 /* ARGSUSED */
 static void
 shell_escape (arg, from_tty)
      char *arg;
      int from_tty;
 {
+#ifdef CANT_FORK
+  /* FIXME: what about errors (I don't know how GO32 system() handles
+     them)?  */
+  system (arg);
+#else /* Can fork.  */
   int rc, status, pid;
   char *p, *user_shell;
 
@@ -1198,10 +1202,9 @@ shell_escape (arg, from_tty)
       ;
   else
     error ("Fork failed");
+#endif /* Can fork.  */
 }
-#endif
 
-#ifndef CANT_FORK
 static void
 make_command (arg, from_tty)
      char *arg;
@@ -1220,7 +1223,6 @@ make_command (arg, from_tty)
   
   shell_escape (p, from_tty);
 }
-#endif
 
 static void
 show_user_1 (c, stream)
@@ -1273,15 +1275,11 @@ show_user (args, from_tty)
 void
 _initialize_command ()
 {
-#ifndef CANT_FORK
   add_com ("shell", class_support, shell_escape,
           "Execute the rest of the line as a shell command.  \n\
 With no arguments, run an inferior shell.");
-#endif
-#ifndef CANT_FORK
   add_com ("make", class_support, make_command,
           "Run the ``make'' program using the rest of the line as arguments.");
-#endif
   add_cmd ("user", no_class, show_user, 
           "Show definitions of user defined commands.\n\
 Argument is the name of the user defined command.\n\
index 10cb87c..54a6197 100644 (file)
@@ -405,8 +405,8 @@ udi_attach (args, from_tty)
       printf ("Attaching to remote program %s...\n", prog_name);
 
   UDIStop();
-  From.Space = 11;
-  From.Offset = UDI29KSpecialRegs;
+  From.Space = UDI29KSpecialRegs;
+  From.Offset = 11;
   if (err = UDIRead(From, &PC_adds, Count, Size, &CountDone, HostEndian))
     error ("UDIRead failed in udi_attach");
   printf ("Remote process is now halted, pc1 = 0x%x.\n", PC_adds);
@@ -494,7 +494,7 @@ udi_wait (status)
        {
        case UDIStdoutReady:
          if (UDIGetStdout (sbuf, (UDISizeT)SBUF_MAX, &CountDone))
-           error ("UDIGetStdin() failed in udi_wait");
+           error ("UDIGetStdout() failed in udi_wait");
          fwrite (sbuf, 1, CountDone, stdout);
          fflush(stdout);
          continue;
@@ -504,8 +504,9 @@ udi_wait (status)
          fflush(stderr);
          continue;
        case UDIStdinNeeded:
-         printf("DEBUG: stdin requested ... continue\n");
-         /*    UDIPutStdin(sbuf, (UDISizeT)i, &CountDone); */
+         scanf ("%s", sbuf);
+         i = strlen (sbuf);
+         UDIPutStdin (sbuf, (UDISizeT)i, &CountDone);
          continue;
        case UDIRunning:
          /* In spite of the fact that we told UDIWait to wait forever, it will