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.
}
}
-#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;
;
else
error ("Fork failed");
+#endif /* Can fork. */
}
-#endif
-#ifndef CANT_FORK
static void
make_command (arg, from_tty)
char *arg;
shell_escape (p, from_tty);
}
-#endif
static void
show_user_1 (c, stream)
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\
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);
{
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;
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