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