date and time created 82/01/18 19:20:44 by linton
authorMark Linton <linton@ucbvax.Berkeley.EDU>
Tue, 19 Jan 1982 11:20:44 +0000 (03:20 -0800)
committerMark Linton <linton@ucbvax.Berkeley.EDU>
Tue, 19 Jan 1982 11:20:44 +0000 (03:20 -0800)
SCCS-vsn: usr.bin/pascal/pdx/process/pstatus.c 1.1

usr/src/usr.bin/pascal/pdx/process/pstatus.c [new file with mode: 0644]

diff --git a/usr/src/usr.bin/pascal/pdx/process/pstatus.c b/usr/src/usr.bin/pascal/pdx/process/pstatus.c
new file mode 100644 (file)
index 0000000..d706123
--- /dev/null
@@ -0,0 +1,67 @@
+/* Copyright (c) 1982 Regents of the University of California */
+
+static char sccsid[] = "@(#)pstatus.c 1.1 %G%";
+
+/*
+ * process status routines
+ */
+
+#include "defs.h"
+#include <signal.h>
+#include "process.h"
+#include "machine.h"
+#include "breakpoint.h"
+#include "source.h"
+#include "object.h"
+#include "process.rep"
+
+/*
+ * Print the status of the process.
+ * This routine does not return.
+ */
+
+printstatus()
+{
+       if (process->signo == SIGINT) {
+               isstopped = TRUE;
+               printerror();
+       }
+       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();
+       } else {
+               isstopped = FALSE;
+               fixbps();
+               fixintr();
+               if (process->status == FINISHED) {
+                       exit(0);
+               } else {
+                       printerror();
+               }
+       }
+}
+
+/*
+ * Return TRUE if the process is finished.
+ */
+
+BOOLEAN isfinished(p)
+PROCESS *p;
+{
+       return(p->status == FINISHED);
+}