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