1 /* Annotation routines for GDB.
2 Copyright 1986, 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
4 This file is part of GDB.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
25 #include "breakpoint.h"
27 static void print_value_flags PARAMS ((struct type *));
33 if (can_dereference (t))
34 printf_filtered ("*");
36 printf_filtered ("-");
40 breakpoints_changed ()
42 if (annotation_level > 1)
44 target_terminal_ours ();
45 printf_unfiltered ("\n\032\032breakpoints-invalid\n");
50 annotate_breakpoint (num)
53 if (annotation_level > 1)
54 printf_filtered ("\n\032\032breakpoint %d\n", num);
58 annotate_watchpoint (num)
61 if (annotation_level > 1)
62 printf_filtered ("\n\032\032watchpoint %d\n", num);
68 if (annotation_level > 1)
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);
80 if (annotation_level > 1)
81 printf_filtered ("\n\032\032stopped\n");
85 annotate_exited (exitstatus)
88 if (annotation_level > 1)
89 printf_filtered ("\n\032\032exited %d\n", exitstatus);
95 if (annotation_level > 1)
96 printf_filtered ("\n\032\032signalled\n");
100 annotate_signal_name ()
102 if (annotation_level > 1)
103 printf_filtered ("\n\032\032signal-name\n");
107 annotate_signal_name_end ()
109 if (annotation_level > 1)
110 printf_filtered ("\n\032\032signal-name-end\n");
114 annotate_signal_string ()
116 if (annotation_level > 1)
117 printf_filtered ("\n\032\032signal-string\n");
121 annotate_signal_string_end ()
123 if (annotation_level > 1)
124 printf_filtered ("\n\032\032signal-string-end\n");
130 if (annotation_level > 1)
131 printf_filtered ("\n\032\032signal\n");
135 annotate_breakpoints_headers ()
137 if (annotation_level > 1)
138 printf_filtered ("\n\032\032breakpoints-headers\n");
145 if (annotation_level > 1)
146 printf_filtered ("\n\032\032field %d\n", num);
150 annotate_breakpoints_table ()
152 if (annotation_level > 1)
153 printf_filtered ("\n\032\032breakpoints-table\n");
159 if (annotation_level > 1)
160 printf_filtered ("\n\032\032record\n");
164 annotate_breakpoints_table_end ()
166 if (annotation_level > 1)
167 printf_filtered ("\n\032\032breakpoints-table-end\n");
171 annotate_frames_invalid ()
173 if (annotation_level > 1)
175 target_terminal_ours ();
176 printf_unfiltered ("\n\032\032frames-invalid\n");
181 annotate_field_begin (type)
184 if (annotation_level > 1)
186 printf_filtered ("\n\032\032field-begin ");
187 print_value_flags (type);
188 printf_filtered ("\n");
193 annotate_field_name_end ()
195 if (annotation_level > 1)
196 printf_filtered ("\n\032\032field-name-end\n");
200 annotate_field_value ()
202 if (annotation_level > 1)
203 printf_filtered ("\n\032\032field-value\n");
207 annotate_field_end ()
209 if (annotation_level > 1)
210 printf_filtered ("\n\032\032field-end\n");
216 if (annotation_level > 1)
217 printf_filtered ("\n\032\032quit\n");
223 if (annotation_level > 1)
224 printf_filtered ("\n\032\032error\n");
228 annotate_error_begin ()
230 if (annotation_level > 1)
231 fprintf_filtered (gdb_stderr, "\n\032\032error-begin\n");
235 annotate_value_history_begin (histindex, type)
239 if (annotation_level > 1)
241 printf_filtered ("\n\032\032value-history-begin %d ", histindex);
242 print_value_flags (type);
243 printf_filtered ("\n");
248 annotate_value_begin (type)
251 if (annotation_level > 1)
253 printf_filtered ("\n\032\032value-begin ");
254 print_value_flags (type);
255 printf_filtered ("\n");
260 annotate_value_history_value ()
262 if (annotation_level > 1)
263 printf_filtered ("\n\032\032value-history-value\n");
267 annotate_value_history_end ()
269 if (annotation_level > 1)
270 printf_filtered ("\n\032\032value-history-end\n");
274 annotate_value_end ()
276 if (annotation_level > 1)
277 printf_filtered ("\n\032\032value-end\n");
281 annotate_display_begin ()
283 if (annotation_level > 1)
284 printf_filtered ("\n\032\032display-begin\n");
288 annotate_display_number_end ()
290 if (annotation_level > 1)
291 printf_filtered ("\n\032\032display-number-end\n");
295 annotate_display_format ()
297 if (annotation_level > 1)
298 printf_filtered ("\n\032\032display-format\n");
302 annotate_display_expression ()
304 if (annotation_level > 1)
305 printf_filtered ("\n\032\032display-expression\n");
309 annotate_display_expression_end ()
311 if (annotation_level > 1)
312 printf_filtered ("\n\032\032display-expression-end\n");
316 annotate_display_value ()
318 if (annotation_level > 1)
319 printf_filtered ("\n\032\032display-value\n");
323 annotate_display_end ()
325 if (annotation_level > 1)
326 printf_filtered ("\n\032\032display-end\n");
330 annotate_arg_begin ()
332 if (annotation_level > 1)
333 printf_filtered ("\n\032\032arg-begin\n");
337 annotate_arg_name_end ()
339 if (annotation_level > 1)
340 printf_filtered ("\n\032\032arg-name-end\n");
344 annotate_arg_value (type)
347 if (annotation_level > 1)
349 printf_filtered ("\n\032\032arg-value ");
350 print_value_flags (type);
351 printf_filtered ("\n");
358 if (annotation_level > 1)
359 printf_filtered ("\n\032\032arg-end\n");
363 annotate_source (filename, line, character, mid, pc)
370 if (annotation_level > 1)
371 printf_filtered ("\n\032\032source ");
373 printf_filtered ("\032\032");
375 printf_filtered ("%s:%d:%d:%s:", filename,
377 mid ? "middle" : "beg");
378 print_address_numeric (pc, 0, gdb_stdout);
379 printf_filtered ("\n");
383 annotate_frame_begin (level, pc)
387 if (annotation_level > 1)
389 printf_filtered ("\n\032\032frame-begin %d ", level);
390 print_address_numeric (pc, 0, gdb_stdout);
391 printf_filtered ("\n");
396 annotate_function_call ()
398 if (annotation_level > 1)
399 printf_filtered ("\n\032\032function-call\n");
403 annotate_signal_handler_caller ()
405 if (annotation_level > 1)
406 printf_filtered ("\n\032\032signal-handler-caller\n");
410 annotate_frame_address ()
412 if (annotation_level > 1)
413 printf_filtered ("\n\032\032frame-address\n");
417 annotate_frame_address_end ()
419 if (annotation_level > 1)
420 printf_filtered ("\n\032\032frame-address-end\n");
424 annotate_frame_function_name ()
426 if (annotation_level > 1)
427 printf_filtered ("\n\032\032frame-function-name\n");
431 annotate_frame_args ()
433 if (annotation_level > 1)
434 printf_filtered ("\n\032\032frame-args\n");
438 annotate_frame_source_begin ()
440 if (annotation_level > 1)
441 printf_filtered ("\n\032\032frame-source-begin\n");
445 annotate_frame_source_file ()
447 if (annotation_level > 1)
448 printf_filtered ("\n\032\032frame-source-file\n");
452 annotate_frame_source_file_end ()
454 if (annotation_level > 1)
455 printf_filtered ("\n\032\032frame-source-file-end\n");
459 annotate_frame_source_line ()
461 if (annotation_level > 1)
462 printf_filtered ("\n\032\032frame-source-line\n");
466 annotate_frame_source_end ()
468 if (annotation_level > 1)
469 printf_filtered ("\n\032\032frame-source-end\n");
473 annotate_frame_where ()
475 if (annotation_level > 1)
476 printf_filtered ("\n\032\032frame-where\n");
480 annotate_frame_end ()
482 if (annotation_level > 1)
483 printf_filtered ("\n\032\032frame-end\n");
487 annotate_array_section_begin (index, elttype)
489 struct type *elttype;
491 if (annotation_level > 1)
493 printf_filtered ("\n\032\032array-section-begin %d ", index);
494 print_value_flags (elttype);
495 printf_filtered ("\n");
500 annotate_elt_rep (repcount)
501 unsigned int repcount;
503 if (annotation_level > 1)
504 printf_filtered ("\n\032\032elt-rep %u\n", repcount);
508 annotate_elt_rep_end ()
510 if (annotation_level > 1)
511 printf_filtered ("\n\032\032elt-rep-end\n");
517 if (annotation_level > 1)
518 printf_filtered ("\n\032\032elt\n");
522 annotate_array_section_end ()
524 if (annotation_level > 1)
525 printf_filtered ("\n\032\032array-section-end\n");
529 breakpoint_changed (b)
530 struct breakpoint *b;
532 breakpoints_changed ();
536 _initialize_annotate ()
538 if (annotation_level > 1)
540 delete_breakpoint_hook = breakpoint_changed;
541 enable_breakpoint_hook = breakpoint_changed;
542 disable_breakpoint_hook = breakpoint_changed;