]>
Commit | Line | Data |
---|---|---|
c906108c SS |
1 | /* Data structures associated with tracepoints in GDB. |
2 | Copyright (C) 1997 Free Software Foundation, Inc. | |
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 | ||
24 | #if !defined (BREAKPOINT_H) | |
c5aa993b JM |
25 | enum enable |
26 | { | |
27 | disabled, enabled | |
28 | }; | |
c906108c SS |
29 | #endif |
30 | /* The data structure for an action: */ | |
c5aa993b JM |
31 | struct action_line |
32 | { | |
33 | struct action_line *next; | |
34 | char *action; | |
35 | }; | |
c906108c SS |
36 | |
37 | /* The data structure for a tracepoint: */ | |
38 | ||
39 | struct tracepoint | |
c5aa993b JM |
40 | { |
41 | struct tracepoint *next; | |
c906108c | 42 | |
c5aa993b | 43 | enum enable enabled; |
c906108c SS |
44 | |
45 | #if 0 | |
c5aa993b JM |
46 | /* Type of tracepoint (MVS FIXME: needed?). */ |
47 | enum tptype type; | |
c906108c | 48 | |
c5aa993b JM |
49 | /* What to do with this tracepoint after we hit it MVS FIXME: needed?). */ |
50 | enum tpdisp disposition; | |
c906108c | 51 | #endif |
c5aa993b JM |
52 | /* Number assigned to distinguish tracepoints. */ |
53 | int number; | |
c906108c | 54 | |
c5aa993b JM |
55 | /* Address to trace at, or NULL if not an instruction tracepoint (MVS ?). */ |
56 | CORE_ADDR address; | |
c906108c | 57 | |
c5aa993b JM |
58 | /* Line number of this address. Only matters if address is non-NULL. */ |
59 | int line_number; | |
c906108c | 60 | |
c5aa993b JM |
61 | /* Source file name of this address. Only matters if address is non-NULL. */ |
62 | char *source_file; | |
c906108c | 63 | |
c5aa993b JM |
64 | /* Number of times this tracepoint should single-step |
65 | and collect additional data */ | |
66 | long step_count; | |
c906108c | 67 | |
c5aa993b JM |
68 | /* Number of times this tracepoint should be hit before disabling/ending. */ |
69 | int pass_count; | |
c906108c | 70 | |
c5aa993b JM |
71 | /* Chain of action lines to execute when this tracepoint is hit. */ |
72 | struct action_line *actions; | |
c906108c | 73 | |
c5aa993b JM |
74 | /* Conditional (MVS ?). */ |
75 | struct expression *cond; | |
c906108c | 76 | |
c5aa993b JM |
77 | /* String we used to set the tracepoint (malloc'd). Only matters if |
78 | address is non-NULL. */ | |
79 | char *addr_string; | |
c906108c | 80 | |
c5aa993b JM |
81 | /* Language we used to set the tracepoint. */ |
82 | enum language language; | |
c906108c | 83 | |
c5aa993b JM |
84 | /* Input radix we used to set the tracepoint. */ |
85 | int input_radix; | |
c906108c | 86 | |
c5aa993b JM |
87 | /* Count of the number of times this tracepoint was taken, dumped |
88 | with the info, but not used for anything else. Useful for | |
89 | seeing how many times you hit a tracepoint prior to the program | |
90 | aborting, so you can back up to just before the abort. */ | |
91 | int hit_count; | |
c906108c | 92 | |
c5aa993b JM |
93 | /* Thread number for thread-specific tracepoint, or -1 if don't care */ |
94 | int thread; | |
95 | ||
96 | /* BFD section, in case of overlays: | |
97 | no, I don't know if tracepoints are really gonna work with overlays. */ | |
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 | ||
110 | /* The tracepont chain of all tracepoints */ | |
111 | ||
112 | extern struct tracepoint *tracepoint_chain; | |
113 | ||
114 | extern unsigned long trace_running_p; | |
115 | ||
116 | /* A hook used to notify the UI of tracepoint operations */ | |
117 | ||
118 | void (*create_tracepoint_hook) PARAMS ((struct tracepoint *)); | |
119 | void (*delete_tracepoint_hook) PARAMS ((struct tracepoint *)); | |
120 | void (*modify_tracepoint_hook) PARAMS ((struct tracepoint *)); | |
121 | void (*trace_find_hook) PARAMS ((char *arg, int from_tty)); | |
122 | void (*trace_start_stop_hook) PARAMS ((int start, int from_tty)); | |
123 | ||
124 | struct tracepoint *get_tracepoint_by_number PARAMS ((char **)); | |
125 | int get_traceframe_number PARAMS ((void)); | |
c5aa993b JM |
126 | void free_actions PARAMS ((struct tracepoint *)); |
127 | enum actionline_type validate_actionline PARAMS ((char **, | |
128 | struct tracepoint *)); | |
c906108c SS |
129 | |
130 | ||
131 | /* Walk the following statement or block through all tracepoints. | |
132 | ALL_TRACEPOINTS_SAFE does so even if the statment deletes the current | |
133 | breakpoint. */ | |
134 | ||
135 | #define ALL_TRACEPOINTS(t) for (t = tracepoint_chain; t; t = t->next) | |
136 | ||
137 | #define ALL_TRACEPOINTS_SAFE(t,tmp) \ | |
138 | for (t = tracepoint_chain; \ | |
139 | t ? (tmp = t->next, 1) : 0;\ | |
140 | t = tmp) | |
141 | #endif /* TRACEPOINT_H */ |