1 /* $Id: debug.c,v 1.7 1994/06/24 10:29:38 ceriel Exp $ */
3 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
4 * See the copyright notice in the ACK home directory, in the file "Copyright".
21 int linecount; /* # lines in this file */
22 bool verbose_flag = FALSE; /* generate verbose output ? */
25 error(s,a) char *s,*a; {
27 fprintf(stderr,"error on line %u",linecount);
28 if (filename != (char *) 0) {
29 fprintf(stderr," file %s",filename);
57 fprintf(stderr,"optimization: ");
58 fprintf(stderr,s,n1,n2);
67 badassertion(file,line) char *file; unsigned line; {
69 fprintf(stderr,"assertion failed file %s, line %u\n",file,line);
75 if (a == (short *) 0) error("VA: 0 argument");
76 if ( ((unsigned) a & 01) == 01) {
77 /* MACHINE DEPENDENT TEST */
78 error("VA: odd argument");
83 /* Valid Instruction code */
86 if (i > ps_last) error("VI: illegal instr: %d", i);
99 if (optype < OP_FIRST || optype > OP_LAST) {
100 error("VL: illegal optype: %d", optype);
106 /* Valid Data block */
112 pseudo = d->d_pseudo;
113 if (pseudo < D_FIRST || pseudo > D_LAST) {
114 error("VD: illegal pseudo: %d",pseudo);
126 if (off < 0 || off > 10000) {
127 error("VO: unlikely offset: %d", off);
141 if (pid <0 || pid > 1000) {
142 error("VP: unlikely proc_id: %d", (int) pid);
144 nrlabs = p->p_nrlabels;
145 if (nrlabs < 0 || nrlabs > 500) {
146 error("VP: unlikely p_nrlabels: %d", nrlabs);