1: /*
   2:  * Copyright (c) 1980 Regents of the University of California.
   3:  * All rights reserved.  The Berkeley software License Agreement
   4:  * specifies the terms and conditions for redistribution.
   5:  */
   6: 
   7: #ifndef lint
   8: static char sccsid[] = "@(#)pstatus.c	5.1 (Berkeley) 6/6/85";
   9: #endif not lint
  10: /*
  11:  * process status routines
  12:  */
  13: 
  14: #include "defs.h"
  15: #include <signal.h>
  16: #include "process.h"
  17: #include "machine.h"
  18: #include "breakpoint.h"
  19: #include "source.h"
  20: #include "object.h"
  21: #include "process.rep"
  22: 
  23: /*
  24:  * Print the status of the process.
  25:  * This routine does not return.
  26:  */
  27: 
  28: printstatus()
  29: {
  30:     if (process->signo == SIGINT) {
  31:     isstopped = TRUE;
  32:     printerror();
  33:     }
  34:     if (isbperr() && isstopped) {
  35:     skimsource(srcfilename(pc));
  36:     printf("stopped at ");
  37:     printwhere(curline, cursource);
  38:     putchar('\n');
  39:     if (curline > 0) {
  40:         printlines(curline, curline);
  41:     } else {
  42:         printinst(pc, pc);
  43:     }
  44:     erecover();
  45:     } else {
  46:     isstopped = FALSE;
  47:     fixbps();
  48:     fixintr();
  49:     if (process->status == FINISHED) {
  50:         quit(0);
  51:     } else {
  52:         printerror();
  53:     }
  54:     }
  55: }
  56: 
  57: 
  58: /*
  59:  * Print out the "line N [in file F]" information that accompanies
  60:  * messages in various places.
  61:  */
  62: 
  63: printwhere(lineno, filename)
  64: LINENO lineno;
  65: char *filename;
  66: {
  67:     if (lineno > 0) {
  68:     printf("line %d", lineno);
  69:     if (nlhdr.nfiles > 1) {
  70:         printf(" in file %s", filename);
  71:     }
  72:     } else {
  73: #	if (isvaxpx)
  74:         printf("location %d\n", pc);
  75: #	else
  76:         printf("location 0x%x\n", pc);
  77: #	endif
  78:     }
  79: }
  80: 
  81: /*
  82:  * Return TRUE if the process is finished.
  83:  */
  84: 
  85: BOOLEAN isfinished(p)
  86: PROCESS *p;
  87: {
  88:     return(p->status == FINISHED);
  89: }

Defined functions

isfinished defined in line 85; never used
printwhere defined in line 63; used 1 times
  • in line 37

Defined variables

sccsid defined in line 8; never used
Last modified: 1985-06-06
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 2664
Valid CSS Valid XHTML 1.0 Strict