1 /* Annotation routines for GDB.
2 Copyright 1986, 1989, 1990, 1991, 1992, 1995 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
25 #include "breakpoint.h"
27 static void print_value_flags PARAMS ((struct type *));
28 static void breakpoint_changed PARAMS ((struct breakpoint *));
30 void (*annotate_starting_hook) PARAMS ((void));
31 void (*annotate_stopped_hook) PARAMS ((void));
32 void (*annotate_signalled_hook) PARAMS ((void));
33 void (*annotate_exited_hook) PARAMS ((void));
39 if (can_dereference (t))
40 printf_filtered ("*");
42 printf_filtered ("-");
46 breakpoints_changed ()
48 if (annotation_level > 1)
50 target_terminal_ours ();
51 printf_unfiltered ("\n\032\032breakpoints-invalid\n");
56 annotate_breakpoint (num)
59 if (annotation_level > 1)
60 printf_filtered ("\n\032\032breakpoint %d\n", num);
64 annotate_watchpoint (num)
67 if (annotation_level > 1)
68 printf_filtered ("\n\032\032watchpoint %d\n", num);
75 if (annotate_starting_hook)
76 annotate_starting_hook ();
79 if (annotation_level > 1)
81 printf_filtered ("\n\032\032starting\n");
89 if (annotate_stopped_hook)
90 annotate_stopped_hook ();
93 if (annotation_level > 1)
94 printf_filtered ("\n\032\032stopped\n");
99 annotate_exited (exitstatus)
102 if (annotate_exited_hook)
103 annotate_exited_hook ();
106 if (annotation_level > 1)
107 printf_filtered ("\n\032\032exited %d\n", exitstatus);
112 annotate_signalled ()
114 if (annotate_signalled_hook)
115 annotate_signalled_hook ();
117 if (annotation_level > 1)
118 printf_filtered ("\n\032\032signalled\n");
122 annotate_signal_name ()
124 if (annotation_level > 1)
125 printf_filtered ("\n\032\032signal-name\n");
129 annotate_signal_name_end ()
131 if (annotation_level > 1)
132 printf_filtered ("\n\032\032signal-name-end\n");
136 annotate_signal_string ()
138 if (annotation_level > 1)
139 printf_filtered ("\n\032\032signal-string\n");
143 annotate_signal_string_end ()
145 if (annotation_level > 1)
146 printf_filtered ("\n\032\032signal-string-end\n");
152 if (annotation_level > 1)
153 printf_filtered ("\n\032\032signal\n");
157 annotate_breakpoints_headers ()
159 if (annotation_level > 1)
160 printf_filtered ("\n\032\032breakpoints-headers\n");
167 if (annotation_level > 1)
168 printf_filtered ("\n\032\032field %d\n", num);
172 annotate_breakpoints_table ()
174 if (annotation_level > 1)
175 printf_filtered ("\n\032\032breakpoints-table\n");
181 if (annotation_level > 1)
182 printf_filtered ("\n\032\032record\n");
186 annotate_breakpoints_table_end ()
188 if (annotation_level > 1)
189 printf_filtered ("\n\032\032breakpoints-table-end\n");
193 annotate_frames_invalid ()
195 if (annotation_level > 1)
197 target_terminal_ours ();
198 printf_unfiltered ("\n\032\032frames-invalid\n");
203 annotate_field_begin (type)
206 if (annotation_level > 1)
208 printf_filtered ("\n\032\032field-begin ");
209 print_value_flags (type);
210 printf_filtered ("\n");
215 annotate_field_name_end ()
217 if (annotation_level > 1)
218 printf_filtered ("\n\032\032field-name-end\n");
222 annotate_field_value ()
224 if (annotation_level > 1)
225 printf_filtered ("\n\032\032field-value\n");
229 annotate_field_end ()
231 if (annotation_level > 1)
232 printf_filtered ("\n\032\032field-end\n");
238 if (annotation_level > 1)
239 printf_filtered ("\n\032\032quit\n");
245 if (annotation_level > 1)
246 printf_filtered ("\n\032\032error\n");
250 annotate_error_begin ()
252 if (annotation_level > 1)
253 fprintf_filtered (gdb_stderr, "\n\032\032error-begin\n");
257 annotate_value_history_begin (histindex, type)
261 if (annotation_level > 1)
263 printf_filtered ("\n\032\032value-history-begin %d ", histindex);
264 print_value_flags (type);
265 printf_filtered ("\n");
270 annotate_value_begin (type)
273 if (annotation_level > 1)
275 printf_filtered ("\n\032\032value-begin ");
276 print_value_flags (type);
277 printf_filtered ("\n");
282 annotate_value_history_value ()
284 if (annotation_level > 1)
285 printf_filtered ("\n\032\032value-history-value\n");
289 annotate_value_history_end ()
291 if (annotation_level > 1)
292 printf_filtered ("\n\032\032value-history-end\n");
296 annotate_value_end ()
298 if (annotation_level > 1)
299 printf_filtered ("\n\032\032value-end\n");
303 annotate_display_begin ()
305 if (annotation_level > 1)
306 printf_filtered ("\n\032\032display-begin\n");
310 annotate_display_number_end ()
312 if (annotation_level > 1)
313 printf_filtered ("\n\032\032display-number-end\n");
317 annotate_display_format ()
319 if (annotation_level > 1)
320 printf_filtered ("\n\032\032display-format\n");
324 annotate_display_expression ()
326 if (annotation_level > 1)
327 printf_filtered ("\n\032\032display-expression\n");
331 annotate_display_expression_end ()
333 if (annotation_level > 1)
334 printf_filtered ("\n\032\032display-expression-end\n");
338 annotate_display_value ()
340 if (annotation_level > 1)
341 printf_filtered ("\n\032\032display-value\n");
345 annotate_display_end ()
347 if (annotation_level > 1)
348 printf_filtered ("\n\032\032display-end\n");
352 annotate_arg_begin ()
354 if (annotation_level > 1)
355 printf_filtered ("\n\032\032arg-begin\n");
359 annotate_arg_name_end ()
361 if (annotation_level > 1)
362 printf_filtered ("\n\032\032arg-name-end\n");
366 annotate_arg_value (type)
369 if (annotation_level > 1)
371 printf_filtered ("\n\032\032arg-value ");
372 print_value_flags (type);
373 printf_filtered ("\n");
380 if (annotation_level > 1)
381 printf_filtered ("\n\032\032arg-end\n");
385 annotate_source (filename, line, character, mid, pc)
392 if (annotation_level > 1)
393 printf_filtered ("\n\032\032source ");
395 printf_filtered ("\032\032");
397 printf_filtered ("%s:%d:%d:%s:0x", filename,
399 mid ? "middle" : "beg");
400 print_address_numeric (pc, 0, gdb_stdout);
401 printf_filtered ("\n");
405 annotate_frame_begin (level, pc)
409 if (annotation_level > 1)
411 printf_filtered ("\n\032\032frame-begin %d 0x", level);
412 print_address_numeric (pc, 0, gdb_stdout);
413 printf_filtered ("\n");
418 annotate_function_call ()
420 if (annotation_level > 1)
421 printf_filtered ("\n\032\032function-call\n");
425 annotate_signal_handler_caller ()
427 if (annotation_level > 1)
428 printf_filtered ("\n\032\032signal-handler-caller\n");
432 annotate_frame_address ()
434 if (annotation_level > 1)
435 printf_filtered ("\n\032\032frame-address\n");
439 annotate_frame_address_end ()
441 if (annotation_level > 1)
442 printf_filtered ("\n\032\032frame-address-end\n");
446 annotate_frame_function_name ()
448 if (annotation_level > 1)
449 printf_filtered ("\n\032\032frame-function-name\n");
453 annotate_frame_args ()
455 if (annotation_level > 1)
456 printf_filtered ("\n\032\032frame-args\n");
460 annotate_frame_source_begin ()
462 if (annotation_level > 1)
463 printf_filtered ("\n\032\032frame-source-begin\n");
467 annotate_frame_source_file ()
469 if (annotation_level > 1)
470 printf_filtered ("\n\032\032frame-source-file\n");
474 annotate_frame_source_file_end ()
476 if (annotation_level > 1)
477 printf_filtered ("\n\032\032frame-source-file-end\n");
481 annotate_frame_source_line ()
483 if (annotation_level > 1)
484 printf_filtered ("\n\032\032frame-source-line\n");
488 annotate_frame_source_end ()
490 if (annotation_level > 1)
491 printf_filtered ("\n\032\032frame-source-end\n");
495 annotate_frame_where ()
497 if (annotation_level > 1)
498 printf_filtered ("\n\032\032frame-where\n");
502 annotate_frame_end ()
504 if (annotation_level > 1)
505 printf_filtered ("\n\032\032frame-end\n");
509 annotate_array_section_begin (index, elttype)
511 struct type *elttype;
513 if (annotation_level > 1)
515 printf_filtered ("\n\032\032array-section-begin %d ", index);
516 print_value_flags (elttype);
517 printf_filtered ("\n");
522 annotate_elt_rep (repcount)
523 unsigned int repcount;
525 if (annotation_level > 1)
526 printf_filtered ("\n\032\032elt-rep %u\n", repcount);
530 annotate_elt_rep_end ()
532 if (annotation_level > 1)
533 printf_filtered ("\n\032\032elt-rep-end\n");
539 if (annotation_level > 1)
540 printf_filtered ("\n\032\032elt\n");
544 annotate_array_section_end ()
546 if (annotation_level > 1)
547 printf_filtered ("\n\032\032array-section-end\n");
551 breakpoint_changed (b)
552 struct breakpoint *b;
554 breakpoints_changed ();
558 _initialize_annotate ()
560 if (annotation_level > 1)
562 delete_breakpoint_hook = breakpoint_changed;
563 modify_breakpoint_hook = breakpoint_changed;