+static char sccsid[] = "@(#)runpcs.c 4.1 10/9/80";
#
/*
*
#include "head.h"
#include <a.out.h>
+#include <stab.h>
struct user u;
#include <stdio.h>
+#ifndef SIGTRAP
+#define SIGTRAP SIGTRC
+#endif
MSG NOFORK;
MSG ENDPCS;
ADDR sigint;
ADDR sigqit;
+ADDR userpc;
/* breakpoints */
BKPTR bkpthead;
-
-REGLIST reglist [] = {
- "p1lr", P1LR,
- "p1br",P1BR,
- "p0lr", P0LR,
- "p0br",P0BR,
- "ksp",KSP,
- "esp",ESP,
- "ssp",SSP,
- "psl", PSL,
- "pc", PC,
- "usp",USP,
- "fp", FP,
- "ap", AP,
- "r11", R11,
- "r10", R10,
- "r9", R9,
- "r8", R8,
- "r7", R7,
- "r6", R6,
- "r5", R5,
- "r4", R4,
- "r3", R3,
- "r2", R2,
- "r1", R1,
- "r0", R0,
-};
-
-
CHAR lastc;
INT fcor;
{ return(sig);
}
-ADDR userpc = 1;
-
runpcs(runmode,execsig)
{
REG BKPTR bkpt;
ANDF bkpt->comm[0]!=EOR)
THEN execbkpt(bkpt,execsig); execsig=0; loopcnt++;
goto loop1;
- ELSE bkpt->count=bkpt->initcnt;
+ ELSE bkpt->flag=BKPTSET; bkpt->count=bkpt->initcnt;
FI
ELSE execsig=signo;
if (execsig) break;
#define BPOUT 0
#define BPIN 1
-INT bpstate = BPOUT;
+INT bpstate;
endpcs()
{
THEN ptrace(SETTRC,0,0,0);
signal(SIGINT,sigint); signal(SIGQUIT,sigqit);
#ifdef VFORK
- signal(SIGTRC,nullsig);
+ signal(SIGTRAP,nullsig);
#endif
if (debug) printf("About to doexec pid=%d\n",pid);
-#ifdef UCBVAX
doexec(); _exit(0);
-#else
- doexec(); exit(0);
-#endif
ELIF pid == -1
THEN error(NOFORK);
ELSE bpwait(); readregs();
close(0);
if (open(filnam,0) < 0) {
printf("%s: cannot open\n",filnam);
-#ifdef UCBVAX
- _exit(0);
-#else
- exit(0);
-#endif
+ fflush(stdout);
+ _exit(0);
}
} else {
close(1);
if (creat(filnam,0666) < 0) {
printf("%s: cannot create\n",filnam);
-#ifdef UCBVAX
+ fflush(stdout);
_exit(0);
-#else
- exit(0);
-#endif
}
}
} else if (c != '\n') {
ELSE signo = stat>>8;
if (debug) printf("PC = %d, dbsubn = %d\n",
ptrace(RUREGS, pid, PC, 0), extaddr("_dbsubn"));
- IF signo!=SIGTRC ANDF
+ IF signo!=SIGTRAP ANDF
ptrace(RUREGS, pid, PC, 0) != extaddr("_dbsubn")
THEN sigprint();
ELSE signo=0;
FI
}
+REGLIST reglist[];
readregs()
{
/*get REG values from pcs*/