* Copyright (c) 1983 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
static char sccsid
[] = "@(#)debug.c 5.1\t%G%";
static char rcsid
[] = "$Header: debug.c,v 1.5 84/12/26 10:39:01 linton Exp $";
public boolean tracetree
; /* trace building of parse trees */
public boolean traceeval
; /* trace tree evaluation */
* Dynamically turn on/off a debug flag, or display some information.
puts("debugging flags:");
puts(" 1 trace scanner return values");
puts(" 2 trace breakpoints");
puts(" 3 trace execution");
puts(" 4 trace tree building");
puts(" 5 trace tree evaluation");
puts(" -[12345] turns off corresponding flag");
puts(" 6 dump function table");
lexdebug
= (boolean
) (code
> 0);
error("can't debug scanner (not compiled with LEXDEBUG)");
tracebpts
= (boolean
) (code
> 0);
traceexec
= (boolean
) (code
> 0);
tracetree
= (boolean
) (code
> 0);
traceeval
= (boolean
) (code
> 0);
error("unknown debug flag");
private String leafname
[] = {
"nop", "name", "sym", "lcon", "fcon", "scon", "rval", "index"
public String
opname (op
)
if (ord(op
) <= ord(O_INDEX
)) {
s
= opinfo
[ord(op
)].opstring
;
sprintf(buf
, "[op %d]", op
);