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