Commit | Line | Data |
---|---|---|
505bf312 KB |
1 | /*- |
2 | * Copyright (c) 1980 The Regents of the University of California. | |
3 | * All rights reserved. | |
4 | * | |
af359dea C |
5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions | |
7 | * are met: | |
8 | * 1. Redistributions of source code must retain the above copyright | |
9 | * notice, this list of conditions and the following disclaimer. | |
10 | * 2. Redistributions in binary form must reproduce the above copyright | |
11 | * notice, this list of conditions and the following disclaimer in the | |
12 | * documentation and/or other materials provided with the distribution. | |
13 | * 3. All advertising materials mentioning features or use of this software | |
14 | * must display the following acknowledgement: | |
15 | * This product includes software developed by the University of | |
16 | * California, Berkeley and its contributors. | |
17 | * 4. Neither the name of the University nor the names of its contributors | |
18 | * may be used to endorse or promote products derived from this software | |
19 | * without specific prior written permission. | |
3cd5310a | 20 | * |
af359dea C |
21 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND |
22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
25 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
26 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
28 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
29 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
30 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
31 | * SUCH DAMAGE. | |
3cd5310a | 32 | * |
af359dea | 33 | * @(#)breakpoint.h 5.3 (Berkeley) 4/16/91 |
3cd5310a | 34 | */ |
d2ce9794 ML |
35 | |
36 | /* | |
37 | * Breakpoint module definitions. | |
38 | * | |
39 | * This module contains routines that manage breakpoints at a high level. | |
40 | * This includes adding and deleting breakpoints, handling the various | |
41 | * types of breakpoints when they happen, management of conditions for | |
42 | * breakpoints, and display information after single stepping. | |
43 | */ | |
44 | ||
45 | unsigned short tracing; | |
46 | unsigned short var_tracing; | |
47 | unsigned short inst_tracing; | |
48 | ||
49 | BOOLEAN isstopped; | |
50 | ||
51 | #define ss_lines (tracing != 0) | |
52 | #define ss_variables (var_tracing != 0) | |
53 | #define ss_instructions (inst_tracing != 0) | |
54 | #define single_stepping (ss_lines || ss_variables || ss_instructions) | |
55 | ||
56 | /* | |
57 | * types of breakpoints | |
58 | */ | |
59 | ||
60 | typedef enum { | |
61 | ALL_ON, /* turn TRACE on */ | |
62 | ALL_OFF, /* turn TRACE off */ | |
63 | INST, /* trace instruction (source line) */ | |
64 | CALL, RETURN, /* trace procedure/function */ | |
65 | BLOCK_ON, /* set CALL breakpoint */ | |
66 | BLOCK_OFF, /* clear CALL breakpoint */ | |
67 | TERM_ON, /* turn TRACEVAR on */ | |
68 | TERM_OFF, /* turn TRACEVAR off */ | |
69 | AT_BP, /* print expression at a line */ | |
70 | STOP_BP, /* stop execution */ | |
71 | CALLPROC, /* return from a "call"-ed procedure */ | |
72 | END_BP, /* return from program */ | |
73 | STOP_ON, /* start looking for stop condition */ | |
74 | STOP_OFF, /* stop looking for stop condition */ | |
75 | } BPTYPE; | |
76 | ||
77 | /* | |
78 | * Things that are on the tracing or condition list are either | |
79 | * associated with the trace (implying printing) or stop commands. | |
80 | */ | |
81 | ||
82 | typedef enum { TRPRINT, TRSTOP } TRTYPE; | |
83 | ||
84 | /* | |
85 | * routines available from this module | |
86 | */ | |
87 | ||
7d4de299 KB |
88 | int addvar(); /* add a variable to the trace list */ |
89 | int delvar(); /* delete a variable from the trace list */ | |
90 | int printvarnews(); /* print out variables that have changed */ | |
91 | int trfree(); /* free the entire trace list */ | |
92 | int addcond(); /* add a condition to the list */ | |
93 | int delcond(); /* delete a condition from the list */ | |
d2ce9794 ML |
94 | BOOLEAN trcond(); /* determine if any trace condition is true */ |
95 | BOOLEAN stopcond(); /* determine if any stop condition is true */ | |
96 | ||
7d4de299 KB |
97 | int addbp(); /* add a breakpoint */ |
98 | int delbp(); /* delete a breakpoint, return FALSE if unsuccessful */ | |
99 | int bpfree(); /* free all breakpoint information */ | |
100 | int setallbps(); /* set traps for all breakpoints */ | |
101 | int unsetallbps(); /* remove traps at all breakpoints */ | |
d2ce9794 | 102 | BOOLEAN bpact(); /* handle a breakpoint */ |
7d4de299 KB |
103 | int fixbps(); /* destroy temporary breakpoints left after a fault */ |
104 | int status(); /* list items being traced */ |