gcc -Wall lint:
[binutils-gdb.git] / gdb / annotate.c
1 /* Annotation routines for GDB.
2 Copyright 1986, 1989, 1990, 1991, 1992 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 2 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, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
19
20 #include "defs.h"
21 #include "annotate.h"
22 #include "value.h"
23 #include "target.h"
24
25 void
26 breakpoints_changed ()
27 {
28 if (annotation_level > 1)
29 {
30 target_terminal_ours ();
31 printf_unfiltered ("\n\032\032breakpoints-invalid\n");
32 }
33 }
34
35 void
36 annotate_breakpoint (num)
37 int num;
38 {
39 if (annotation_level > 1)
40 printf_filtered ("\n\032\032breakpoint %d\n", num);
41 }
42
43 void
44 annotate_watchpoint (num)
45 int num;
46 {
47 if (annotation_level > 1)
48 printf_filtered ("\n\032\032watchpoint %d\n", num);
49 }
50
51 void
52 annotate_starting ()
53 {
54 if (annotation_level > 1)
55 printf_filtered ("\n\032\032starting\n");
56 }
57
58 void
59 annotate_stopped ()
60 {
61 if (annotation_level > 1)
62 printf_filtered ("\n\032\032stopped\n");
63 }
64
65 void
66 annotate_exited (exitstatus)
67 int exitstatus;
68 {
69 if (annotation_level > 1)
70 printf_filtered ("\n\032\032exited %d\n", exitstatus);
71 }
72
73 void
74 annotate_signalled ()
75 {
76 if (annotation_level > 1)
77 printf_filtered ("\n\032\032signalled\n");
78 }
79
80 void
81 annotate_signal_name ()
82 {
83 if (annotation_level > 1)
84 printf_filtered ("\n\032\032signal-name\n");
85 }
86
87 void
88 annotate_signal_name_end ()
89 {
90 if (annotation_level > 1)
91 printf_filtered ("\n\032\032signal-name-end\n");
92 }
93
94 void
95 annotate_signal_string ()
96 {
97 if (annotation_level > 1)
98 printf_filtered ("\n\032\032signal-string\n");
99 }
100
101 void
102 annotate_signal_string_end ()
103 {
104 if (annotation_level > 1)
105 printf_filtered ("\n\032\032signal-string-end\n");
106 }
107
108 void
109 annotate_signal ()
110 {
111 if (annotation_level > 1)
112 printf_filtered ("\n\032\032signal\n");
113 }
114 \f
115 void
116 annotate_breakpoints_headers ()
117 {
118 if (annotation_level > 1)
119 printf_filtered ("\n\032\032breakpoints-headers\n");
120 }
121
122 void
123 annotate_field (num)
124 int num;
125 {
126 if (annotation_level > 1)
127 printf_filtered ("\n\032\032field %d\n", num);
128 }
129
130 void
131 annotate_breakpoints_table ()
132 {
133 if (annotation_level > 1)
134 printf_filtered ("\n\032\032breakpoints-table\n");
135 }
136
137 void
138 annotate_record ()
139 {
140 if (annotation_level > 1)
141 printf_filtered ("\n\032\032record\n");
142 }
143
144 void
145 annotate_breakpoints_table_end ()
146 {
147 if (annotation_level > 1)
148 printf_filtered ("\n\032\032breakpoints-table-end\n");
149 }
150
151 void
152 annotate_frames_invalid ()
153 {
154 if (annotation_level > 1)
155 {
156 target_terminal_ours ();
157 printf_unfiltered ("\n\032\032frames-invalid\n");
158 }
159 }
160
161 void
162 annotate_field_begin (type)
163 struct type *type;
164 {
165 if (annotation_level > 1)
166 {
167 printf_filtered ("\n\032\032field-begin ");
168 print_value_flags (type);
169 printf_filtered ("\n");
170 }
171 }
172
173 void
174 annotate_field_name_end ()
175 {
176 if (annotation_level > 1)
177 printf_filtered ("\n\032\032field-name-end\n");
178 }
179
180 void
181 annotate_field_value ()
182 {
183 if (annotation_level > 1)
184 printf_filtered ("\n\032\032field-value\n");
185 }
186
187 void
188 annotate_field_end ()
189 {
190 if (annotation_level > 1)
191 printf_filtered ("\n\032\032field-value\n");
192 }
193 \f
194 void
195 annotate_quit ()
196 {
197 if (annotation_level > 1)
198 printf_filtered ("\n\032\032quit\n");
199 }
200
201 void
202 annotate_error ()
203 {
204 if (annotation_level > 1)
205 printf_filtered ("\n\032\032error\n");
206 }
207
208 void
209 annotate_error_begin ()
210 {
211 if (annotation_level > 1)
212 fprintf_filtered (gdb_stderr, "\n\032\032error-begin\n");
213 }
214
215 void
216 annotate_value_history_begin (histindex, type)
217 int histindex;
218 struct type *type;
219 {
220 if (annotation_level > 1)
221 {
222 printf_filtered ("\n\032\032value-history-begin %d ", histindex);
223 print_value_flags (type);
224 printf_filtered ("\n");
225 }
226 }
227
228 void
229 annotate_value_begin (type)
230 struct type *type;
231 {
232 if (annotation_level > 1)
233 {
234 printf_filtered ("\n\032\032value-begin ");
235 print_value_flags (type);
236 printf_filtered ("\n");
237 }
238 }
239
240 void
241 annotate_value_history_value ()
242 {
243 if (annotation_level > 1)
244 printf_filtered ("\n\032\032value-history-value\n");
245 }
246
247 void
248 annotate_value_history_end ()
249 {
250 if (annotation_level > 1)
251 printf_filtered ("\n\032\032value-history-end\n");
252 }
253
254 void
255 annotate_value_end ()
256 {
257 if (annotation_level > 1)
258 printf_filtered ("\n\032\032value-end\n");
259 }
260
261 void
262 annotate_display_begin ()
263 {
264 if (annotation_level > 1)
265 printf_filtered ("\n\032\032display-begin\n");
266 }
267
268 void
269 annotate_display_number_end ()
270 {
271 if (annotation_level > 1)
272 printf_filtered ("\n\032\032display-number-end\n");
273 }
274
275 void
276 annotate_display_format ()
277 {
278 if (annotation_level > 1)
279 printf_filtered ("\n\032\032display-format\n");
280 }
281
282 void
283 annotate_display_expression ()
284 {
285 if (annotation_level > 1)
286 printf_filtered ("\n\032\032display-expression\n");
287 }
288
289 void
290 annotate_display_expression_end ()
291 {
292 if (annotation_level > 1)
293 printf_filtered ("\n\032\032display-expression-end\n");
294 }
295
296 void
297 annotate_display_value ()
298 {
299 if (annotation_level > 1)
300 printf_filtered ("\n\032\032display-value\n");
301 }
302
303 void
304 annotate_display_end ()
305 {
306 if (annotation_level > 1)
307 printf_filtered ("\n\032\032display-end\n");
308 }
309
310 void
311 annotate_arg_begin ()
312 {
313 if (annotation_level > 1)
314 printf_filtered ("\n\032\032arg-begin\n");
315 }
316
317 void
318 annotate_arg_name_end ()
319 {
320 if (annotation_level > 1)
321 printf_filtered ("\n\032\032arg-name-end\n");
322 }
323
324 void
325 annotate_arg_value (type)
326 struct type *type;
327 {
328 if (annotation_level > 1)
329 {
330 printf_filtered ("\n\032\032arg-value ");
331 print_value_flags (type);
332 printf_filtered ("\n");
333 }
334 }
335
336 void
337 annotate_arg_end ()
338 {
339 if (annotation_level > 1)
340 printf_filtered ("\n\032\032arg-end\n");
341 }
342
343 void
344 annotate_source (filename, line, character, mid, pc)
345 char *filename;
346 int line;
347 int character;
348 int mid;
349 CORE_ADDR pc;
350 {
351 if (annotation_level > 1)
352 printf_filtered ("\n\032\032source ");
353 else
354 printf_filtered ("\032\032");
355
356 printf_filtered ("%s:%d:%d:%s:", filename,
357 line, character,
358 mid ? "middle" : "beg");
359 print_address_numeric (pc, 0, gdb_stdout);
360 printf_filtered ("\n");
361 }
362
363 void
364 annotate_frame_begin (level, pc)
365 int level;
366 CORE_ADDR pc;
367 {
368 if (annotation_level > 1)
369 {
370 printf_filtered ("\n\032\032frame-begin %d ", level);
371 print_address_numeric (pc, 0, gdb_stdout);
372 printf_filtered ("\n");
373 }
374 }
375
376 void
377 annotate_function_call ()
378 {
379 if (annotation_level > 1)
380 printf_filtered ("\n\032\032function-call\n");
381 }
382
383 void
384 annotate_signal_handler_caller ()
385 {
386 if (annotation_level > 1)
387 printf_filtered ("\n\032\032signal-handler-caller\n");
388 }
389
390 void
391 annotate_frame_address ()
392 {
393 if (annotation_level > 1)
394 printf_filtered ("\n\032\032frame-address\n");
395 }
396
397 void
398 annotate_frame_address_end ()
399 {
400 if (annotation_level > 1)
401 printf_filtered ("\n\032\032frame-address-end\n");
402 }
403
404 void
405 annotate_frame_function_name ()
406 {
407 if (annotation_level > 1)
408 printf_filtered ("\n\032\032frame-function-name\n");
409 }
410
411 void
412 annotate_frame_args ()
413 {
414 if (annotation_level > 1)
415 printf_filtered ("\n\032\032frame-args\n");
416 }
417
418 void
419 annotate_frame_source_begin ()
420 {
421 if (annotation_level > 1)
422 printf_filtered ("\n\032\032frame-source-begin\n");
423 }
424
425 void
426 annotate_frame_source_file ()
427 {
428 if (annotation_level > 1)
429 printf_filtered ("\n\032\032frame-source-file\n");
430 }
431
432 void
433 annotate_frame_source_file_end ()
434 {
435 if (annotation_level > 1)
436 printf_filtered ("\n\032\032frame-source-file-end\n");
437 }
438
439 void
440 annotate_frame_source_line ()
441 {
442 if (annotation_level > 1)
443 printf_filtered ("\n\032\032frame-source-line\n");
444 }
445
446 void
447 annotate_frame_source_end ()
448 {
449 if (annotation_level > 1)
450 printf_filtered ("\n\032\032frame-source-end\n");
451 }
452
453 void
454 annotate_frame_where ()
455 {
456 if (annotation_level > 1)
457 printf_filtered ("\n\032\032frame-where\n");
458 }
459
460 void
461 annotate_frame_end ()
462 {
463 if (annotation_level > 1)
464 printf_filtered ("\n\032\032frame-end\n");
465 }
466 \f
467 void
468 annotate_array_section_begin (index, elttype)
469 int index;
470 struct type *elttype;
471 {
472 if (annotation_level > 1)
473 {
474 printf_filtered ("\n\032\032array-section-begin %d ", index);
475 print_value_flags (elttype);
476 printf_filtered ("\n");
477 }
478 }
479
480 void
481 annotate_elt_rep (repcount)
482 unsigned int repcount;
483 {
484 if (annotation_level > 1)
485 printf_filtered ("\n\032\032elt-rep %u\n", repcount);
486 }
487
488 void
489 annotate_elt_rep_end ()
490 {
491 if (annotation_level > 1)
492 printf_filtered ("\n\032\032elt-rep-end\n");
493 }
494
495 void
496 annotate_elt ()
497 {
498 if (annotation_level > 1)
499 printf_filtered ("\n\032\032elt\n");
500 }
501
502 void
503 annotate_array_section_end ()
504 {
505 if (annotation_level > 1)
506 printf_filtered ("\n\032\032array-section-end\n");
507 }
508