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)
69 printf_filtered ("\n\032\032starting\n");
75 if (annotation_level > 1)
76 printf_filtered ("\n\032\032stopped\n");
80 annotate_exited (exitstatus)
83 if (annotation_level > 1)
84 printf_filtered ("\n\032\032exited %d\n", exitstatus);
90 if (annotation_level > 1)
91 printf_filtered ("\n\032\032signalled\n");
95 annotate_signal_name ()
97 if (annotation_level > 1)
98 printf_filtered ("\n\032\032signal-name\n");
102 annotate_signal_name_end ()
104 if (annotation_level > 1)
105 printf_filtered ("\n\032\032signal-name-end\n");
109 annotate_signal_string ()
111 if (annotation_level > 1)
112 printf_filtered ("\n\032\032signal-string\n");
116 annotate_signal_string_end ()
118 if (annotation_level > 1)
119 printf_filtered ("\n\032\032signal-string-end\n");
125 if (annotation_level > 1)
126 printf_filtered ("\n\032\032signal\n");
130 annotate_breakpoints_headers ()
132 if (annotation_level > 1)
133 printf_filtered ("\n\032\032breakpoints-headers\n");
140 if (annotation_level > 1)
141 printf_filtered ("\n\032\032field %d\n", num);
145 annotate_breakpoints_table ()
147 if (annotation_level > 1)
148 printf_filtered ("\n\032\032breakpoints-table\n");
154 if (annotation_level > 1)
155 printf_filtered ("\n\032\032record\n");
159 annotate_breakpoints_table_end ()
161 if (annotation_level > 1)
162 printf_filtered ("\n\032\032breakpoints-table-end\n");
166 annotate_frames_invalid ()
168 if (annotation_level > 1)
170 target_terminal_ours ();
171 printf_unfiltered ("\n\032\032frames-invalid\n");
176 annotate_field_begin (type)
179 if (annotation_level > 1)
181 printf_filtered ("\n\032\032field-begin ");
182 print_value_flags (type);
183 printf_filtered ("\n");
188 annotate_field_name_end ()
190 if (annotation_level > 1)
191 printf_filtered ("\n\032\032field-name-end\n");
195 annotate_field_value ()
197 if (annotation_level > 1)
198 printf_filtered ("\n\032\032field-value\n");
202 annotate_field_end ()
204 if (annotation_level > 1)
205 printf_filtered ("\n\032\032field-end\n");
211 if (annotation_level > 1)
212 printf_filtered ("\n\032\032quit\n");
218 if (annotation_level > 1)
219 printf_filtered ("\n\032\032error\n");
223 annotate_error_begin ()
225 if (annotation_level > 1)
226 fprintf_filtered (gdb_stderr, "\n\032\032error-begin\n");
230 annotate_value_history_begin (histindex, type)
234 if (annotation_level > 1)
236 printf_filtered ("\n\032\032value-history-begin %d ", histindex);
237 print_value_flags (type);
238 printf_filtered ("\n");
243 annotate_value_begin (type)
246 if (annotation_level > 1)
248 printf_filtered ("\n\032\032value-begin ");
249 print_value_flags (type);
250 printf_filtered ("\n");
255 annotate_value_history_value ()
257 if (annotation_level > 1)
258 printf_filtered ("\n\032\032value-history-value\n");
262 annotate_value_history_end ()
264 if (annotation_level > 1)
265 printf_filtered ("\n\032\032value-history-end\n");
269 annotate_value_end ()
271 if (annotation_level > 1)
272 printf_filtered ("\n\032\032value-end\n");
276 annotate_display_begin ()
278 if (annotation_level > 1)
279 printf_filtered ("\n\032\032display-begin\n");
283 annotate_display_number_end ()
285 if (annotation_level > 1)
286 printf_filtered ("\n\032\032display-number-end\n");
290 annotate_display_format ()
292 if (annotation_level > 1)
293 printf_filtered ("\n\032\032display-format\n");
297 annotate_display_expression ()
299 if (annotation_level > 1)
300 printf_filtered ("\n\032\032display-expression\n");
304 annotate_display_expression_end ()
306 if (annotation_level > 1)
307 printf_filtered ("\n\032\032display-expression-end\n");
311 annotate_display_value ()
313 if (annotation_level > 1)
314 printf_filtered ("\n\032\032display-value\n");
318 annotate_display_end ()
320 if (annotation_level > 1)
321 printf_filtered ("\n\032\032display-end\n");
325 annotate_arg_begin ()
327 if (annotation_level > 1)
328 printf_filtered ("\n\032\032arg-begin\n");
332 annotate_arg_name_end ()
334 if (annotation_level > 1)
335 printf_filtered ("\n\032\032arg-name-end\n");
339 annotate_arg_value (type)
342 if (annotation_level > 1)
344 printf_filtered ("\n\032\032arg-value ");
345 print_value_flags (type);
346 printf_filtered ("\n");
353 if (annotation_level > 1)
354 printf_filtered ("\n\032\032arg-end\n");
358 annotate_source (filename, line, character, mid, pc)
365 if (annotation_level > 1)
366 printf_filtered ("\n\032\032source ");
368 printf_filtered ("\032\032");
370 printf_filtered ("%s:%d:%d:%s:", filename,
372 mid ? "middle" : "beg");
373 print_address_numeric (pc, 0, gdb_stdout);
374 printf_filtered ("\n");
378 annotate_frame_begin (level, pc)
382 if (annotation_level > 1)
384 printf_filtered ("\n\032\032frame-begin %d ", level);
385 print_address_numeric (pc, 0, gdb_stdout);
386 printf_filtered ("\n");
391 annotate_function_call ()
393 if (annotation_level > 1)
394 printf_filtered ("\n\032\032function-call\n");
398 annotate_signal_handler_caller ()
400 if (annotation_level > 1)
401 printf_filtered ("\n\032\032signal-handler-caller\n");
405 annotate_frame_address ()
407 if (annotation_level > 1)
408 printf_filtered ("\n\032\032frame-address\n");
412 annotate_frame_address_end ()
414 if (annotation_level > 1)
415 printf_filtered ("\n\032\032frame-address-end\n");
419 annotate_frame_function_name ()
421 if (annotation_level > 1)
422 printf_filtered ("\n\032\032frame-function-name\n");
426 annotate_frame_args ()
428 if (annotation_level > 1)
429 printf_filtered ("\n\032\032frame-args\n");
433 annotate_frame_source_begin ()
435 if (annotation_level > 1)
436 printf_filtered ("\n\032\032frame-source-begin\n");
440 annotate_frame_source_file ()
442 if (annotation_level > 1)
443 printf_filtered ("\n\032\032frame-source-file\n");
447 annotate_frame_source_file_end ()
449 if (annotation_level > 1)
450 printf_filtered ("\n\032\032frame-source-file-end\n");
454 annotate_frame_source_line ()
456 if (annotation_level > 1)
457 printf_filtered ("\n\032\032frame-source-line\n");
461 annotate_frame_source_end ()
463 if (annotation_level > 1)
464 printf_filtered ("\n\032\032frame-source-end\n");
468 annotate_frame_where ()
470 if (annotation_level > 1)
471 printf_filtered ("\n\032\032frame-where\n");
475 annotate_frame_end ()
477 if (annotation_level > 1)
478 printf_filtered ("\n\032\032frame-end\n");
482 annotate_array_section_begin (index, elttype)
484 struct type *elttype;
486 if (annotation_level > 1)
488 printf_filtered ("\n\032\032array-section-begin %d ", index);
489 print_value_flags (elttype);
490 printf_filtered ("\n");
495 annotate_elt_rep (repcount)
496 unsigned int repcount;
498 if (annotation_level > 1)
499 printf_filtered ("\n\032\032elt-rep %u\n", repcount);
503 annotate_elt_rep_end ()
505 if (annotation_level > 1)
506 printf_filtered ("\n\032\032elt-rep-end\n");
512 if (annotation_level > 1)
513 printf_filtered ("\n\032\032elt\n");
517 annotate_array_section_end ()
519 if (annotation_level > 1)
520 printf_filtered ("\n\032\032array-section-end\n");
524 breakpoint_changed (b)
525 struct breakpoint *b;
527 breakpoints_changed ();
531 _initialize_annotate ()
533 if (annotation_level > 1)
535 delete_breakpoint_hook = breakpoint_changed;
536 enable_breakpoint_hook = breakpoint_changed;
537 disable_breakpoint_hook = breakpoint_changed;