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