1*22278Sdist /*
2*22278Sdist  * Copyright (c) 1980 Regents of the University of California.
3*22278Sdist  * All rights reserved.  The Berkeley software License Agreement
4*22278Sdist  * specifies the terms and conditions for redistribution.
5*22278Sdist  */
65466Slinton 
7*22278Sdist #ifndef lint
8*22278Sdist static char sccsid[] = "@(#)printnews.c	5.1 (Berkeley) 06/05/85";
9*22278Sdist #endif not lint
105466Slinton 
115466Slinton /*
125760Slinton  * Print out news during single step tracing.
135466Slinton  *
145466Slinton  * We have to handle all the single stepping possibilities,
155466Slinton  * including combinations.  A combination of single stepping
165466Slinton  * by line and by instruction causes "curline" to be 0 but
175466Slinton  * "ss_lines" to be TRUE.  We avoid trying to print lines in this case.
185466Slinton  */
195466Slinton 
205466Slinton #include "defs.h"
215466Slinton #include "breakpoint.h"
225466Slinton #include "sym.h"
235466Slinton #include "source.h"
245466Slinton #include "object.h"
255466Slinton #include "mappings.h"
265466Slinton #include "machine.h"
275466Slinton 
285466Slinton printnews()
295466Slinton {
305760Slinton     if (ss_variables) {
315760Slinton 	prvarnews();
325760Slinton     }
335760Slinton     if (trcond()) {
345760Slinton 	if (ss_lines && curline > 0) {
355760Slinton 	    skimsource(srcfilename(pc));
365760Slinton 	    printf("trace:  ");
375760Slinton 	    printlines(curline, curline);
385466Slinton 	}
395760Slinton 	if (ss_instructions) {
405760Slinton 	    printf("inst trace: ");
415760Slinton 	    printinst(pc, pc);
425466Slinton 	}
435760Slinton     }
445760Slinton     bpact();
455760Slinton     if (stopcond()) {
465760Slinton 	isstopped = TRUE;
475466Slinton 	curline = srcline(pc);
485760Slinton 	printstatus();
495760Slinton     }
505466Slinton }
51