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