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