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