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