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