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

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

diff --git a/usr/src/usr.bin/pascal/pdx/breakpoint/printnews.c b/usr/src/usr.bin/pascal/pdx/breakpoint/printnews.c
new file mode 100644 (file)
index 0000000..4a99c6e
--- /dev/null
@@ -0,0 +1,54 @@
+/* Copyright (c) 1982 Regents of the University of California */
+
+static char sccsid[] = "@(#)printnews.c 1.1 %G%";
+
+/*
+ * print out news during single step tracing
+ *
+ * We have to handle all the single stepping possibilities,
+ * including combinations.  A combination of single stepping
+ * by line and by instruction causes "curline" to be 0 but
+ * "ss_lines" to be TRUE.  We avoid trying to print lines in this case.
+ */
+
+#include "defs.h"
+#include "breakpoint.h"
+#include "sym.h"
+#include "source.h"
+#include "object.h"
+#include "mappings.h"
+#include "machine.h"
+
+printnews()
+{
+       if (ss_variables) {
+               prvarnews();
+       }
+       if (trcond()) {
+               if (ss_lines && curline > 0) {
+                       printf("trace:  ");
+                       printlines(curline, curline);
+               }
+               if (ss_instructions) {
+                       printf("inst trace:     ");
+                       printinst(pc, pc);
+               }
+       }
+       bpact();
+       if (stopcond()) {
+               isstopped = TRUE;
+               getsrcinfo();
+               printstatus();
+       }
+}
+
+getsrcinfo()
+{
+       char *filename;
+
+       curline = srcline(pc);
+       filename = srcfilename(pc);
+       if (filename != cursource) {
+               skimsource(filename);
+       }
+}