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,
19 Boston, MA 02111-1307, USA. */
26 #include "breakpoint.h"
29 /* Prototypes for local functions. */
31 extern void _initialize_annotate PARAMS ((void));
33 static void print_value_flags PARAMS ((struct type *));
35 static void breakpoint_changed PARAMS ((struct breakpoint *));
37 void (*annotate_starting_hook) PARAMS ((void));
38 void (*annotate_stopped_hook) PARAMS ((void));
39 void (*annotate_signalled_hook) PARAMS ((void));
40 void (*annotate_signal_hook) PARAMS ((void));
41 void (*annotate_exited_hook) PARAMS ((void));
47 if (can_dereference (t))
48 printf_filtered ("*");
50 printf_filtered ("-");
54 breakpoints_changed ()
56 if (annotation_level > 1)
58 target_terminal_ours ();
59 printf_unfiltered ("\n\032\032breakpoints-invalid\n");
64 annotate_breakpoint (num)
67 if (annotation_level > 1)
68 printf_filtered ("\n\032\032breakpoint %d\n", num);
72 annotate_catchpoint (num)
75 if (annotation_level > 1)
76 printf_filtered ("\n\032\032catchpoint %d\n", num);
80 annotate_watchpoint (num)
83 if (annotation_level > 1)
84 printf_filtered ("\n\032\032watchpoint %d\n", num);
91 if (annotate_starting_hook)
92 annotate_starting_hook ();
95 if (annotation_level > 1)
97 printf_filtered ("\n\032\032starting\n");
105 if (annotate_stopped_hook)
106 annotate_stopped_hook ();
109 if (annotation_level > 1)
110 printf_filtered ("\n\032\032stopped\n");
115 annotate_exited (exitstatus)
118 if (annotate_exited_hook)
119 annotate_exited_hook ();
122 if (annotation_level > 1)
123 printf_filtered ("\n\032\032exited %d\n", exitstatus);
128 annotate_signalled ()
130 if (annotate_signalled_hook)
131 annotate_signalled_hook ();
133 if (annotation_level > 1)
134 printf_filtered ("\n\032\032signalled\n");
138 annotate_signal_name ()
140 if (annotation_level > 1)
141 printf_filtered ("\n\032\032signal-name\n");
145 annotate_signal_name_end ()
147 if (annotation_level > 1)
148 printf_filtered ("\n\032\032signal-name-end\n");
152 annotate_signal_string ()
154 if (annotation_level > 1)
155 printf_filtered ("\n\032\032signal-string\n");
159 annotate_signal_string_end ()
161 if (annotation_level > 1)
162 printf_filtered ("\n\032\032signal-string-end\n");
168 if (annotate_signal_hook)
169 annotate_signal_hook ();
171 if (annotation_level > 1)
172 printf_filtered ("\n\032\032signal\n");
176 annotate_breakpoints_headers ()
178 if (annotation_level > 1)
179 printf_filtered ("\n\032\032breakpoints-headers\n");
186 if (annotation_level > 1)
187 printf_filtered ("\n\032\032field %d\n", num);
191 annotate_breakpoints_table ()
193 if (annotation_level > 1)
194 printf_filtered ("\n\032\032breakpoints-table\n");
200 if (annotation_level > 1)
201 printf_filtered ("\n\032\032record\n");
205 annotate_breakpoints_table_end ()
207 if (annotation_level > 1)
208 printf_filtered ("\n\032\032breakpoints-table-end\n");
212 annotate_frames_invalid ()
214 if (annotation_level > 1)
216 target_terminal_ours ();
217 printf_unfiltered ("\n\032\032frames-invalid\n");
222 annotate_field_begin (type)
225 if (annotation_level > 1)
227 printf_filtered ("\n\032\032field-begin ");
228 print_value_flags (type);
229 printf_filtered ("\n");
234 annotate_field_name_end ()
236 if (annotation_level > 1)
237 printf_filtered ("\n\032\032field-name-end\n");
241 annotate_field_value ()
243 if (annotation_level > 1)
244 printf_filtered ("\n\032\032field-value\n");
248 annotate_field_end ()
250 if (annotation_level > 1)
251 printf_filtered ("\n\032\032field-end\n");
257 if (annotation_level > 1)
258 printf_filtered ("\n\032\032quit\n");
264 if (annotation_level > 1)
265 printf_filtered ("\n\032\032error\n");
269 annotate_error_begin ()
271 if (annotation_level > 1)
272 fprintf_filtered (gdb_stderr, "\n\032\032error-begin\n");
276 annotate_value_history_begin (histindex, type)
280 if (annotation_level > 1)
282 printf_filtered ("\n\032\032value-history-begin %d ", histindex);
283 print_value_flags (type);
284 printf_filtered ("\n");
289 annotate_value_begin (type)
292 if (annotation_level > 1)
294 printf_filtered ("\n\032\032value-begin ");
295 print_value_flags (type);
296 printf_filtered ("\n");
301 annotate_value_history_value ()
303 if (annotation_level > 1)
304 printf_filtered ("\n\032\032value-history-value\n");
308 annotate_value_history_end ()
310 if (annotation_level > 1)
311 printf_filtered ("\n\032\032value-history-end\n");
315 annotate_value_end ()
317 if (annotation_level > 1)
318 printf_filtered ("\n\032\032value-end\n");
322 annotate_display_begin ()
324 if (annotation_level > 1)
325 printf_filtered ("\n\032\032display-begin\n");
329 annotate_display_number_end ()
331 if (annotation_level > 1)
332 printf_filtered ("\n\032\032display-number-end\n");
336 annotate_display_format ()
338 if (annotation_level > 1)
339 printf_filtered ("\n\032\032display-format\n");
343 annotate_display_expression ()
345 if (annotation_level > 1)
346 printf_filtered ("\n\032\032display-expression\n");
350 annotate_display_expression_end ()
352 if (annotation_level > 1)
353 printf_filtered ("\n\032\032display-expression-end\n");
357 annotate_display_value ()
359 if (annotation_level > 1)
360 printf_filtered ("\n\032\032display-value\n");
364 annotate_display_end ()
366 if (annotation_level > 1)
367 printf_filtered ("\n\032\032display-end\n");
371 annotate_arg_begin ()
373 if (annotation_level > 1)
374 printf_filtered ("\n\032\032arg-begin\n");
378 annotate_arg_name_end ()
380 if (annotation_level > 1)
381 printf_filtered ("\n\032\032arg-name-end\n");
385 annotate_arg_value (type)
388 if (annotation_level > 1)
390 printf_filtered ("\n\032\032arg-value ");
391 print_value_flags (type);
392 printf_filtered ("\n");
399 if (annotation_level > 1)
400 printf_filtered ("\n\032\032arg-end\n");
404 annotate_source (filename, line, character, mid, pc)
411 if (annotation_level > 1)
412 printf_filtered ("\n\032\032source ");
414 printf_filtered ("\032\032");
416 printf_filtered ("%s:%d:%d:%s:0x", filename,
418 mid ? "middle" : "beg");
419 print_address_numeric (pc, 0, gdb_stdout);
420 printf_filtered ("\n");
424 annotate_frame_begin (level, pc)
428 if (annotation_level > 1)
430 printf_filtered ("\n\032\032frame-begin %d 0x", level);
431 print_address_numeric (pc, 0, gdb_stdout);
432 printf_filtered ("\n");
437 annotate_function_call ()
439 if (annotation_level > 1)
440 printf_filtered ("\n\032\032function-call\n");
444 annotate_signal_handler_caller ()
446 if (annotation_level > 1)
447 printf_filtered ("\n\032\032signal-handler-caller\n");
451 annotate_frame_address ()
453 if (annotation_level > 1)
454 printf_filtered ("\n\032\032frame-address\n");
458 annotate_frame_address_end ()
460 if (annotation_level > 1)
461 printf_filtered ("\n\032\032frame-address-end\n");
465 annotate_frame_function_name ()
467 if (annotation_level > 1)
468 printf_filtered ("\n\032\032frame-function-name\n");
472 annotate_frame_args ()
474 if (annotation_level > 1)
475 printf_filtered ("\n\032\032frame-args\n");
479 annotate_frame_source_begin ()
481 if (annotation_level > 1)
482 printf_filtered ("\n\032\032frame-source-begin\n");
486 annotate_frame_source_file ()
488 if (annotation_level > 1)
489 printf_filtered ("\n\032\032frame-source-file\n");
493 annotate_frame_source_file_end ()
495 if (annotation_level > 1)
496 printf_filtered ("\n\032\032frame-source-file-end\n");
500 annotate_frame_source_line ()
502 if (annotation_level > 1)
503 printf_filtered ("\n\032\032frame-source-line\n");
507 annotate_frame_source_end ()
509 if (annotation_level > 1)
510 printf_filtered ("\n\032\032frame-source-end\n");
514 annotate_frame_where ()
516 if (annotation_level > 1)
517 printf_filtered ("\n\032\032frame-where\n");
521 annotate_frame_end ()
523 if (annotation_level > 1)
524 printf_filtered ("\n\032\032frame-end\n");
528 annotate_array_section_begin (index, elttype)
530 struct type *elttype;
532 if (annotation_level > 1)
534 printf_filtered ("\n\032\032array-section-begin %d ", index);
535 print_value_flags (elttype);
536 printf_filtered ("\n");
541 annotate_elt_rep (repcount)
542 unsigned int repcount;
544 if (annotation_level > 1)
545 printf_filtered ("\n\032\032elt-rep %u\n", repcount);
549 annotate_elt_rep_end ()
551 if (annotation_level > 1)
552 printf_filtered ("\n\032\032elt-rep-end\n");
558 if (annotation_level > 1)
559 printf_filtered ("\n\032\032elt\n");
563 annotate_array_section_end ()
565 if (annotation_level > 1)
566 printf_filtered ("\n\032\032array-section-end\n");
570 breakpoint_changed (b)
571 struct breakpoint *b;
573 breakpoints_changed ();
577 _initialize_annotate ()
579 if (annotation_level > 1)
581 delete_breakpoint_hook = breakpoint_changed;
582 modify_breakpoint_hook = breakpoint_changed;