1*5466Slinton /* Copyright (c) 1982 Regents of the University of California */
2*5466Slinton 
3*5466Slinton static char sccsid[] = "@(#)printnews.c 1.1 01/18/82";
4*5466Slinton 
5*5466Slinton /*
6*5466Slinton  * print out news during single step tracing
7*5466Slinton  *
8*5466Slinton  * We have to handle all the single stepping possibilities,
9*5466Slinton  * including combinations.  A combination of single stepping
10*5466Slinton  * by line and by instruction causes "curline" to be 0 but
11*5466Slinton  * "ss_lines" to be TRUE.  We avoid trying to print lines in this case.
12*5466Slinton  */
13*5466Slinton 
14*5466Slinton #include "defs.h"
15*5466Slinton #include "breakpoint.h"
16*5466Slinton #include "sym.h"
17*5466Slinton #include "source.h"
18*5466Slinton #include "object.h"
19*5466Slinton #include "mappings.h"
20*5466Slinton #include "machine.h"
21*5466Slinton 
22*5466Slinton printnews()
23*5466Slinton {
24*5466Slinton 	if (ss_variables) {
25*5466Slinton 		prvarnews();
26*5466Slinton 	}
27*5466Slinton 	if (trcond()) {
28*5466Slinton 		if (ss_lines && curline > 0) {
29*5466Slinton 			printf("trace:  ");
30*5466Slinton 			printlines(curline, curline);
31*5466Slinton 		}
32*5466Slinton 		if (ss_instructions) {
33*5466Slinton 			printf("inst trace:	");
34*5466Slinton 			printinst(pc, pc);
35*5466Slinton 		}
36*5466Slinton 	}
37*5466Slinton 	bpact();
38*5466Slinton 	if (stopcond()) {
39*5466Slinton 		isstopped = TRUE;
40*5466Slinton 		getsrcinfo();
41*5466Slinton 		printstatus();
42*5466Slinton 	}
43*5466Slinton }
44*5466Slinton 
45*5466Slinton getsrcinfo()
46*5466Slinton {
47*5466Slinton 	char *filename;
48*5466Slinton 
49*5466Slinton 	curline = srcline(pc);
50*5466Slinton 	filename = srcfilename(pc);
51*5466Slinton 	if (filename != cursource) {
52*5466Slinton 		skimsource(filename);
53*5466Slinton 	}
54*5466Slinton }
55