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