File:  [Research Unix] / researchv10no / cmd / lcc / gen2 / mips / stab.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:35 2018 UTC (8 years, 1 month ago) by root
Branches: belllabs, MAIN
CVS tags: researchv10, HEAD
researchv10 Norman

/* C compiler: UNIX code generator
 *
 * Outputs `stab' entries for the UNIX dbx debugger,
 * if -g is specified.
 */

#include "c.h"

static char *currentfile;

/* stabblock - output a stab entry for '{' or '}' at level lev */
void stabblock(brace, lev, p) Symbol *p; { &brace; &lev; &p; }

/* stabend - finalize stab output */
void stabend(cp, p, cpp, sp, syms) Coordinate *cp; Symbol p, *sp, *syms; Coordinate **cpp; { &cp; &p; &cpp; &sp; &syms; }

/* stabfend - end of function p */
void stabfend(p, line) Symbol p; { &p; &line; }

/* stabinit - initialize stab output */
void stabinit(file, argc, argv) char *file, *argv[]; {
	if (file) {
		print(".file 2,\"%s\"\n", file);
		currentfile = file;
	}
}

/* stabline - emit stab entry for source coordinate *cp */
void stabline(cp) Coordinate *cp; {
	if (cp->file && cp->file != currentfile) {
		print(".file 2,\"%s\"\n", cp->file);
		currentfile = cp->file;
	}
	print(".loc 2,%d\n", cp->y);
}

/* stabsym - output a stab entry for symbol p */
void stabsym(p) Symbol p; {
	if (p == cfunc)
		stabline(&p->src);
}

/* stabtype - output a stab entry for type *p */
void stabtype(p) Symbol p; { &p; }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.