Commit | Line | Data |
---|---|---|
c906108c | 1 | /* Data structures associated with tracepoints in GDB. |
b6ba6518 | 2 | Copyright 1997, 1998, 1999, 2000 Free Software Foundation, Inc. |
c906108c | 3 | |
c5aa993b | 4 | This file is part of GDB. |
c906108c | 5 | |
c5aa993b JM |
6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of the GNU General Public License as published by | |
8 | the Free Software Foundation; either version 2 of the License, or | |
9 | (at your option) any later version. | |
c906108c | 10 | |
c5aa993b JM |
11 | This program is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | GNU General Public License for more details. | |
c906108c | 15 | |
c5aa993b JM |
16 | You should have received a copy of the GNU General Public License |
17 | along with this program; if not, write to the Free Software | |
18 | Foundation, Inc., 59 Temple Place - Suite 330, | |
19 | Boston, MA 02111-1307, USA. */ | |
c906108c SS |
20 | |
21 | #if !defined (TRACEPOINT_H) | |
22 | #define TRACEPOINT_H 1 | |
23 | ||
c906108c | 24 | /* The data structure for an action: */ |
c5aa993b JM |
25 | struct action_line |
26 | { | |
27 | struct action_line *next; | |
28 | char *action; | |
29 | }; | |
c906108c SS |
30 | |
31 | /* The data structure for a tracepoint: */ | |
32 | ||
33 | struct tracepoint | |
c5aa993b JM |
34 | { |
35 | struct tracepoint *next; | |
c906108c | 36 | |
b5de0fa7 | 37 | int enabled_p; |
c906108c SS |
38 | |
39 | #if 0 | |
d183932d | 40 | /* Type of tracepoint. (MVS FIXME: needed?) */ |
c5aa993b | 41 | enum tptype type; |
c906108c | 42 | |
d183932d MS |
43 | /* What to do with this tracepoint after we hit it |
44 | MVS FIXME: needed?). */ | |
c5aa993b | 45 | enum tpdisp disposition; |
c906108c | 46 | #endif |
c5aa993b JM |
47 | /* Number assigned to distinguish tracepoints. */ |
48 | int number; | |
c906108c | 49 | |
d183932d MS |
50 | /* Address to trace at, or NULL if not an instruction tracepoint. |
51 | (MVS ?) */ | |
c5aa993b | 52 | CORE_ADDR address; |
c906108c | 53 | |
d183932d MS |
54 | /* Line number of this address. |
55 | Only matters if address is non-NULL. */ | |
c5aa993b | 56 | int line_number; |
c906108c | 57 | |
d183932d MS |
58 | /* Source file name of this address. |
59 | Only matters if address is non-NULL. */ | |
c5aa993b | 60 | char *source_file; |
c906108c | 61 | |
c5aa993b | 62 | /* Number of times this tracepoint should single-step |
d183932d | 63 | and collect additional data. */ |
c5aa993b | 64 | long step_count; |
c906108c | 65 | |
d183932d MS |
66 | /* Number of times this tracepoint should be hit before |
67 | disabling/ending. */ | |
c5aa993b | 68 | int pass_count; |
c906108c | 69 | |
d183932d | 70 | /* Chain of action lines to execute when this tracepoint is hit. */ |
c5aa993b | 71 | struct action_line *actions; |
c906108c | 72 | |
c5aa993b JM |
73 | /* Conditional (MVS ?). */ |
74 | struct expression *cond; | |
c906108c | 75 | |
d183932d MS |
76 | /* String we used to set the tracepoint (malloc'd). |
77 | Only matters if address is non-NULL. */ | |
c5aa993b | 78 | char *addr_string; |
c906108c | 79 | |
c5aa993b JM |
80 | /* Language we used to set the tracepoint. */ |
81 | enum language language; | |
c906108c | 82 | |
c5aa993b JM |
83 | /* Input radix we used to set the tracepoint. */ |
84 | int input_radix; | |
c906108c | 85 | |
c5aa993b JM |
86 | /* Count of the number of times this tracepoint was taken, dumped |
87 | with the info, but not used for anything else. Useful for | |
88 | seeing how many times you hit a tracepoint prior to the program | |
89 | aborting, so you can back up to just before the abort. */ | |
90 | int hit_count; | |
c906108c | 91 | |
d183932d MS |
92 | /* Thread number for thread-specific tracepoint, |
93 | or -1 if don't care. */ | |
c5aa993b JM |
94 | int thread; |
95 | ||
d183932d MS |
96 | /* BFD section, in case of overlays: no, I don't know if |
97 | tracepoints are really gonna work with overlays. */ | |
c5aa993b JM |
98 | asection *section; |
99 | }; | |
c906108c SS |
100 | |
101 | enum actionline_type | |
c5aa993b JM |
102 | { |
103 | BADLINE = -1, | |
104 | GENERIC = 0, | |
105 | END = 1, | |
106 | STEPPING = 2 | |
107 | }; | |
c906108c SS |
108 | |
109 | ||
d183932d | 110 | /* The tracepoint chain of all tracepoints. */ |
c906108c SS |
111 | |
112 | extern struct tracepoint *tracepoint_chain; | |
113 | ||
114 | extern unsigned long trace_running_p; | |
115 | ||
d183932d | 116 | /* A hook used to notify the UI of tracepoint operations. */ |
c906108c | 117 | |
9a4105ab AC |
118 | void (*deprecated_create_tracepoint_hook) (struct tracepoint *); |
119 | void (*deprecated_delete_tracepoint_hook) (struct tracepoint *); | |
120 | void (*deprecated_modify_tracepoint_hook) (struct tracepoint *); | |
121 | void (*deprecated_trace_find_hook) (char *arg, int from_tty); | |
122 | void (*deprecated_trace_start_stop_hook) (int start, int from_tty); | |
c906108c | 123 | |
a14ed312 KB |
124 | struct tracepoint *get_tracepoint_by_number (char **, int, int); |
125 | int get_traceframe_number (void); | |
126 | void free_actions (struct tracepoint *); | |
127 | enum actionline_type validate_actionline (char **, struct tracepoint *); | |
c906108c SS |
128 | |
129 | ||
130 | /* Walk the following statement or block through all tracepoints. | |
d183932d MS |
131 | ALL_TRACEPOINTS_SAFE does so even if the statment deletes the |
132 | current breakpoint. */ | |
c906108c SS |
133 | |
134 | #define ALL_TRACEPOINTS(t) for (t = tracepoint_chain; t; t = t->next) | |
135 | ||
136 | #define ALL_TRACEPOINTS_SAFE(t,tmp) \ | |
137 | for (t = tracepoint_chain; \ | |
138 | t ? (tmp = t->next, 1) : 0;\ | |
139 | t = tmp) | |
d183932d | 140 | #endif /* TRACEPOINT_H */ |