1 /* Annotation routines for GDB.
2 Copyright 1986, 89, 90, 91, 92, 95, 98, 1999 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"
28 /* Prototypes for local functions. */
30 static void print_value_flags PARAMS ((struct type *));
32 static void breakpoint_changed PARAMS ((struct breakpoint *));
34 void (*annotate_starting_hook) PARAMS ((void));
35 void (*annotate_stopped_hook) PARAMS ((void));
36 void (*annotate_signalled_hook) PARAMS ((void));
37 void (*annotate_signal_hook) PARAMS ((void));
38 void (*annotate_exited_hook) PARAMS ((void));
44 if (can_dereference (t))
45 printf_filtered ("*");
47 printf_filtered ("-");
51 breakpoints_changed ()
53 if (annotation_level > 1)
55 target_terminal_ours ();
56 printf_unfiltered ("\n\032\032breakpoints-invalid\n");
61 annotate_breakpoint (num)
64 if (annotation_level > 1)
65 printf_filtered ("\n\032\032breakpoint %d\n", num);
69 annotate_catchpoint (num)
72 if (annotation_level > 1)
73 printf_filtered ("\n\032\032catchpoint %d\n", num);
77 annotate_watchpoint (num)
80 if (annotation_level > 1)
81 printf_filtered ("\n\032\032watchpoint %d\n", num);
88 if (annotate_starting_hook)
89 annotate_starting_hook ();
92 if (annotation_level > 1)
94 printf_filtered ("\n\032\032starting\n");
102 if (annotate_stopped_hook)
103 annotate_stopped_hook ();
106 if (annotation_level > 1)
107 printf_filtered ("\n\032\032stopped\n");
112 annotate_exited (exitstatus)
115 if (annotate_exited_hook)
116 annotate_exited_hook ();
119 if (annotation_level > 1)
120 printf_filtered ("\n\032\032exited %d\n", exitstatus);
125 annotate_signalled ()
127 if (annotate_signalled_hook)
128 annotate_signalled_hook ();
130 if (annotation_level > 1)
131 printf_filtered ("\n\032\032signalled\n");
135 annotate_signal_name ()
137 if (annotation_level > 1)
138 printf_filtered ("\n\032\032signal-name\n");
142 annotate_signal_name_end ()
144 if (annotation_level > 1)
145 printf_filtered ("\n\032\032signal-name-end\n");
149 annotate_signal_string ()
151 if (annotation_level > 1)
152 printf_filtered ("\n\032\032signal-string\n");
156 annotate_signal_string_end ()
158 if (annotation_level > 1)
159 printf_filtered ("\n\032\032signal-string-end\n");
165 if (annotate_signal_hook)
166 annotate_signal_hook ();
168 if (annotation_level > 1)
169 printf_filtered ("\n\032\032signal\n");
173 annotate_breakpoints_headers ()
175 if (annotation_level > 1)
176 printf_filtered ("\n\032\032breakpoints-headers\n");
183 if (annotation_level > 1)
184 printf_filtered ("\n\032\032field %d\n", num);
188 annotate_breakpoints_table ()
190 if (annotation_level > 1)
191 printf_filtered ("\n\032\032breakpoints-table\n");
197 if (annotation_level > 1)
198 printf_filtered ("\n\032\032record\n");
202 annotate_breakpoints_table_end ()
204 if (annotation_level > 1)
205 printf_filtered ("\n\032\032breakpoints-table-end\n");
209 annotate_frames_invalid ()
211 if (annotation_level > 1)
213 target_terminal_ours ();
214 printf_unfiltered ("\n\032\032frames-invalid\n");
219 annotate_field_begin (type)
222 if (annotation_level > 1)
224 printf_filtered ("\n\032\032field-begin ");
225 print_value_flags (type);
226 printf_filtered ("\n");
231 annotate_field_name_end ()
233 if (annotation_level > 1)
234 printf_filtered ("\n\032\032field-name-end\n");
238 annotate_field_value ()
240 if (annotation_level > 1)
241 printf_filtered ("\n\032\032field-value\n");
245 annotate_field_end ()
247 if (annotation_level > 1)
248 printf_filtered ("\n\032\032field-end\n");
254 if (annotation_level > 1)
255 printf_filtered ("\n\032\032quit\n");
261 if (annotation_level > 1)
262 printf_filtered ("\n\032\032error\n");
266 annotate_error_begin ()
268 if (annotation_level > 1)
269 fprintf_filtered (gdb_stderr, "\n\032\032error-begin\n");
273 annotate_value_history_begin (histindex, type)
277 if (annotation_level > 1)
279 printf_filtered ("\n\032\032value-history-begin %d ", histindex);
280 print_value_flags (type);
281 printf_filtered ("\n");
286 annotate_value_begin (type)
289 if (annotation_level > 1)
291 printf_filtered ("\n\032\032value-begin ");
292 print_value_flags (type);
293 printf_filtered ("\n");
298 annotate_value_history_value ()
300 if (annotation_level > 1)
301 printf_filtered ("\n\032\032value-history-value\n");
305 annotate_value_history_end ()
307 if (annotation_level > 1)
308 printf_filtered ("\n\032\032value-history-end\n");
312 annotate_value_end ()
314 if (annotation_level > 1)
315 printf_filtered ("\n\032\032value-end\n");
319 annotate_display_begin ()
321 if (annotation_level > 1)
322 printf_filtered ("\n\032\032display-begin\n");
326 annotate_display_number_end ()
328 if (annotation_level > 1)
329 printf_filtered ("\n\032\032display-number-end\n");
333 annotate_display_format ()
335 if (annotation_level > 1)
336 printf_filtered ("\n\032\032display-format\n");
340 annotate_display_expression ()
342 if (annotation_level > 1)
343 printf_filtered ("\n\032\032display-expression\n");
347 annotate_display_expression_end ()
349 if (annotation_level > 1)
350 printf_filtered ("\n\032\032display-expression-end\n");
354 annotate_display_value ()
356 if (annotation_level > 1)
357 printf_filtered ("\n\032\032display-value\n");
361 annotate_display_end ()
363 if (annotation_level > 1)
364 printf_filtered ("\n\032\032display-end\n");
368 annotate_arg_begin ()
370 if (annotation_level > 1)
371 printf_filtered ("\n\032\032arg-begin\n");
375 annotate_arg_name_end ()
377 if (annotation_level > 1)
378 printf_filtered ("\n\032\032arg-name-end\n");
382 annotate_arg_value (type)
385 if (annotation_level > 1)
387 printf_filtered ("\n\032\032arg-value ");
388 print_value_flags (type);
389 printf_filtered ("\n");
396 if (annotation_level > 1)
397 printf_filtered ("\n\032\032arg-end\n");
401 annotate_source (filename, line, character, mid, pc)
408 if (annotation_level > 1)
409 printf_filtered ("\n\032\032source ");
411 printf_filtered ("\032\032");
413 printf_filtered ("%s:%d:%d:%s:0x", filename,
415 mid ? "middle" : "beg");
416 print_address_numeric (pc, 0, gdb_stdout);
417 printf_filtered ("\n");
421 annotate_frame_begin (level, pc)
425 if (annotation_level > 1)
427 printf_filtered ("\n\032\032frame-begin %d 0x", level);
428 print_address_numeric (pc, 0, gdb_stdout);
429 printf_filtered ("\n");
434 annotate_function_call ()
436 if (annotation_level > 1)
437 printf_filtered ("\n\032\032function-call\n");
441 annotate_signal_handler_caller ()
443 if (annotation_level > 1)
444 printf_filtered ("\n\032\032signal-handler-caller\n");
448 annotate_frame_address ()
450 if (annotation_level > 1)
451 printf_filtered ("\n\032\032frame-address\n");
455 annotate_frame_address_end ()
457 if (annotation_level > 1)
458 printf_filtered ("\n\032\032frame-address-end\n");
462 annotate_frame_function_name ()
464 if (annotation_level > 1)
465 printf_filtered ("\n\032\032frame-function-name\n");
469 annotate_frame_args ()
471 if (annotation_level > 1)
472 printf_filtered ("\n\032\032frame-args\n");
476 annotate_frame_source_begin ()
478 if (annotation_level > 1)
479 printf_filtered ("\n\032\032frame-source-begin\n");
483 annotate_frame_source_file ()
485 if (annotation_level > 1)
486 printf_filtered ("\n\032\032frame-source-file\n");
490 annotate_frame_source_file_end ()
492 if (annotation_level > 1)
493 printf_filtered ("\n\032\032frame-source-file-end\n");
497 annotate_frame_source_line ()
499 if (annotation_level > 1)
500 printf_filtered ("\n\032\032frame-source-line\n");
504 annotate_frame_source_end ()
506 if (annotation_level > 1)
507 printf_filtered ("\n\032\032frame-source-end\n");
511 annotate_frame_where ()
513 if (annotation_level > 1)
514 printf_filtered ("\n\032\032frame-where\n");
518 annotate_frame_end ()
520 if (annotation_level > 1)
521 printf_filtered ("\n\032\032frame-end\n");
525 annotate_array_section_begin (index, elttype)
527 struct type *elttype;
529 if (annotation_level > 1)
531 printf_filtered ("\n\032\032array-section-begin %d ", index);
532 print_value_flags (elttype);
533 printf_filtered ("\n");
538 annotate_elt_rep (repcount)
539 unsigned int repcount;
541 if (annotation_level > 1)
542 printf_filtered ("\n\032\032elt-rep %u\n", repcount);
546 annotate_elt_rep_end ()
548 if (annotation_level > 1)
549 printf_filtered ("\n\032\032elt-rep-end\n");
555 if (annotation_level > 1)
556 printf_filtered ("\n\032\032elt\n");
560 annotate_array_section_end ()
562 if (annotation_level > 1)
563 printf_filtered ("\n\032\032array-section-end\n");
567 breakpoint_changed (b)
568 struct breakpoint *b;
570 breakpoints_changed ();
574 _initialize_annotate ()
576 if (annotation_level > 1)
578 delete_breakpoint_hook = breakpoint_changed;
579 modify_breakpoint_hook = breakpoint_changed;