to a routine called "printwhere" in pstatus.c ... other routines
were modified to use this routine
SCCS-vsn: usr.bin/pascal/pdx/process/pstatus.c 1.3
SCCS-vsn: usr.bin/pascal/pdx/process/start.c 1.5
SCCS-vsn: usr.bin/pascal/pdx/process/step.c 1.2
/* Copyright (c) 1982 Regents of the University of California */
/* Copyright (c) 1982 Regents of the University of California */
-static char sccsid[] = "@(#)pstatus.c 1.2 %G%";
+static char sccsid[] = "@(#)pstatus.c 1.3 %G%";
/*
* process status routines
/*
* process status routines
- if (process->signo == SIGINT) {
- isstopped = TRUE;
- printerror();
+ if (process->signo == SIGINT) {
+ isstopped = TRUE;
+ printerror();
+ }
+ if (isbperr() && isstopped) {
+ skimsource(srcfilename(pc));
+ printf("stopped at ");
+ printwhere(curline, cursource);
+ putchar('\n');
+ if (curline > 0) {
+ printlines(curline, curline);
+ } else {
+ printinst(pc, pc);
- if (isbperr() && isstopped) {
- printf("stopped at ");
- if (curline > 0) {
- printf("line %d", curline);
- if (nlhdr.nfiles > 1) {
- printf(" in file %s", cursource);
- }
- putchar('\n');
- printlines(curline, curline);
- } else {
-# if (isvaxpx)
- printf("location %d\n", pc);
-# else
- printf("location 0x%x\n", pc);
-# endif
- printinst(pc, pc);
- }
- erecover();
+ erecover();
+ } else {
+ isstopped = FALSE;
+ fixbps();
+ fixintr();
+ if (process->status == FINISHED) {
+ quit(0);
- isstopped = FALSE;
- fixbps();
- fixintr();
- if (process->status == FINISHED) {
- quit(0);
- } else {
- printerror();
- }
+ printerror();
+ }
+ }
+}
+
+
+/*
+ * Print out the "line N [in file F]" information that accompanies
+ * messages in various places.
+ */
+
+printwhere(lineno, filename)
+LINENO lineno;
+char *filename;
+{
+ if (lineno > 0) {
+ printf("line %d", lineno);
+ if (nlhdr.nfiles > 1) {
+ printf(" in file %s", filename);
+ } else {
+# if (isvaxpx)
+ printf("location %d\n", pc);
+# else
+ printf("location 0x%x\n", pc);
+# endif
+ }
BOOLEAN isfinished(p)
PROCESS *p;
{
BOOLEAN isfinished(p)
PROCESS *p;
{
- return(p->status == FINISHED);
+ return(p->status == FINISHED);
/* Copyright (c) 1982 Regents of the University of California */
/* Copyright (c) 1982 Regents of the University of California */
-static char sccsid[] = "@(#)start.c 1.4 %G%";
+static char sccsid[] = "@(#)start.c 1.5 %G%";
if (ss_variables) {
prvarnews();
}
printf("\nexecution completed\n");
curfunc = program;
if (ss_variables) {
prvarnews();
}
printf("\nexecution completed\n");
curfunc = program;
- if ((filename = srcfilename(pc)) != cursource) {
- skimsource(filename);
- }
+ skimsource(srcfilename(pc));
curline = lastlinenum;
erecover();
}
curline = lastlinenum;
erecover();
}
psigtrace(p, SIGTRAP, TRUE);
psigtrace(p, SIGIOT, TRUE);
psigtrace(p, SIGILL, TRUE);
psigtrace(p, SIGTRAP, TRUE);
psigtrace(p, SIGIOT, TRUE);
psigtrace(p, SIGILL, TRUE);
+ psigtrace(p, SIGBUS, TRUE);
/* Copyright (c) 1982 Regents of the University of California */
/* Copyright (c) 1982 Regents of the University of California */
-static char sccsid[] = "@(#)step.c 1.1 %G%";
+static char sccsid[] = "@(#)step.c 1.2 %G%";
/*
* Continue execution up to the next source line.
/*
* Continue execution up to the next source line.
#include "mappings.h"
#include "process.rep"
#include "mappings.h"
#include "process.rep"
-# if (isvax)
-# include "machine/vaxops.h"
+# if (isvax)
+# include "machine/vaxops.h"
- LOCAL ADDRESS getcall();
-# endif
+ LOCAL ADDRESS getcall();
+# endif
/*
* Stepc is what is called when the step command is given.
/*
* Stepc is what is called when the step command is given.
- if (!isstopped) {
- error("can't continue execution");
- }
- isstopped = FALSE;
- dostep(FALSE);
- isstopped = TRUE;
+ if (!isstopped) {
+ error("can't continue execution");
+ }
+ isstopped = FALSE;
+ dostep(FALSE);
+ isstopped = TRUE;
- if (!isstopped) {
- error("can't continue execution");
- }
- isstopped = FALSE;
- dostep(TRUE);
- isstopped = TRUE;
+ if (!isstopped) {
+ error("can't continue execution");
+ }
+ isstopped = FALSE;
+ dostep(TRUE);
+ isstopped = TRUE;
stepto(addr)
ADDRESS addr;
{
stepto(addr)
ADDRESS addr;
{
- setbp(addr);
- resume();
- unsetbp(addr);
- if (!isbperr()) {
- printstatus();
- }
+ setbp(addr);
+ resume();
+ unsetbp(addr);
+ if (!isbperr()) {
+ printstatus();
+ }
}
LOCAL dostep(isnext)
BOOLEAN isnext;
{
}
LOCAL dostep(isnext)
BOOLEAN isnext;
{
- register ADDRESS addr;
- register LINENO line;
- char *filename;
-
- addr = pc;
- do {
-# if (isvaxpx)
- addr = nextaddr(addr, isnext);
-# else
- if (isnext && (addr = getcall(addr)) != 0) {
- stepto(addr);
- } else {
- pstep(process);
- addr = process->pc;
- pc = process->pc;
- errnum = process->signo;
- if (!isbperr()) {
- printstatus();
- }
- }
-# endif
- line = linelookup(addr);
- } while (line == 0 && !ss_instructions);
- stepto(addr);
- curline = line;
- filename = srcfilename(addr);
- if (filename != cursource) {
- skimsource(filename);
- }
+ register ADDRESS addr;
+ register LINENO line;
+ char *filename;
+
+ addr = pc;
+ do {
+# if (isvaxpx)
+ addr = nextaddr(addr, isnext);
+# else
+ if (isnext && (addr = getcall(addr)) != 0) {
+ stepto(addr);
+ } else {
+ pstep(process);
+ addr = process->pc;
+ pc = process->pc;
+ errnum = process->signo;
+ if (!isbperr()) {
+ printstatus();
+ }
+ }
+# endif
+ line = linelookup(addr);
+ } while (line == 0 && !ss_instructions);
+ stepto(addr);
+ curline = line;
LOCAL ADDRESS getcall(addr)
ADDRESS addr;
{
LOCAL ADDRESS getcall(addr)
ADDRESS addr;
{
- VAXOP op;
-
- iread(&op, addr, sizeof(addr));
- if (op == O_CALLS) {
- return(addr + 7);
- } else {
- return(0);
- }
+ VAXOP op;
+
+ iread(&op, addr, sizeof(addr));
+ if (op == O_CALLS) {
+ return(addr + 7);
+ } else {
+ return(0);
+ }