* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
static char sccsid
[] = "@(#)runcont.c 5.2 (Berkeley) 4/7/87";
#define MAXNARGS 100 /* maximum number of arguments to RUN */
LOCAL BOOLEAN just_started
;
LOCAL String argv
[MAXNARGS
];
PROCESS
*process
= &pbuf
;
* This is a px-related kludge to deal with the possibility
* of object code magically coming from a tmp file.
* Initialize the argument list.
if (option('t') && realname
== NIL
) {
* Add an argument to the list for the debuggee.
error("too many arguments to run");
* Set the standard input for the debuggee.
error("multiple input redirects");
* Set the standard output for the debuggee.
* Probably should check to avoid overwriting an existing file.
error("multiple output redirect");
* Initial start of the process. The idea is to get it to the point
* where the object code has been loaded but execution has not begun.
start(argv
, infile
, outfile
);
if (process
->status
!= STOPPED
) {
panic("could not start program");
* Run starts debuggee executing.
start(argv
, infile
, outfile
);
if (process
->status
== STOPPED
) {
} else if (option('r')) {
panic("could not start program");
* Continue execution wherever we left off.
* Note that this routine never returns. Eventually bpact() will fail
* and we'll call printstatus or step will call it.
dbintr
= signal(SIGINT
, intr
);
error("can't continue execution");
* This routine is called if we get an interrupt while "running" px
* but actually in the debugger. Could happen, for example, while
* processing breakpoints.
* We basically just want to keep going; the assumption is
* that when the process resumes it will get the interrupt
* which will then be handled.