]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/tracepoint.h
* config/sh/tm-sh.h (BELIEVE_PCC_PROMOTION): Define, so that
[thirdparty/binutils-gdb.git] / gdb / tracepoint.h
CommitLineData
6a02d201
MS
1/* Data structures associated with tracepoints in GDB.
2 Copyright (C) 1997 Free Software Foundation, Inc.
3
4This file is part of GDB.
5
6This program is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2 of the License, or
9(at your option) any later version.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with this program; if not, write to the Free Software
18Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
19
20#if !defined (TRACEPOINT_H)
21#define TRACEPOINT_H 1
22
57c0b026
MS
23#if !defined (BREAKPOINT_H)
24enum enable { disabled, enabled };
25#endif
6a02d201
MS
26/* The data structure for an action: */
27struct action_line
28{
29 struct action_line *next;
30 char *action;
31};
32
33/* The data structure for a tracepoint: */
34
35struct tracepoint
36{
37 struct tracepoint *next;
38
57c0b026 39 enum enable enabled;
6a02d201
MS
40
41#if 0
42 /* Type of tracepoint (MVS FIXME: needed?). */
43 enum tptype type;
44
45 /* What to do with this tracepoint after we hit it MVS FIXME: needed?). */
46 enum tpdisp disposition;
47#endif
48 /* Number assigned to distinguish tracepoints. */
49 int number;
50
51 /* Address to trace at, or NULL if not an instruction tracepoint (MVS ?). */
52 CORE_ADDR address;
53
54 /* Line number of this address. Only matters if address is non-NULL. */
55 int line_number;
56
57 /* Source file name of this address. 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 disabling/ending. */
65 int pass_count;
66
67 /* Chain of action lines to execute when this tracepoint is hit. */
68 struct action_line *actions;
69
70 /* Conditional (MVS ?). */
71 struct expression *cond;
72
73 /* String we used to set the tracepoint (malloc'd). Only matters if
74 address is non-NULL. */
75 char *addr_string;
76
77 /* Language we used to set the tracepoint. */
78 enum language language;
79
80 /* Input radix we used to set the tracepoint. */
81 int input_radix;
82
6a02d201
MS
83 /* Count of the number of times this tracepoint was taken, dumped
84 with the info, but not used for anything else. Useful for
85 seeing how many times you hit a tracepoint prior to the program
86 aborting, so you can back up to just before the abort. */
87 int hit_count;
88
2e7eeba9 89 /* Thread number for thread-specific tracepoint, or -1 if don't care */
6a02d201 90 int thread;
2e7eeba9
MS
91
92 /* BFD section, in case of overlays:
93 no, I don't know if tracepoints are really gonna work with overlays. */
94 asection *section;
6a02d201
MS
95};
96
9fe11cd1
MS
97enum actionline_type
98{
99 BADLINE = -1,
100 GENERIC = 0,
101 END = 1,
102 STEPPING = 2,
103};
104
105
57c0b026
MS
106/* The tracepont chain of all tracepoints */
107
108extern struct tracepoint *tracepoint_chain;
109
41158958
EZ
110extern unsigned long trace_running_p;
111
57c0b026
MS
112/* A hook used to notify the UI of tracepoint operations */
113
114void (*create_tracepoint_hook) PARAMS ((struct tracepoint *));
115void (*delete_tracepoint_hook) PARAMS ((struct tracepoint *));
a5f4fbff 116void (*modify_tracepoint_hook) PARAMS ((struct tracepoint *));
63d138d9 117void (*trace_find_hook) PARAMS ((char *arg, int from_tty));
2aae6397 118void (*trace_start_stop_hook) PARAMS ((int start, int from_tty));
57c0b026
MS
119
120struct tracepoint *get_tracepoint_by_number PARAMS ((char **));
9fe11cd1 121int get_traceframe_number PARAMS ((void));
a5f4fbff 122void free_actions PARAMS((struct tracepoint *));
9fe11cd1
MS
123enum actionline_type validate_actionline PARAMS((char **,
124 struct tracepoint *));
125
57c0b026
MS
126
127/* Walk the following statement or block through all tracepoints.
128 ALL_TRACEPOINTS_SAFE does so even if the statment deletes the current
129 breakpoint. */
130
131#define ALL_TRACEPOINTS(t) for (t = tracepoint_chain; t; t = t->next)
6a02d201 132
57c0b026
MS
133#define ALL_TRACEPOINTS_SAFE(t,tmp) \
134 for (t = tracepoint_chain; \
135 t ? (tmp = t->next, 1) : 0;\
136 t = tmp)
6a02d201 137#endif /* TRACEPOINT_H */