xref: /dflybsd-src/contrib/gdb-7/gdb/annotate.c (revision 5796c8dc12c637f18a1740c26afd8d40ffa9b719)
1*5796c8dcSSimon Schubert /* Annotation routines for GDB.
2*5796c8dcSSimon Schubert    Copyright (C) 1986, 1989, 1990, 1991, 1992, 1994, 1995, 1996, 1998, 1999,
3*5796c8dcSSimon Schubert    2000, 2007, 2008, 2009 Free Software Foundation, Inc.
4*5796c8dcSSimon Schubert 
5*5796c8dcSSimon Schubert    This file is part of GDB.
6*5796c8dcSSimon Schubert 
7*5796c8dcSSimon Schubert    This program is free software; you can redistribute it and/or modify
8*5796c8dcSSimon Schubert    it under the terms of the GNU General Public License as published by
9*5796c8dcSSimon Schubert    the Free Software Foundation; either version 3 of the License, or
10*5796c8dcSSimon Schubert    (at your option) any later version.
11*5796c8dcSSimon Schubert 
12*5796c8dcSSimon Schubert    This program is distributed in the hope that it will be useful,
13*5796c8dcSSimon Schubert    but WITHOUT ANY WARRANTY; without even the implied warranty of
14*5796c8dcSSimon Schubert    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15*5796c8dcSSimon Schubert    GNU General Public License for more details.
16*5796c8dcSSimon Schubert 
17*5796c8dcSSimon Schubert    You should have received a copy of the GNU General Public License
18*5796c8dcSSimon Schubert    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
19*5796c8dcSSimon Schubert 
20*5796c8dcSSimon Schubert #include "defs.h"
21*5796c8dcSSimon Schubert #include "annotate.h"
22*5796c8dcSSimon Schubert #include "value.h"
23*5796c8dcSSimon Schubert #include "target.h"
24*5796c8dcSSimon Schubert #include "gdbtypes.h"
25*5796c8dcSSimon Schubert #include "breakpoint.h"
26*5796c8dcSSimon Schubert #include "observer.h"
27*5796c8dcSSimon Schubert 
28*5796c8dcSSimon Schubert 
29*5796c8dcSSimon Schubert /* Prototypes for local functions. */
30*5796c8dcSSimon Schubert 
31*5796c8dcSSimon Schubert extern void _initialize_annotate (void);
32*5796c8dcSSimon Schubert 
33*5796c8dcSSimon Schubert static void print_value_flags (struct type *);
34*5796c8dcSSimon Schubert 
35*5796c8dcSSimon Schubert static void breakpoint_changed (int);
36*5796c8dcSSimon Schubert 
37*5796c8dcSSimon Schubert 
38*5796c8dcSSimon Schubert void (*deprecated_annotate_signalled_hook) (void);
39*5796c8dcSSimon Schubert void (*deprecated_annotate_signal_hook) (void);
40*5796c8dcSSimon Schubert 
41*5796c8dcSSimon Schubert static int ignore_count_changed = 0;
42*5796c8dcSSimon Schubert 
43*5796c8dcSSimon Schubert static void
44*5796c8dcSSimon Schubert print_value_flags (struct type *t)
45*5796c8dcSSimon Schubert {
46*5796c8dcSSimon Schubert   if (can_dereference (t))
47*5796c8dcSSimon Schubert     printf_filtered (("*"));
48*5796c8dcSSimon Schubert   else
49*5796c8dcSSimon Schubert     printf_filtered (("-"));
50*5796c8dcSSimon Schubert }
51*5796c8dcSSimon Schubert 
52*5796c8dcSSimon Schubert void
53*5796c8dcSSimon Schubert breakpoints_changed (void)
54*5796c8dcSSimon Schubert {
55*5796c8dcSSimon Schubert   if (annotation_level == 2)
56*5796c8dcSSimon Schubert     {
57*5796c8dcSSimon Schubert       target_terminal_ours ();
58*5796c8dcSSimon Schubert       printf_unfiltered (("\n\032\032breakpoints-invalid\n"));
59*5796c8dcSSimon Schubert       if (ignore_count_changed)
60*5796c8dcSSimon Schubert 	ignore_count_changed = 0;	/* Avoid multiple break annotations. */
61*5796c8dcSSimon Schubert     }
62*5796c8dcSSimon Schubert }
63*5796c8dcSSimon Schubert 
64*5796c8dcSSimon Schubert /* The GUI needs to be informed of ignore_count changes, but we don't
65*5796c8dcSSimon Schubert    want to provide successive multiple breakpoints-invalid messages
66*5796c8dcSSimon Schubert    that are all caused by the fact that the ignore count is changing
67*5796c8dcSSimon Schubert    (which could keep the GUI very busy).  One is enough, after the
68*5796c8dcSSimon Schubert    target actually "stops". */
69*5796c8dcSSimon Schubert 
70*5796c8dcSSimon Schubert void
71*5796c8dcSSimon Schubert annotate_ignore_count_change (void)
72*5796c8dcSSimon Schubert {
73*5796c8dcSSimon Schubert   if (annotation_level > 1)
74*5796c8dcSSimon Schubert     ignore_count_changed = 1;
75*5796c8dcSSimon Schubert }
76*5796c8dcSSimon Schubert 
77*5796c8dcSSimon Schubert void
78*5796c8dcSSimon Schubert annotate_breakpoint (int num)
79*5796c8dcSSimon Schubert {
80*5796c8dcSSimon Schubert   if (annotation_level > 1)
81*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032breakpoint %d\n"), num);
82*5796c8dcSSimon Schubert }
83*5796c8dcSSimon Schubert 
84*5796c8dcSSimon Schubert void
85*5796c8dcSSimon Schubert annotate_catchpoint (int num)
86*5796c8dcSSimon Schubert {
87*5796c8dcSSimon Schubert   if (annotation_level > 1)
88*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032catchpoint %d\n"), num);
89*5796c8dcSSimon Schubert }
90*5796c8dcSSimon Schubert 
91*5796c8dcSSimon Schubert void
92*5796c8dcSSimon Schubert annotate_watchpoint (int num)
93*5796c8dcSSimon Schubert {
94*5796c8dcSSimon Schubert   if (annotation_level > 1)
95*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032watchpoint %d\n"), num);
96*5796c8dcSSimon Schubert }
97*5796c8dcSSimon Schubert 
98*5796c8dcSSimon Schubert void
99*5796c8dcSSimon Schubert annotate_starting (void)
100*5796c8dcSSimon Schubert {
101*5796c8dcSSimon Schubert   if (annotation_level > 1)
102*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032starting\n"));
103*5796c8dcSSimon Schubert }
104*5796c8dcSSimon Schubert 
105*5796c8dcSSimon Schubert void
106*5796c8dcSSimon Schubert annotate_stopped (void)
107*5796c8dcSSimon Schubert {
108*5796c8dcSSimon Schubert   if (annotation_level > 1)
109*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032stopped\n"));
110*5796c8dcSSimon Schubert   if (annotation_level > 1 && ignore_count_changed)
111*5796c8dcSSimon Schubert     {
112*5796c8dcSSimon Schubert       ignore_count_changed = 0;
113*5796c8dcSSimon Schubert       breakpoints_changed ();
114*5796c8dcSSimon Schubert     }
115*5796c8dcSSimon Schubert }
116*5796c8dcSSimon Schubert 
117*5796c8dcSSimon Schubert void
118*5796c8dcSSimon Schubert annotate_exited (int exitstatus)
119*5796c8dcSSimon Schubert {
120*5796c8dcSSimon Schubert   if (annotation_level > 1)
121*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032exited %d\n"), exitstatus);
122*5796c8dcSSimon Schubert }
123*5796c8dcSSimon Schubert 
124*5796c8dcSSimon Schubert void
125*5796c8dcSSimon Schubert annotate_signalled (void)
126*5796c8dcSSimon Schubert {
127*5796c8dcSSimon Schubert   if (deprecated_annotate_signalled_hook)
128*5796c8dcSSimon Schubert     deprecated_annotate_signalled_hook ();
129*5796c8dcSSimon Schubert 
130*5796c8dcSSimon Schubert   if (annotation_level > 1)
131*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032signalled\n"));
132*5796c8dcSSimon Schubert }
133*5796c8dcSSimon Schubert 
134*5796c8dcSSimon Schubert void
135*5796c8dcSSimon Schubert annotate_signal_name (void)
136*5796c8dcSSimon Schubert {
137*5796c8dcSSimon Schubert   if (annotation_level == 2)
138*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032signal-name\n"));
139*5796c8dcSSimon Schubert }
140*5796c8dcSSimon Schubert 
141*5796c8dcSSimon Schubert void
142*5796c8dcSSimon Schubert annotate_signal_name_end (void)
143*5796c8dcSSimon Schubert {
144*5796c8dcSSimon Schubert   if (annotation_level == 2)
145*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032signal-name-end\n"));
146*5796c8dcSSimon Schubert }
147*5796c8dcSSimon Schubert 
148*5796c8dcSSimon Schubert void
149*5796c8dcSSimon Schubert annotate_signal_string (void)
150*5796c8dcSSimon Schubert {
151*5796c8dcSSimon Schubert   if (annotation_level == 2)
152*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032signal-string\n"));
153*5796c8dcSSimon Schubert }
154*5796c8dcSSimon Schubert 
155*5796c8dcSSimon Schubert void
156*5796c8dcSSimon Schubert annotate_signal_string_end (void)
157*5796c8dcSSimon Schubert {
158*5796c8dcSSimon Schubert   if (annotation_level == 2)
159*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032signal-string-end\n"));
160*5796c8dcSSimon Schubert }
161*5796c8dcSSimon Schubert 
162*5796c8dcSSimon Schubert void
163*5796c8dcSSimon Schubert annotate_signal (void)
164*5796c8dcSSimon Schubert {
165*5796c8dcSSimon Schubert   if (deprecated_annotate_signal_hook)
166*5796c8dcSSimon Schubert     deprecated_annotate_signal_hook ();
167*5796c8dcSSimon Schubert 
168*5796c8dcSSimon Schubert   if (annotation_level > 1)
169*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032signal\n"));
170*5796c8dcSSimon Schubert }
171*5796c8dcSSimon Schubert 
172*5796c8dcSSimon Schubert void
173*5796c8dcSSimon Schubert annotate_breakpoints_headers (void)
174*5796c8dcSSimon Schubert {
175*5796c8dcSSimon Schubert   if (annotation_level == 2)
176*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032breakpoints-headers\n"));
177*5796c8dcSSimon Schubert }
178*5796c8dcSSimon Schubert 
179*5796c8dcSSimon Schubert void
180*5796c8dcSSimon Schubert annotate_field (int num)
181*5796c8dcSSimon Schubert {
182*5796c8dcSSimon Schubert   if (annotation_level == 2)
183*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032field %d\n"), num);
184*5796c8dcSSimon Schubert }
185*5796c8dcSSimon Schubert 
186*5796c8dcSSimon Schubert void
187*5796c8dcSSimon Schubert annotate_breakpoints_table (void)
188*5796c8dcSSimon Schubert {
189*5796c8dcSSimon Schubert   if (annotation_level == 2)
190*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032breakpoints-table\n"));
191*5796c8dcSSimon Schubert }
192*5796c8dcSSimon Schubert 
193*5796c8dcSSimon Schubert void
194*5796c8dcSSimon Schubert annotate_record (void)
195*5796c8dcSSimon Schubert {
196*5796c8dcSSimon Schubert   if (annotation_level == 2)
197*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032record\n"));
198*5796c8dcSSimon Schubert }
199*5796c8dcSSimon Schubert 
200*5796c8dcSSimon Schubert void
201*5796c8dcSSimon Schubert annotate_breakpoints_table_end (void)
202*5796c8dcSSimon Schubert {
203*5796c8dcSSimon Schubert   if (annotation_level == 2)
204*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032breakpoints-table-end\n"));
205*5796c8dcSSimon Schubert }
206*5796c8dcSSimon Schubert 
207*5796c8dcSSimon Schubert void
208*5796c8dcSSimon Schubert annotate_frames_invalid (void)
209*5796c8dcSSimon Schubert {
210*5796c8dcSSimon Schubert   if (annotation_level == 2)
211*5796c8dcSSimon Schubert     {
212*5796c8dcSSimon Schubert       target_terminal_ours ();
213*5796c8dcSSimon Schubert       printf_unfiltered (("\n\032\032frames-invalid\n"));
214*5796c8dcSSimon Schubert     }
215*5796c8dcSSimon Schubert }
216*5796c8dcSSimon Schubert 
217*5796c8dcSSimon Schubert void
218*5796c8dcSSimon Schubert annotate_new_thread (void)
219*5796c8dcSSimon Schubert {
220*5796c8dcSSimon Schubert   if (annotation_level > 1)
221*5796c8dcSSimon Schubert     {
222*5796c8dcSSimon Schubert       printf_unfiltered (("\n\032\032new-thread\n"));
223*5796c8dcSSimon Schubert     }
224*5796c8dcSSimon Schubert }
225*5796c8dcSSimon Schubert 
226*5796c8dcSSimon Schubert void
227*5796c8dcSSimon Schubert annotate_thread_changed (void)
228*5796c8dcSSimon Schubert {
229*5796c8dcSSimon Schubert   if (annotation_level > 1)
230*5796c8dcSSimon Schubert     {
231*5796c8dcSSimon Schubert       printf_unfiltered (("\n\032\032thread-changed\n"));
232*5796c8dcSSimon Schubert     }
233*5796c8dcSSimon Schubert }
234*5796c8dcSSimon Schubert 
235*5796c8dcSSimon Schubert void
236*5796c8dcSSimon Schubert annotate_field_begin (struct type *type)
237*5796c8dcSSimon Schubert {
238*5796c8dcSSimon Schubert   if (annotation_level == 2)
239*5796c8dcSSimon Schubert     {
240*5796c8dcSSimon Schubert       printf_filtered (("\n\032\032field-begin "));
241*5796c8dcSSimon Schubert       print_value_flags (type);
242*5796c8dcSSimon Schubert       printf_filtered (("\n"));
243*5796c8dcSSimon Schubert     }
244*5796c8dcSSimon Schubert }
245*5796c8dcSSimon Schubert 
246*5796c8dcSSimon Schubert void
247*5796c8dcSSimon Schubert annotate_field_name_end (void)
248*5796c8dcSSimon Schubert {
249*5796c8dcSSimon Schubert   if (annotation_level == 2)
250*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032field-name-end\n"));
251*5796c8dcSSimon Schubert }
252*5796c8dcSSimon Schubert 
253*5796c8dcSSimon Schubert void
254*5796c8dcSSimon Schubert annotate_field_value (void)
255*5796c8dcSSimon Schubert {
256*5796c8dcSSimon Schubert   if (annotation_level == 2)
257*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032field-value\n"));
258*5796c8dcSSimon Schubert }
259*5796c8dcSSimon Schubert 
260*5796c8dcSSimon Schubert void
261*5796c8dcSSimon Schubert annotate_field_end (void)
262*5796c8dcSSimon Schubert {
263*5796c8dcSSimon Schubert   if (annotation_level == 2)
264*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032field-end\n"));
265*5796c8dcSSimon Schubert }
266*5796c8dcSSimon Schubert 
267*5796c8dcSSimon Schubert void
268*5796c8dcSSimon Schubert annotate_quit (void)
269*5796c8dcSSimon Schubert {
270*5796c8dcSSimon Schubert   if (annotation_level > 1)
271*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032quit\n"));
272*5796c8dcSSimon Schubert }
273*5796c8dcSSimon Schubert 
274*5796c8dcSSimon Schubert void
275*5796c8dcSSimon Schubert annotate_error (void)
276*5796c8dcSSimon Schubert {
277*5796c8dcSSimon Schubert   if (annotation_level > 1)
278*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032error\n"));
279*5796c8dcSSimon Schubert }
280*5796c8dcSSimon Schubert 
281*5796c8dcSSimon Schubert void
282*5796c8dcSSimon Schubert annotate_error_begin (void)
283*5796c8dcSSimon Schubert {
284*5796c8dcSSimon Schubert   if (annotation_level > 1)
285*5796c8dcSSimon Schubert     fprintf_filtered (gdb_stderr, "\n\032\032error-begin\n");
286*5796c8dcSSimon Schubert }
287*5796c8dcSSimon Schubert 
288*5796c8dcSSimon Schubert void
289*5796c8dcSSimon Schubert annotate_value_history_begin (int histindex, struct type *type)
290*5796c8dcSSimon Schubert {
291*5796c8dcSSimon Schubert   if (annotation_level == 2)
292*5796c8dcSSimon Schubert     {
293*5796c8dcSSimon Schubert       printf_filtered (("\n\032\032value-history-begin %d "), histindex);
294*5796c8dcSSimon Schubert       print_value_flags (type);
295*5796c8dcSSimon Schubert       printf_filtered (("\n"));
296*5796c8dcSSimon Schubert     }
297*5796c8dcSSimon Schubert }
298*5796c8dcSSimon Schubert 
299*5796c8dcSSimon Schubert void
300*5796c8dcSSimon Schubert annotate_value_begin (struct type *type)
301*5796c8dcSSimon Schubert {
302*5796c8dcSSimon Schubert   if (annotation_level == 2)
303*5796c8dcSSimon Schubert     {
304*5796c8dcSSimon Schubert       printf_filtered (("\n\032\032value-begin "));
305*5796c8dcSSimon Schubert       print_value_flags (type);
306*5796c8dcSSimon Schubert       printf_filtered (("\n"));
307*5796c8dcSSimon Schubert     }
308*5796c8dcSSimon Schubert }
309*5796c8dcSSimon Schubert 
310*5796c8dcSSimon Schubert void
311*5796c8dcSSimon Schubert annotate_value_history_value (void)
312*5796c8dcSSimon Schubert {
313*5796c8dcSSimon Schubert   if (annotation_level == 2)
314*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032value-history-value\n"));
315*5796c8dcSSimon Schubert }
316*5796c8dcSSimon Schubert 
317*5796c8dcSSimon Schubert void
318*5796c8dcSSimon Schubert annotate_value_history_end (void)
319*5796c8dcSSimon Schubert {
320*5796c8dcSSimon Schubert   if (annotation_level == 2)
321*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032value-history-end\n"));
322*5796c8dcSSimon Schubert }
323*5796c8dcSSimon Schubert 
324*5796c8dcSSimon Schubert void
325*5796c8dcSSimon Schubert annotate_value_end (void)
326*5796c8dcSSimon Schubert {
327*5796c8dcSSimon Schubert   if (annotation_level == 2)
328*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032value-end\n"));
329*5796c8dcSSimon Schubert }
330*5796c8dcSSimon Schubert 
331*5796c8dcSSimon Schubert void
332*5796c8dcSSimon Schubert annotate_display_begin (void)
333*5796c8dcSSimon Schubert {
334*5796c8dcSSimon Schubert   if (annotation_level == 2)
335*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032display-begin\n"));
336*5796c8dcSSimon Schubert }
337*5796c8dcSSimon Schubert 
338*5796c8dcSSimon Schubert void
339*5796c8dcSSimon Schubert annotate_display_number_end (void)
340*5796c8dcSSimon Schubert {
341*5796c8dcSSimon Schubert   if (annotation_level == 2)
342*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032display-number-end\n"));
343*5796c8dcSSimon Schubert }
344*5796c8dcSSimon Schubert 
345*5796c8dcSSimon Schubert void
346*5796c8dcSSimon Schubert annotate_display_format (void)
347*5796c8dcSSimon Schubert {
348*5796c8dcSSimon Schubert   if (annotation_level == 2)
349*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032display-format\n"));
350*5796c8dcSSimon Schubert }
351*5796c8dcSSimon Schubert 
352*5796c8dcSSimon Schubert void
353*5796c8dcSSimon Schubert annotate_display_expression (void)
354*5796c8dcSSimon Schubert {
355*5796c8dcSSimon Schubert   if (annotation_level == 2)
356*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032display-expression\n"));
357*5796c8dcSSimon Schubert }
358*5796c8dcSSimon Schubert 
359*5796c8dcSSimon Schubert void
360*5796c8dcSSimon Schubert annotate_display_expression_end (void)
361*5796c8dcSSimon Schubert {
362*5796c8dcSSimon Schubert   if (annotation_level == 2)
363*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032display-expression-end\n"));
364*5796c8dcSSimon Schubert }
365*5796c8dcSSimon Schubert 
366*5796c8dcSSimon Schubert void
367*5796c8dcSSimon Schubert annotate_display_value (void)
368*5796c8dcSSimon Schubert {
369*5796c8dcSSimon Schubert   if (annotation_level == 2)
370*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032display-value\n"));
371*5796c8dcSSimon Schubert }
372*5796c8dcSSimon Schubert 
373*5796c8dcSSimon Schubert void
374*5796c8dcSSimon Schubert annotate_display_end (void)
375*5796c8dcSSimon Schubert {
376*5796c8dcSSimon Schubert   if (annotation_level == 2)
377*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032display-end\n"));
378*5796c8dcSSimon Schubert }
379*5796c8dcSSimon Schubert 
380*5796c8dcSSimon Schubert void
381*5796c8dcSSimon Schubert annotate_arg_begin (void)
382*5796c8dcSSimon Schubert {
383*5796c8dcSSimon Schubert   if (annotation_level == 2)
384*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032arg-begin\n"));
385*5796c8dcSSimon Schubert }
386*5796c8dcSSimon Schubert 
387*5796c8dcSSimon Schubert void
388*5796c8dcSSimon Schubert annotate_arg_name_end (void)
389*5796c8dcSSimon Schubert {
390*5796c8dcSSimon Schubert   if (annotation_level == 2)
391*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032arg-name-end\n"));
392*5796c8dcSSimon Schubert }
393*5796c8dcSSimon Schubert 
394*5796c8dcSSimon Schubert void
395*5796c8dcSSimon Schubert annotate_arg_value (struct type *type)
396*5796c8dcSSimon Schubert {
397*5796c8dcSSimon Schubert   if (annotation_level == 2)
398*5796c8dcSSimon Schubert     {
399*5796c8dcSSimon Schubert       printf_filtered (("\n\032\032arg-value "));
400*5796c8dcSSimon Schubert       print_value_flags (type);
401*5796c8dcSSimon Schubert       printf_filtered (("\n"));
402*5796c8dcSSimon Schubert     }
403*5796c8dcSSimon Schubert }
404*5796c8dcSSimon Schubert 
405*5796c8dcSSimon Schubert void
406*5796c8dcSSimon Schubert annotate_arg_end (void)
407*5796c8dcSSimon Schubert {
408*5796c8dcSSimon Schubert   if (annotation_level == 2)
409*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032arg-end\n"));
410*5796c8dcSSimon Schubert }
411*5796c8dcSSimon Schubert 
412*5796c8dcSSimon Schubert void
413*5796c8dcSSimon Schubert annotate_source (char *filename, int line, int character, int mid,
414*5796c8dcSSimon Schubert 		 struct gdbarch *gdbarch, CORE_ADDR pc)
415*5796c8dcSSimon Schubert {
416*5796c8dcSSimon Schubert   if (annotation_level > 1)
417*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032source "));
418*5796c8dcSSimon Schubert   else
419*5796c8dcSSimon Schubert     printf_filtered (("\032\032"));
420*5796c8dcSSimon Schubert 
421*5796c8dcSSimon Schubert   printf_filtered (("%s:%d:%d:%s:%s\n"), filename, line, character,
422*5796c8dcSSimon Schubert 		   mid ? "middle" : "beg", paddress (gdbarch, pc));
423*5796c8dcSSimon Schubert }
424*5796c8dcSSimon Schubert 
425*5796c8dcSSimon Schubert void
426*5796c8dcSSimon Schubert annotate_frame_begin (int level, struct gdbarch *gdbarch, CORE_ADDR pc)
427*5796c8dcSSimon Schubert {
428*5796c8dcSSimon Schubert   if (annotation_level > 1)
429*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032frame-begin %d %s\n"),
430*5796c8dcSSimon Schubert 		     level, paddress (gdbarch, pc));
431*5796c8dcSSimon Schubert }
432*5796c8dcSSimon Schubert 
433*5796c8dcSSimon Schubert void
434*5796c8dcSSimon Schubert annotate_function_call (void)
435*5796c8dcSSimon Schubert {
436*5796c8dcSSimon Schubert   if (annotation_level == 2)
437*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032function-call\n"));
438*5796c8dcSSimon Schubert }
439*5796c8dcSSimon Schubert 
440*5796c8dcSSimon Schubert void
441*5796c8dcSSimon Schubert annotate_signal_handler_caller (void)
442*5796c8dcSSimon Schubert {
443*5796c8dcSSimon Schubert   if (annotation_level == 2)
444*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032signal-handler-caller\n"));
445*5796c8dcSSimon Schubert }
446*5796c8dcSSimon Schubert 
447*5796c8dcSSimon Schubert void
448*5796c8dcSSimon Schubert annotate_frame_address (void)
449*5796c8dcSSimon Schubert {
450*5796c8dcSSimon Schubert   if (annotation_level == 2)
451*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032frame-address\n"));
452*5796c8dcSSimon Schubert }
453*5796c8dcSSimon Schubert 
454*5796c8dcSSimon Schubert void
455*5796c8dcSSimon Schubert annotate_frame_address_end (void)
456*5796c8dcSSimon Schubert {
457*5796c8dcSSimon Schubert   if (annotation_level == 2)
458*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032frame-address-end\n"));
459*5796c8dcSSimon Schubert }
460*5796c8dcSSimon Schubert 
461*5796c8dcSSimon Schubert void
462*5796c8dcSSimon Schubert annotate_frame_function_name (void)
463*5796c8dcSSimon Schubert {
464*5796c8dcSSimon Schubert   if (annotation_level == 2)
465*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032frame-function-name\n"));
466*5796c8dcSSimon Schubert }
467*5796c8dcSSimon Schubert 
468*5796c8dcSSimon Schubert void
469*5796c8dcSSimon Schubert annotate_frame_args (void)
470*5796c8dcSSimon Schubert {
471*5796c8dcSSimon Schubert   if (annotation_level == 2)
472*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032frame-args\n"));
473*5796c8dcSSimon Schubert }
474*5796c8dcSSimon Schubert 
475*5796c8dcSSimon Schubert void
476*5796c8dcSSimon Schubert annotate_frame_source_begin (void)
477*5796c8dcSSimon Schubert {
478*5796c8dcSSimon Schubert   if (annotation_level == 2)
479*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032frame-source-begin\n"));
480*5796c8dcSSimon Schubert }
481*5796c8dcSSimon Schubert 
482*5796c8dcSSimon Schubert void
483*5796c8dcSSimon Schubert annotate_frame_source_file (void)
484*5796c8dcSSimon Schubert {
485*5796c8dcSSimon Schubert   if (annotation_level == 2)
486*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032frame-source-file\n"));
487*5796c8dcSSimon Schubert }
488*5796c8dcSSimon Schubert 
489*5796c8dcSSimon Schubert void
490*5796c8dcSSimon Schubert annotate_frame_source_file_end (void)
491*5796c8dcSSimon Schubert {
492*5796c8dcSSimon Schubert   if (annotation_level == 2)
493*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032frame-source-file-end\n"));
494*5796c8dcSSimon Schubert }
495*5796c8dcSSimon Schubert 
496*5796c8dcSSimon Schubert void
497*5796c8dcSSimon Schubert annotate_frame_source_line (void)
498*5796c8dcSSimon Schubert {
499*5796c8dcSSimon Schubert   if (annotation_level == 2)
500*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032frame-source-line\n"));
501*5796c8dcSSimon Schubert }
502*5796c8dcSSimon Schubert 
503*5796c8dcSSimon Schubert void
504*5796c8dcSSimon Schubert annotate_frame_source_end (void)
505*5796c8dcSSimon Schubert {
506*5796c8dcSSimon Schubert   if (annotation_level == 2)
507*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032frame-source-end\n"));
508*5796c8dcSSimon Schubert }
509*5796c8dcSSimon Schubert 
510*5796c8dcSSimon Schubert void
511*5796c8dcSSimon Schubert annotate_frame_where (void)
512*5796c8dcSSimon Schubert {
513*5796c8dcSSimon Schubert   if (annotation_level == 2)
514*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032frame-where\n"));
515*5796c8dcSSimon Schubert }
516*5796c8dcSSimon Schubert 
517*5796c8dcSSimon Schubert void
518*5796c8dcSSimon Schubert annotate_frame_end (void)
519*5796c8dcSSimon Schubert {
520*5796c8dcSSimon Schubert   if (annotation_level == 2)
521*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032frame-end\n"));
522*5796c8dcSSimon Schubert }
523*5796c8dcSSimon Schubert 
524*5796c8dcSSimon Schubert void
525*5796c8dcSSimon Schubert annotate_array_section_begin (int index, struct type *elttype)
526*5796c8dcSSimon Schubert {
527*5796c8dcSSimon Schubert   if (annotation_level == 2)
528*5796c8dcSSimon Schubert     {
529*5796c8dcSSimon Schubert       printf_filtered (("\n\032\032array-section-begin %d "), index);
530*5796c8dcSSimon Schubert       print_value_flags (elttype);
531*5796c8dcSSimon Schubert       printf_filtered (("\n"));
532*5796c8dcSSimon Schubert     }
533*5796c8dcSSimon Schubert }
534*5796c8dcSSimon Schubert 
535*5796c8dcSSimon Schubert void
536*5796c8dcSSimon Schubert annotate_elt_rep (unsigned int repcount)
537*5796c8dcSSimon Schubert {
538*5796c8dcSSimon Schubert   if (annotation_level == 2)
539*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032elt-rep %u\n"), repcount);
540*5796c8dcSSimon Schubert }
541*5796c8dcSSimon Schubert 
542*5796c8dcSSimon Schubert void
543*5796c8dcSSimon Schubert annotate_elt_rep_end (void)
544*5796c8dcSSimon Schubert {
545*5796c8dcSSimon Schubert   if (annotation_level == 2)
546*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032elt-rep-end\n"));
547*5796c8dcSSimon Schubert }
548*5796c8dcSSimon Schubert 
549*5796c8dcSSimon Schubert void
550*5796c8dcSSimon Schubert annotate_elt (void)
551*5796c8dcSSimon Schubert {
552*5796c8dcSSimon Schubert   if (annotation_level == 2)
553*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032elt\n"));
554*5796c8dcSSimon Schubert }
555*5796c8dcSSimon Schubert 
556*5796c8dcSSimon Schubert void
557*5796c8dcSSimon Schubert annotate_array_section_end (void)
558*5796c8dcSSimon Schubert {
559*5796c8dcSSimon Schubert   if (annotation_level == 2)
560*5796c8dcSSimon Schubert     printf_filtered (("\n\032\032array-section-end\n"));
561*5796c8dcSSimon Schubert }
562*5796c8dcSSimon Schubert 
563*5796c8dcSSimon Schubert static void
564*5796c8dcSSimon Schubert breakpoint_changed (int bpno)
565*5796c8dcSSimon Schubert {
566*5796c8dcSSimon Schubert   breakpoints_changed ();
567*5796c8dcSSimon Schubert }
568*5796c8dcSSimon Schubert 
569*5796c8dcSSimon Schubert void
570*5796c8dcSSimon Schubert _initialize_annotate (void)
571*5796c8dcSSimon Schubert {
572*5796c8dcSSimon Schubert   if (annotation_level == 2)
573*5796c8dcSSimon Schubert     {
574*5796c8dcSSimon Schubert       observer_attach_breakpoint_deleted (breakpoint_changed);
575*5796c8dcSSimon Schubert       observer_attach_breakpoint_modified (breakpoint_changed);
576*5796c8dcSSimon Schubert     }
577*5796c8dcSSimon Schubert }
578