1 /* Annotation routines for GDB.
2 Copyright 1986, 89, 90, 91, 92, 95, 1998 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_exited_hook
) PARAMS ((void));
43 if (can_dereference (t
))
44 printf_filtered ("*");
46 printf_filtered ("-");
50 breakpoints_changed ()
52 if (annotation_level
> 1)
54 target_terminal_ours ();
55 printf_unfiltered ("\n\032\032breakpoints-invalid\n");
60 annotate_breakpoint (num
)
63 if (annotation_level
> 1)
64 printf_filtered ("\n\032\032breakpoint %d\n", num
);
68 annotate_watchpoint (num
)
71 if (annotation_level
> 1)
72 printf_filtered ("\n\032\032watchpoint %d\n", num
);
79 if (annotate_starting_hook
)
80 annotate_starting_hook ();
83 if (annotation_level
> 1)
85 printf_filtered ("\n\032\032starting\n");
93 if (annotate_stopped_hook
)
94 annotate_stopped_hook ();
97 if (annotation_level
> 1)
98 printf_filtered ("\n\032\032stopped\n");
103 annotate_exited (exitstatus
)
106 if (annotate_exited_hook
)
107 annotate_exited_hook ();
110 if (annotation_level
> 1)
111 printf_filtered ("\n\032\032exited %d\n", exitstatus
);
116 annotate_signalled ()
118 if (annotate_signalled_hook
)
119 annotate_signalled_hook ();
121 if (annotation_level
> 1)
122 printf_filtered ("\n\032\032signalled\n");
126 annotate_signal_name ()
128 if (annotation_level
> 1)
129 printf_filtered ("\n\032\032signal-name\n");
133 annotate_signal_name_end ()
135 if (annotation_level
> 1)
136 printf_filtered ("\n\032\032signal-name-end\n");
140 annotate_signal_string ()
142 if (annotation_level
> 1)
143 printf_filtered ("\n\032\032signal-string\n");
147 annotate_signal_string_end ()
149 if (annotation_level
> 1)
150 printf_filtered ("\n\032\032signal-string-end\n");
156 if (annotation_level
> 1)
157 printf_filtered ("\n\032\032signal\n");
161 annotate_breakpoints_headers ()
163 if (annotation_level
> 1)
164 printf_filtered ("\n\032\032breakpoints-headers\n");
171 if (annotation_level
> 1)
172 printf_filtered ("\n\032\032field %d\n", num
);
176 annotate_breakpoints_table ()
178 if (annotation_level
> 1)
179 printf_filtered ("\n\032\032breakpoints-table\n");
185 if (annotation_level
> 1)
186 printf_filtered ("\n\032\032record\n");
190 annotate_breakpoints_table_end ()
192 if (annotation_level
> 1)
193 printf_filtered ("\n\032\032breakpoints-table-end\n");
197 annotate_frames_invalid ()
199 if (annotation_level
> 1)
201 target_terminal_ours ();
202 printf_unfiltered ("\n\032\032frames-invalid\n");
207 annotate_field_begin (type
)
210 if (annotation_level
> 1)
212 printf_filtered ("\n\032\032field-begin ");
213 print_value_flags (type
);
214 printf_filtered ("\n");
219 annotate_field_name_end ()
221 if (annotation_level
> 1)
222 printf_filtered ("\n\032\032field-name-end\n");
226 annotate_field_value ()
228 if (annotation_level
> 1)
229 printf_filtered ("\n\032\032field-value\n");
233 annotate_field_end ()
235 if (annotation_level
> 1)
236 printf_filtered ("\n\032\032field-end\n");
242 if (annotation_level
> 1)
243 printf_filtered ("\n\032\032quit\n");
249 if (annotation_level
> 1)
250 printf_filtered ("\n\032\032error\n");
254 annotate_error_begin ()
256 if (annotation_level
> 1)
257 fprintf_filtered (gdb_stderr
, "\n\032\032error-begin\n");
261 annotate_value_history_begin (histindex
, type
)
265 if (annotation_level
> 1)
267 printf_filtered ("\n\032\032value-history-begin %d ", histindex
);
268 print_value_flags (type
);
269 printf_filtered ("\n");
274 annotate_value_begin (type
)
277 if (annotation_level
> 1)
279 printf_filtered ("\n\032\032value-begin ");
280 print_value_flags (type
);
281 printf_filtered ("\n");
286 annotate_value_history_value ()
288 if (annotation_level
> 1)
289 printf_filtered ("\n\032\032value-history-value\n");
293 annotate_value_history_end ()
295 if (annotation_level
> 1)
296 printf_filtered ("\n\032\032value-history-end\n");
300 annotate_value_end ()
302 if (annotation_level
> 1)
303 printf_filtered ("\n\032\032value-end\n");
307 annotate_display_begin ()
309 if (annotation_level
> 1)
310 printf_filtered ("\n\032\032display-begin\n");
314 annotate_display_number_end ()
316 if (annotation_level
> 1)
317 printf_filtered ("\n\032\032display-number-end\n");
321 annotate_display_format ()
323 if (annotation_level
> 1)
324 printf_filtered ("\n\032\032display-format\n");
328 annotate_display_expression ()
330 if (annotation_level
> 1)
331 printf_filtered ("\n\032\032display-expression\n");
335 annotate_display_expression_end ()
337 if (annotation_level
> 1)
338 printf_filtered ("\n\032\032display-expression-end\n");
342 annotate_display_value ()
344 if (annotation_level
> 1)
345 printf_filtered ("\n\032\032display-value\n");
349 annotate_display_end ()
351 if (annotation_level
> 1)
352 printf_filtered ("\n\032\032display-end\n");
356 annotate_arg_begin ()
358 if (annotation_level
> 1)
359 printf_filtered ("\n\032\032arg-begin\n");
363 annotate_arg_name_end ()
365 if (annotation_level
> 1)
366 printf_filtered ("\n\032\032arg-name-end\n");
370 annotate_arg_value (type
)
373 if (annotation_level
> 1)
375 printf_filtered ("\n\032\032arg-value ");
376 print_value_flags (type
);
377 printf_filtered ("\n");
384 if (annotation_level
> 1)
385 printf_filtered ("\n\032\032arg-end\n");
389 annotate_source (filename
, line
, character
, mid
, pc
)
396 if (annotation_level
> 1)
397 printf_filtered ("\n\032\032source ");
399 printf_filtered ("\032\032");
401 printf_filtered ("%s:%d:%d:%s:0x", filename
,
403 mid
? "middle" : "beg");
404 print_address_numeric (pc
, 0, gdb_stdout
);
405 printf_filtered ("\n");
409 annotate_frame_begin (level
, pc
)
413 if (annotation_level
> 1)
415 printf_filtered ("\n\032\032frame-begin %d 0x", level
);
416 print_address_numeric (pc
, 0, gdb_stdout
);
417 printf_filtered ("\n");
422 annotate_function_call ()
424 if (annotation_level
> 1)
425 printf_filtered ("\n\032\032function-call\n");
429 annotate_signal_handler_caller ()
431 if (annotation_level
> 1)
432 printf_filtered ("\n\032\032signal-handler-caller\n");
436 annotate_frame_address ()
438 if (annotation_level
> 1)
439 printf_filtered ("\n\032\032frame-address\n");
443 annotate_frame_address_end ()
445 if (annotation_level
> 1)
446 printf_filtered ("\n\032\032frame-address-end\n");
450 annotate_frame_function_name ()
452 if (annotation_level
> 1)
453 printf_filtered ("\n\032\032frame-function-name\n");
457 annotate_frame_args ()
459 if (annotation_level
> 1)
460 printf_filtered ("\n\032\032frame-args\n");
464 annotate_frame_source_begin ()
466 if (annotation_level
> 1)
467 printf_filtered ("\n\032\032frame-source-begin\n");
471 annotate_frame_source_file ()
473 if (annotation_level
> 1)
474 printf_filtered ("\n\032\032frame-source-file\n");
478 annotate_frame_source_file_end ()
480 if (annotation_level
> 1)
481 printf_filtered ("\n\032\032frame-source-file-end\n");
485 annotate_frame_source_line ()
487 if (annotation_level
> 1)
488 printf_filtered ("\n\032\032frame-source-line\n");
492 annotate_frame_source_end ()
494 if (annotation_level
> 1)
495 printf_filtered ("\n\032\032frame-source-end\n");
499 annotate_frame_where ()
501 if (annotation_level
> 1)
502 printf_filtered ("\n\032\032frame-where\n");
506 annotate_frame_end ()
508 if (annotation_level
> 1)
509 printf_filtered ("\n\032\032frame-end\n");
513 annotate_array_section_begin (index
, elttype
)
515 struct type
*elttype
;
517 if (annotation_level
> 1)
519 printf_filtered ("\n\032\032array-section-begin %d ", index
);
520 print_value_flags (elttype
);
521 printf_filtered ("\n");
526 annotate_elt_rep (repcount
)
527 unsigned int repcount
;
529 if (annotation_level
> 1)
530 printf_filtered ("\n\032\032elt-rep %u\n", repcount
);
534 annotate_elt_rep_end ()
536 if (annotation_level
> 1)
537 printf_filtered ("\n\032\032elt-rep-end\n");
543 if (annotation_level
> 1)
544 printf_filtered ("\n\032\032elt\n");
548 annotate_array_section_end ()
550 if (annotation_level
> 1)
551 printf_filtered ("\n\032\032array-section-end\n");
555 breakpoint_changed (b
)
556 struct breakpoint
*b
;
558 breakpoints_changed ();
562 _initialize_annotate ()
564 if (annotation_level
> 1)
566 delete_breakpoint_hook
= breakpoint_changed
;
567 modify_breakpoint_hook
= breakpoint_changed
;
This page took 0.047147 seconds and 4 git commands to generate.