1*5448Slinton /* Copyright (c) 1982 Regents of the University of California */ 2*5448Slinton 3*5448Slinton static char sccsid[] = "@(#)breakpoint.h 1.1 01/18/82"; 4*5448Slinton 5*5448Slinton /* 6*5448Slinton * Breakpoint module definitions. 7*5448Slinton * 8*5448Slinton * This module contains routines that manage breakpoints at a high level. 9*5448Slinton * This includes adding and deleting breakpoints, handling the various 10*5448Slinton * types of breakpoints when they happen, management of conditions for 11*5448Slinton * breakpoints, and display information after single stepping. 12*5448Slinton */ 13*5448Slinton 14*5448Slinton unsigned short tracing; 15*5448Slinton unsigned short var_tracing; 16*5448Slinton unsigned short inst_tracing; 17*5448Slinton 18*5448Slinton BOOLEAN isstopped; 19*5448Slinton 20*5448Slinton #define ss_lines (tracing != 0) 21*5448Slinton #define ss_variables (var_tracing != 0) 22*5448Slinton #define ss_instructions (inst_tracing != 0) 23*5448Slinton #define single_stepping (ss_lines || ss_variables || ss_instructions) 24*5448Slinton 25*5448Slinton /* 26*5448Slinton * types of breakpoints 27*5448Slinton */ 28*5448Slinton 29*5448Slinton typedef enum { 30*5448Slinton ALL_ON, /* turn TRACE on */ 31*5448Slinton ALL_OFF, /* turn TRACE off */ 32*5448Slinton INST, /* trace instruction (source line) */ 33*5448Slinton CALL, RETURN, /* trace procedure/function */ 34*5448Slinton BLOCK_ON, /* set CALL breakpoint */ 35*5448Slinton BLOCK_OFF, /* clear CALL breakpoint */ 36*5448Slinton TERM_ON, /* turn TRACEVAR on */ 37*5448Slinton TERM_OFF, /* turn TRACEVAR off */ 38*5448Slinton AT_BP, /* print expression at a line */ 39*5448Slinton STOP_BP, /* stop execution */ 40*5448Slinton CALLPROC, /* return from a "call"-ed procedure */ 41*5448Slinton END_BP, /* return from program */ 42*5448Slinton STOP_ON, /* start looking for stop condition */ 43*5448Slinton STOP_OFF, /* stop looking for stop condition */ 44*5448Slinton } BPTYPE; 45*5448Slinton 46*5448Slinton /* 47*5448Slinton * Things that are on the tracing or condition list are either 48*5448Slinton * associated with the trace (implying printing) or stop commands. 49*5448Slinton */ 50*5448Slinton 51*5448Slinton typedef enum { TRPRINT, TRSTOP } TRTYPE; 52*5448Slinton 53*5448Slinton /* 54*5448Slinton * routines available from this module 55*5448Slinton */ 56*5448Slinton 57*5448Slinton addvar(); /* add a variable to the trace list */ 58*5448Slinton delvar(); /* delete a variable from the trace list */ 59*5448Slinton printvarnews(); /* print out variables that have changed */ 60*5448Slinton trfree(); /* free the entire trace list */ 61*5448Slinton addcond(); /* add a condition to the list */ 62*5448Slinton delcond(); /* delete a condition from the list */ 63*5448Slinton BOOLEAN trcond(); /* determine if any trace condition is true */ 64*5448Slinton BOOLEAN stopcond(); /* determine if any stop condition is true */ 65*5448Slinton 66*5448Slinton addbp(); /* add a breakpoint */ 67*5448Slinton delbp(); /* delete a breakpoint, return FALSE if unsuccessful */ 68*5448Slinton bpfree(); /* free all breakpoint information */ 69*5448Slinton setallbps(); /* set traps for all breakpoints */ 70*5448Slinton unsetallbps(); /* remove traps at all breakpoints */ 71*5448Slinton BOOLEAN bpact(); /* handle a breakpoint */ 72*5448Slinton fixbps(); /* destroy temporary breakpoints left after a fault */ 73*5448Slinton status(); /* list items being traced */ 74