* Copyright (c) 1980 The Regents of the University of California.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
static char sccsid
[] = "@(#)runcont.c 5.4 (Berkeley) 4/16/91";
#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.