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