/* Copyright (c) 1982 Regents of the University of California */
static char sccsid
[] = "@(#)start.c 1.5 %G%";
* For px, pstart does a traced exec to read in px and then stop. But we
* want control after px has read in the obj file and before it starts
* executing. The zeroth argument to px tells it to give us control
* by sending itself a signal just prior to interpreting.
* We set a "END_BP" breakpoint at the end of the code so that the
* process data doesn't disappear after the program terminates.
start(argv
, infile
, outfile
)
pstart(process
, cmd
, argv
, infile
, outfile
);
if (process
->status
== STOPPED
) {
if (process
->status
!= STOPPED
) {
panic("px exited with %d", process
->exitval
);
dread(&ap
, process
->fp
+ 2*sizeof(int), sizeof(ap
));
dread(&t
, ap
, sizeof(TRAPARGS
));
panic("start: args out of sync");
addbp(lastaddr(), END_BP
, NIL
, NIL
, NIL
, 0);
panic("could not start program");
* Note the termination of the program. We do this so as to avoid
* having the process exit, which would make the values of variables
* Although the END_BP should really be deleted, it is taken
* care of by fixbps the next time the program runs.
printf("\nexecution completed\n");
skimsource(srcfilename(pc
));
* set up what signals we want to trace
psigtrace(p
, SIGINT
, TRUE
);
psigtrace(p
, SIGTRAP
, TRUE
);
psigtrace(p
, SIGIOT
, TRUE
);
psigtrace(p
, SIGILL
, TRUE
);
psigtrace(p
, SIGBUS
, TRUE
);