xref: /dflybsd-src/contrib/gdb-7/gdb/annotate.c (revision a45ae5f869d9cfcb3e41dbab486e10bfa9e336bf)
15796c8dcSSimon Schubert /* Annotation routines for GDB.
2*a45ae5f8SJohn Marino    Copyright (C) 1986, 1989-1992, 1994-1996, 1998-2000, 2007-2012 Free
3*a45ae5f8SJohn Marino    Software Foundation, Inc.
45796c8dcSSimon Schubert 
55796c8dcSSimon Schubert    This file is part of GDB.
65796c8dcSSimon Schubert 
75796c8dcSSimon Schubert    This program is free software; you can redistribute it and/or modify
85796c8dcSSimon Schubert    it under the terms of the GNU General Public License as published by
95796c8dcSSimon Schubert    the Free Software Foundation; either version 3 of the License, or
105796c8dcSSimon Schubert    (at your option) any later version.
115796c8dcSSimon Schubert 
125796c8dcSSimon Schubert    This program is distributed in the hope that it will be useful,
135796c8dcSSimon Schubert    but WITHOUT ANY WARRANTY; without even the implied warranty of
145796c8dcSSimon Schubert    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
155796c8dcSSimon Schubert    GNU General Public License for more details.
165796c8dcSSimon Schubert 
175796c8dcSSimon Schubert    You should have received a copy of the GNU General Public License
185796c8dcSSimon Schubert    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
195796c8dcSSimon Schubert 
205796c8dcSSimon Schubert #include "defs.h"
215796c8dcSSimon Schubert #include "annotate.h"
225796c8dcSSimon Schubert #include "value.h"
235796c8dcSSimon Schubert #include "target.h"
245796c8dcSSimon Schubert #include "gdbtypes.h"
255796c8dcSSimon Schubert #include "breakpoint.h"
265796c8dcSSimon Schubert #include "observer.h"
275796c8dcSSimon Schubert 
285796c8dcSSimon Schubert 
295796c8dcSSimon Schubert /* Prototypes for local functions.  */
305796c8dcSSimon Schubert 
315796c8dcSSimon Schubert extern void _initialize_annotate (void);
325796c8dcSSimon Schubert 
335796c8dcSSimon Schubert static void print_value_flags (struct type *);
345796c8dcSSimon Schubert 
35*a45ae5f8SJohn Marino static void breakpoint_changed (struct breakpoint *b);
365796c8dcSSimon Schubert 
375796c8dcSSimon Schubert 
385796c8dcSSimon Schubert void (*deprecated_annotate_signalled_hook) (void);
395796c8dcSSimon Schubert void (*deprecated_annotate_signal_hook) (void);
405796c8dcSSimon Schubert 
415796c8dcSSimon Schubert static int ignore_count_changed = 0;
425796c8dcSSimon Schubert 
435796c8dcSSimon Schubert static void
445796c8dcSSimon Schubert print_value_flags (struct type *t)
455796c8dcSSimon Schubert {
465796c8dcSSimon Schubert   if (can_dereference (t))
475796c8dcSSimon Schubert     printf_filtered (("*"));
485796c8dcSSimon Schubert   else
495796c8dcSSimon Schubert     printf_filtered (("-"));
505796c8dcSSimon Schubert }
515796c8dcSSimon Schubert 
525796c8dcSSimon Schubert void
535796c8dcSSimon Schubert breakpoints_changed (void)
545796c8dcSSimon Schubert {
555796c8dcSSimon Schubert   if (annotation_level == 2)
565796c8dcSSimon Schubert     {
575796c8dcSSimon Schubert       target_terminal_ours ();
585796c8dcSSimon Schubert       printf_unfiltered (("\n\032\032breakpoints-invalid\n"));
595796c8dcSSimon Schubert       if (ignore_count_changed)
605796c8dcSSimon Schubert 	ignore_count_changed = 0;   /* Avoid multiple break annotations.  */
615796c8dcSSimon Schubert     }
625796c8dcSSimon Schubert }
635796c8dcSSimon Schubert 
645796c8dcSSimon Schubert /* The GUI needs to be informed of ignore_count changes, but we don't
655796c8dcSSimon Schubert    want to provide successive multiple breakpoints-invalid messages
665796c8dcSSimon Schubert    that are all caused by the fact that the ignore count is changing
675796c8dcSSimon Schubert    (which could keep the GUI very busy).  One is enough, after the
685796c8dcSSimon Schubert    target actually "stops".  */
695796c8dcSSimon Schubert 
705796c8dcSSimon Schubert void
715796c8dcSSimon Schubert annotate_ignore_count_change (void)
725796c8dcSSimon Schubert {
735796c8dcSSimon Schubert   if (annotation_level > 1)
745796c8dcSSimon Schubert     ignore_count_changed = 1;
755796c8dcSSimon Schubert }
765796c8dcSSimon Schubert 
775796c8dcSSimon Schubert void
785796c8dcSSimon Schubert annotate_breakpoint (int num)
795796c8dcSSimon Schubert {
805796c8dcSSimon Schubert   if (annotation_level > 1)
815796c8dcSSimon Schubert     printf_filtered (("\n\032\032breakpoint %d\n"), num);
825796c8dcSSimon Schubert }
835796c8dcSSimon Schubert 
845796c8dcSSimon Schubert void
855796c8dcSSimon Schubert annotate_catchpoint (int num)
865796c8dcSSimon Schubert {
875796c8dcSSimon Schubert   if (annotation_level > 1)
885796c8dcSSimon Schubert     printf_filtered (("\n\032\032catchpoint %d\n"), num);
895796c8dcSSimon Schubert }
905796c8dcSSimon Schubert 
915796c8dcSSimon Schubert void
925796c8dcSSimon Schubert annotate_watchpoint (int num)
935796c8dcSSimon Schubert {
945796c8dcSSimon Schubert   if (annotation_level > 1)
955796c8dcSSimon Schubert     printf_filtered (("\n\032\032watchpoint %d\n"), num);
965796c8dcSSimon Schubert }
975796c8dcSSimon Schubert 
985796c8dcSSimon Schubert void
995796c8dcSSimon Schubert annotate_starting (void)
1005796c8dcSSimon Schubert {
1015796c8dcSSimon Schubert   if (annotation_level > 1)
1025796c8dcSSimon Schubert     printf_filtered (("\n\032\032starting\n"));
1035796c8dcSSimon Schubert }
1045796c8dcSSimon Schubert 
1055796c8dcSSimon Schubert void
1065796c8dcSSimon Schubert annotate_stopped (void)
1075796c8dcSSimon Schubert {
1085796c8dcSSimon Schubert   if (annotation_level > 1)
1095796c8dcSSimon Schubert     printf_filtered (("\n\032\032stopped\n"));
1105796c8dcSSimon Schubert   if (annotation_level > 1 && ignore_count_changed)
1115796c8dcSSimon Schubert     {
1125796c8dcSSimon Schubert       ignore_count_changed = 0;
1135796c8dcSSimon Schubert       breakpoints_changed ();
1145796c8dcSSimon Schubert     }
1155796c8dcSSimon Schubert }
1165796c8dcSSimon Schubert 
1175796c8dcSSimon Schubert void
1185796c8dcSSimon Schubert annotate_exited (int exitstatus)
1195796c8dcSSimon Schubert {
1205796c8dcSSimon Schubert   if (annotation_level > 1)
1215796c8dcSSimon Schubert     printf_filtered (("\n\032\032exited %d\n"), exitstatus);
1225796c8dcSSimon Schubert }
1235796c8dcSSimon Schubert 
1245796c8dcSSimon Schubert void
1255796c8dcSSimon Schubert annotate_signalled (void)
1265796c8dcSSimon Schubert {
1275796c8dcSSimon Schubert   if (deprecated_annotate_signalled_hook)
1285796c8dcSSimon Schubert     deprecated_annotate_signalled_hook ();
1295796c8dcSSimon Schubert 
1305796c8dcSSimon Schubert   if (annotation_level > 1)
1315796c8dcSSimon Schubert     printf_filtered (("\n\032\032signalled\n"));
1325796c8dcSSimon Schubert }
1335796c8dcSSimon Schubert 
1345796c8dcSSimon Schubert void
1355796c8dcSSimon Schubert annotate_signal_name (void)
1365796c8dcSSimon Schubert {
1375796c8dcSSimon Schubert   if (annotation_level == 2)
1385796c8dcSSimon Schubert     printf_filtered (("\n\032\032signal-name\n"));
1395796c8dcSSimon Schubert }
1405796c8dcSSimon Schubert 
1415796c8dcSSimon Schubert void
1425796c8dcSSimon Schubert annotate_signal_name_end (void)
1435796c8dcSSimon Schubert {
1445796c8dcSSimon Schubert   if (annotation_level == 2)
1455796c8dcSSimon Schubert     printf_filtered (("\n\032\032signal-name-end\n"));
1465796c8dcSSimon Schubert }
1475796c8dcSSimon Schubert 
1485796c8dcSSimon Schubert void
1495796c8dcSSimon Schubert annotate_signal_string (void)
1505796c8dcSSimon Schubert {
1515796c8dcSSimon Schubert   if (annotation_level == 2)
1525796c8dcSSimon Schubert     printf_filtered (("\n\032\032signal-string\n"));
1535796c8dcSSimon Schubert }
1545796c8dcSSimon Schubert 
1555796c8dcSSimon Schubert void
1565796c8dcSSimon Schubert annotate_signal_string_end (void)
1575796c8dcSSimon Schubert {
1585796c8dcSSimon Schubert   if (annotation_level == 2)
1595796c8dcSSimon Schubert     printf_filtered (("\n\032\032signal-string-end\n"));
1605796c8dcSSimon Schubert }
1615796c8dcSSimon Schubert 
1625796c8dcSSimon Schubert void
1635796c8dcSSimon Schubert annotate_signal (void)
1645796c8dcSSimon Schubert {
1655796c8dcSSimon Schubert   if (deprecated_annotate_signal_hook)
1665796c8dcSSimon Schubert     deprecated_annotate_signal_hook ();
1675796c8dcSSimon Schubert 
1685796c8dcSSimon Schubert   if (annotation_level > 1)
1695796c8dcSSimon Schubert     printf_filtered (("\n\032\032signal\n"));
1705796c8dcSSimon Schubert }
1715796c8dcSSimon Schubert 
1725796c8dcSSimon Schubert void
1735796c8dcSSimon Schubert annotate_breakpoints_headers (void)
1745796c8dcSSimon Schubert {
1755796c8dcSSimon Schubert   if (annotation_level == 2)
1765796c8dcSSimon Schubert     printf_filtered (("\n\032\032breakpoints-headers\n"));
1775796c8dcSSimon Schubert }
1785796c8dcSSimon Schubert 
1795796c8dcSSimon Schubert void
1805796c8dcSSimon Schubert annotate_field (int num)
1815796c8dcSSimon Schubert {
1825796c8dcSSimon Schubert   if (annotation_level == 2)
1835796c8dcSSimon Schubert     printf_filtered (("\n\032\032field %d\n"), num);
1845796c8dcSSimon Schubert }
1855796c8dcSSimon Schubert 
1865796c8dcSSimon Schubert void
1875796c8dcSSimon Schubert annotate_breakpoints_table (void)
1885796c8dcSSimon Schubert {
1895796c8dcSSimon Schubert   if (annotation_level == 2)
1905796c8dcSSimon Schubert     printf_filtered (("\n\032\032breakpoints-table\n"));
1915796c8dcSSimon Schubert }
1925796c8dcSSimon Schubert 
1935796c8dcSSimon Schubert void
1945796c8dcSSimon Schubert annotate_record (void)
1955796c8dcSSimon Schubert {
1965796c8dcSSimon Schubert   if (annotation_level == 2)
1975796c8dcSSimon Schubert     printf_filtered (("\n\032\032record\n"));
1985796c8dcSSimon Schubert }
1995796c8dcSSimon Schubert 
2005796c8dcSSimon Schubert void
2015796c8dcSSimon Schubert annotate_breakpoints_table_end (void)
2025796c8dcSSimon Schubert {
2035796c8dcSSimon Schubert   if (annotation_level == 2)
2045796c8dcSSimon Schubert     printf_filtered (("\n\032\032breakpoints-table-end\n"));
2055796c8dcSSimon Schubert }
2065796c8dcSSimon Schubert 
2075796c8dcSSimon Schubert void
2085796c8dcSSimon Schubert annotate_frames_invalid (void)
2095796c8dcSSimon Schubert {
2105796c8dcSSimon Schubert   if (annotation_level == 2)
2115796c8dcSSimon Schubert     {
2125796c8dcSSimon Schubert       target_terminal_ours ();
2135796c8dcSSimon Schubert       printf_unfiltered (("\n\032\032frames-invalid\n"));
2145796c8dcSSimon Schubert     }
2155796c8dcSSimon Schubert }
2165796c8dcSSimon Schubert 
2175796c8dcSSimon Schubert void
2185796c8dcSSimon Schubert annotate_new_thread (void)
2195796c8dcSSimon Schubert {
2205796c8dcSSimon Schubert   if (annotation_level > 1)
2215796c8dcSSimon Schubert     {
2225796c8dcSSimon Schubert       printf_unfiltered (("\n\032\032new-thread\n"));
2235796c8dcSSimon Schubert     }
2245796c8dcSSimon Schubert }
2255796c8dcSSimon Schubert 
2265796c8dcSSimon Schubert void
2275796c8dcSSimon Schubert annotate_thread_changed (void)
2285796c8dcSSimon Schubert {
2295796c8dcSSimon Schubert   if (annotation_level > 1)
2305796c8dcSSimon Schubert     {
2315796c8dcSSimon Schubert       printf_unfiltered (("\n\032\032thread-changed\n"));
2325796c8dcSSimon Schubert     }
2335796c8dcSSimon Schubert }
2345796c8dcSSimon Schubert 
2355796c8dcSSimon Schubert void
2365796c8dcSSimon Schubert annotate_field_begin (struct type *type)
2375796c8dcSSimon Schubert {
2385796c8dcSSimon Schubert   if (annotation_level == 2)
2395796c8dcSSimon Schubert     {
2405796c8dcSSimon Schubert       printf_filtered (("\n\032\032field-begin "));
2415796c8dcSSimon Schubert       print_value_flags (type);
2425796c8dcSSimon Schubert       printf_filtered (("\n"));
2435796c8dcSSimon Schubert     }
2445796c8dcSSimon Schubert }
2455796c8dcSSimon Schubert 
2465796c8dcSSimon Schubert void
2475796c8dcSSimon Schubert annotate_field_name_end (void)
2485796c8dcSSimon Schubert {
2495796c8dcSSimon Schubert   if (annotation_level == 2)
2505796c8dcSSimon Schubert     printf_filtered (("\n\032\032field-name-end\n"));
2515796c8dcSSimon Schubert }
2525796c8dcSSimon Schubert 
2535796c8dcSSimon Schubert void
2545796c8dcSSimon Schubert annotate_field_value (void)
2555796c8dcSSimon Schubert {
2565796c8dcSSimon Schubert   if (annotation_level == 2)
2575796c8dcSSimon Schubert     printf_filtered (("\n\032\032field-value\n"));
2585796c8dcSSimon Schubert }
2595796c8dcSSimon Schubert 
2605796c8dcSSimon Schubert void
2615796c8dcSSimon Schubert annotate_field_end (void)
2625796c8dcSSimon Schubert {
2635796c8dcSSimon Schubert   if (annotation_level == 2)
2645796c8dcSSimon Schubert     printf_filtered (("\n\032\032field-end\n"));
2655796c8dcSSimon Schubert }
2665796c8dcSSimon Schubert 
2675796c8dcSSimon Schubert void
2685796c8dcSSimon Schubert annotate_quit (void)
2695796c8dcSSimon Schubert {
2705796c8dcSSimon Schubert   if (annotation_level > 1)
2715796c8dcSSimon Schubert     printf_filtered (("\n\032\032quit\n"));
2725796c8dcSSimon Schubert }
2735796c8dcSSimon Schubert 
2745796c8dcSSimon Schubert void
2755796c8dcSSimon Schubert annotate_error (void)
2765796c8dcSSimon Schubert {
2775796c8dcSSimon Schubert   if (annotation_level > 1)
2785796c8dcSSimon Schubert     printf_filtered (("\n\032\032error\n"));
2795796c8dcSSimon Schubert }
2805796c8dcSSimon Schubert 
2815796c8dcSSimon Schubert void
2825796c8dcSSimon Schubert annotate_error_begin (void)
2835796c8dcSSimon Schubert {
2845796c8dcSSimon Schubert   if (annotation_level > 1)
2855796c8dcSSimon Schubert     fprintf_filtered (gdb_stderr, "\n\032\032error-begin\n");
2865796c8dcSSimon Schubert }
2875796c8dcSSimon Schubert 
2885796c8dcSSimon Schubert void
2895796c8dcSSimon Schubert annotate_value_history_begin (int histindex, struct type *type)
2905796c8dcSSimon Schubert {
2915796c8dcSSimon Schubert   if (annotation_level == 2)
2925796c8dcSSimon Schubert     {
2935796c8dcSSimon Schubert       printf_filtered (("\n\032\032value-history-begin %d "), histindex);
2945796c8dcSSimon Schubert       print_value_flags (type);
2955796c8dcSSimon Schubert       printf_filtered (("\n"));
2965796c8dcSSimon Schubert     }
2975796c8dcSSimon Schubert }
2985796c8dcSSimon Schubert 
2995796c8dcSSimon Schubert void
3005796c8dcSSimon Schubert annotate_value_begin (struct type *type)
3015796c8dcSSimon Schubert {
3025796c8dcSSimon Schubert   if (annotation_level == 2)
3035796c8dcSSimon Schubert     {
3045796c8dcSSimon Schubert       printf_filtered (("\n\032\032value-begin "));
3055796c8dcSSimon Schubert       print_value_flags (type);
3065796c8dcSSimon Schubert       printf_filtered (("\n"));
3075796c8dcSSimon Schubert     }
3085796c8dcSSimon Schubert }
3095796c8dcSSimon Schubert 
3105796c8dcSSimon Schubert void
3115796c8dcSSimon Schubert annotate_value_history_value (void)
3125796c8dcSSimon Schubert {
3135796c8dcSSimon Schubert   if (annotation_level == 2)
3145796c8dcSSimon Schubert     printf_filtered (("\n\032\032value-history-value\n"));
3155796c8dcSSimon Schubert }
3165796c8dcSSimon Schubert 
3175796c8dcSSimon Schubert void
3185796c8dcSSimon Schubert annotate_value_history_end (void)
3195796c8dcSSimon Schubert {
3205796c8dcSSimon Schubert   if (annotation_level == 2)
3215796c8dcSSimon Schubert     printf_filtered (("\n\032\032value-history-end\n"));
3225796c8dcSSimon Schubert }
3235796c8dcSSimon Schubert 
3245796c8dcSSimon Schubert void
3255796c8dcSSimon Schubert annotate_value_end (void)
3265796c8dcSSimon Schubert {
3275796c8dcSSimon Schubert   if (annotation_level == 2)
3285796c8dcSSimon Schubert     printf_filtered (("\n\032\032value-end\n"));
3295796c8dcSSimon Schubert }
3305796c8dcSSimon Schubert 
3315796c8dcSSimon Schubert void
3325796c8dcSSimon Schubert annotate_display_begin (void)
3335796c8dcSSimon Schubert {
3345796c8dcSSimon Schubert   if (annotation_level == 2)
3355796c8dcSSimon Schubert     printf_filtered (("\n\032\032display-begin\n"));
3365796c8dcSSimon Schubert }
3375796c8dcSSimon Schubert 
3385796c8dcSSimon Schubert void
3395796c8dcSSimon Schubert annotate_display_number_end (void)
3405796c8dcSSimon Schubert {
3415796c8dcSSimon Schubert   if (annotation_level == 2)
3425796c8dcSSimon Schubert     printf_filtered (("\n\032\032display-number-end\n"));
3435796c8dcSSimon Schubert }
3445796c8dcSSimon Schubert 
3455796c8dcSSimon Schubert void
3465796c8dcSSimon Schubert annotate_display_format (void)
3475796c8dcSSimon Schubert {
3485796c8dcSSimon Schubert   if (annotation_level == 2)
3495796c8dcSSimon Schubert     printf_filtered (("\n\032\032display-format\n"));
3505796c8dcSSimon Schubert }
3515796c8dcSSimon Schubert 
3525796c8dcSSimon Schubert void
3535796c8dcSSimon Schubert annotate_display_expression (void)
3545796c8dcSSimon Schubert {
3555796c8dcSSimon Schubert   if (annotation_level == 2)
3565796c8dcSSimon Schubert     printf_filtered (("\n\032\032display-expression\n"));
3575796c8dcSSimon Schubert }
3585796c8dcSSimon Schubert 
3595796c8dcSSimon Schubert void
3605796c8dcSSimon Schubert annotate_display_expression_end (void)
3615796c8dcSSimon Schubert {
3625796c8dcSSimon Schubert   if (annotation_level == 2)
3635796c8dcSSimon Schubert     printf_filtered (("\n\032\032display-expression-end\n"));
3645796c8dcSSimon Schubert }
3655796c8dcSSimon Schubert 
3665796c8dcSSimon Schubert void
3675796c8dcSSimon Schubert annotate_display_value (void)
3685796c8dcSSimon Schubert {
3695796c8dcSSimon Schubert   if (annotation_level == 2)
3705796c8dcSSimon Schubert     printf_filtered (("\n\032\032display-value\n"));
3715796c8dcSSimon Schubert }
3725796c8dcSSimon Schubert 
3735796c8dcSSimon Schubert void
3745796c8dcSSimon Schubert annotate_display_end (void)
3755796c8dcSSimon Schubert {
3765796c8dcSSimon Schubert   if (annotation_level == 2)
3775796c8dcSSimon Schubert     printf_filtered (("\n\032\032display-end\n"));
3785796c8dcSSimon Schubert }
3795796c8dcSSimon Schubert 
3805796c8dcSSimon Schubert void
3815796c8dcSSimon Schubert annotate_arg_begin (void)
3825796c8dcSSimon Schubert {
3835796c8dcSSimon Schubert   if (annotation_level == 2)
3845796c8dcSSimon Schubert     printf_filtered (("\n\032\032arg-begin\n"));
3855796c8dcSSimon Schubert }
3865796c8dcSSimon Schubert 
3875796c8dcSSimon Schubert void
3885796c8dcSSimon Schubert annotate_arg_name_end (void)
3895796c8dcSSimon Schubert {
3905796c8dcSSimon Schubert   if (annotation_level == 2)
3915796c8dcSSimon Schubert     printf_filtered (("\n\032\032arg-name-end\n"));
3925796c8dcSSimon Schubert }
3935796c8dcSSimon Schubert 
3945796c8dcSSimon Schubert void
3955796c8dcSSimon Schubert annotate_arg_value (struct type *type)
3965796c8dcSSimon Schubert {
3975796c8dcSSimon Schubert   if (annotation_level == 2)
3985796c8dcSSimon Schubert     {
3995796c8dcSSimon Schubert       printf_filtered (("\n\032\032arg-value "));
4005796c8dcSSimon Schubert       print_value_flags (type);
4015796c8dcSSimon Schubert       printf_filtered (("\n"));
4025796c8dcSSimon Schubert     }
4035796c8dcSSimon Schubert }
4045796c8dcSSimon Schubert 
4055796c8dcSSimon Schubert void
4065796c8dcSSimon Schubert annotate_arg_end (void)
4075796c8dcSSimon Schubert {
4085796c8dcSSimon Schubert   if (annotation_level == 2)
4095796c8dcSSimon Schubert     printf_filtered (("\n\032\032arg-end\n"));
4105796c8dcSSimon Schubert }
4115796c8dcSSimon Schubert 
4125796c8dcSSimon Schubert void
4135796c8dcSSimon Schubert annotate_source (char *filename, int line, int character, int mid,
4145796c8dcSSimon Schubert 		 struct gdbarch *gdbarch, CORE_ADDR pc)
4155796c8dcSSimon Schubert {
4165796c8dcSSimon Schubert   if (annotation_level > 1)
4175796c8dcSSimon Schubert     printf_filtered (("\n\032\032source "));
4185796c8dcSSimon Schubert   else
4195796c8dcSSimon Schubert     printf_filtered (("\032\032"));
4205796c8dcSSimon Schubert 
4215796c8dcSSimon Schubert   printf_filtered (("%s:%d:%d:%s:%s\n"), filename, line, character,
4225796c8dcSSimon Schubert 		   mid ? "middle" : "beg", paddress (gdbarch, pc));
4235796c8dcSSimon Schubert }
4245796c8dcSSimon Schubert 
4255796c8dcSSimon Schubert void
4265796c8dcSSimon Schubert annotate_frame_begin (int level, struct gdbarch *gdbarch, CORE_ADDR pc)
4275796c8dcSSimon Schubert {
4285796c8dcSSimon Schubert   if (annotation_level > 1)
4295796c8dcSSimon Schubert     printf_filtered (("\n\032\032frame-begin %d %s\n"),
4305796c8dcSSimon Schubert 		     level, paddress (gdbarch, pc));
4315796c8dcSSimon Schubert }
4325796c8dcSSimon Schubert 
4335796c8dcSSimon Schubert void
4345796c8dcSSimon Schubert annotate_function_call (void)
4355796c8dcSSimon Schubert {
4365796c8dcSSimon Schubert   if (annotation_level == 2)
4375796c8dcSSimon Schubert     printf_filtered (("\n\032\032function-call\n"));
4385796c8dcSSimon Schubert }
4395796c8dcSSimon Schubert 
4405796c8dcSSimon Schubert void
4415796c8dcSSimon Schubert annotate_signal_handler_caller (void)
4425796c8dcSSimon Schubert {
4435796c8dcSSimon Schubert   if (annotation_level == 2)
4445796c8dcSSimon Schubert     printf_filtered (("\n\032\032signal-handler-caller\n"));
4455796c8dcSSimon Schubert }
4465796c8dcSSimon Schubert 
4475796c8dcSSimon Schubert void
4485796c8dcSSimon Schubert annotate_frame_address (void)
4495796c8dcSSimon Schubert {
4505796c8dcSSimon Schubert   if (annotation_level == 2)
4515796c8dcSSimon Schubert     printf_filtered (("\n\032\032frame-address\n"));
4525796c8dcSSimon Schubert }
4535796c8dcSSimon Schubert 
4545796c8dcSSimon Schubert void
4555796c8dcSSimon Schubert annotate_frame_address_end (void)
4565796c8dcSSimon Schubert {
4575796c8dcSSimon Schubert   if (annotation_level == 2)
4585796c8dcSSimon Schubert     printf_filtered (("\n\032\032frame-address-end\n"));
4595796c8dcSSimon Schubert }
4605796c8dcSSimon Schubert 
4615796c8dcSSimon Schubert void
4625796c8dcSSimon Schubert annotate_frame_function_name (void)
4635796c8dcSSimon Schubert {
4645796c8dcSSimon Schubert   if (annotation_level == 2)
4655796c8dcSSimon Schubert     printf_filtered (("\n\032\032frame-function-name\n"));
4665796c8dcSSimon Schubert }
4675796c8dcSSimon Schubert 
4685796c8dcSSimon Schubert void
4695796c8dcSSimon Schubert annotate_frame_args (void)
4705796c8dcSSimon Schubert {
4715796c8dcSSimon Schubert   if (annotation_level == 2)
4725796c8dcSSimon Schubert     printf_filtered (("\n\032\032frame-args\n"));
4735796c8dcSSimon Schubert }
4745796c8dcSSimon Schubert 
4755796c8dcSSimon Schubert void
4765796c8dcSSimon Schubert annotate_frame_source_begin (void)
4775796c8dcSSimon Schubert {
4785796c8dcSSimon Schubert   if (annotation_level == 2)
4795796c8dcSSimon Schubert     printf_filtered (("\n\032\032frame-source-begin\n"));
4805796c8dcSSimon Schubert }
4815796c8dcSSimon Schubert 
4825796c8dcSSimon Schubert void
4835796c8dcSSimon Schubert annotate_frame_source_file (void)
4845796c8dcSSimon Schubert {
4855796c8dcSSimon Schubert   if (annotation_level == 2)
4865796c8dcSSimon Schubert     printf_filtered (("\n\032\032frame-source-file\n"));
4875796c8dcSSimon Schubert }
4885796c8dcSSimon Schubert 
4895796c8dcSSimon Schubert void
4905796c8dcSSimon Schubert annotate_frame_source_file_end (void)
4915796c8dcSSimon Schubert {
4925796c8dcSSimon Schubert   if (annotation_level == 2)
4935796c8dcSSimon Schubert     printf_filtered (("\n\032\032frame-source-file-end\n"));
4945796c8dcSSimon Schubert }
4955796c8dcSSimon Schubert 
4965796c8dcSSimon Schubert void
4975796c8dcSSimon Schubert annotate_frame_source_line (void)
4985796c8dcSSimon Schubert {
4995796c8dcSSimon Schubert   if (annotation_level == 2)
5005796c8dcSSimon Schubert     printf_filtered (("\n\032\032frame-source-line\n"));
5015796c8dcSSimon Schubert }
5025796c8dcSSimon Schubert 
5035796c8dcSSimon Schubert void
5045796c8dcSSimon Schubert annotate_frame_source_end (void)
5055796c8dcSSimon Schubert {
5065796c8dcSSimon Schubert   if (annotation_level == 2)
5075796c8dcSSimon Schubert     printf_filtered (("\n\032\032frame-source-end\n"));
5085796c8dcSSimon Schubert }
5095796c8dcSSimon Schubert 
5105796c8dcSSimon Schubert void
5115796c8dcSSimon Schubert annotate_frame_where (void)
5125796c8dcSSimon Schubert {
5135796c8dcSSimon Schubert   if (annotation_level == 2)
5145796c8dcSSimon Schubert     printf_filtered (("\n\032\032frame-where\n"));
5155796c8dcSSimon Schubert }
5165796c8dcSSimon Schubert 
5175796c8dcSSimon Schubert void
5185796c8dcSSimon Schubert annotate_frame_end (void)
5195796c8dcSSimon Schubert {
5205796c8dcSSimon Schubert   if (annotation_level == 2)
5215796c8dcSSimon Schubert     printf_filtered (("\n\032\032frame-end\n"));
5225796c8dcSSimon Schubert }
5235796c8dcSSimon Schubert 
5245796c8dcSSimon Schubert void
525*a45ae5f8SJohn Marino annotate_array_section_begin (int idx, struct type *elttype)
5265796c8dcSSimon Schubert {
5275796c8dcSSimon Schubert   if (annotation_level == 2)
5285796c8dcSSimon Schubert     {
529*a45ae5f8SJohn Marino       printf_filtered (("\n\032\032array-section-begin %d "), idx);
5305796c8dcSSimon Schubert       print_value_flags (elttype);
5315796c8dcSSimon Schubert       printf_filtered (("\n"));
5325796c8dcSSimon Schubert     }
5335796c8dcSSimon Schubert }
5345796c8dcSSimon Schubert 
5355796c8dcSSimon Schubert void
5365796c8dcSSimon Schubert annotate_elt_rep (unsigned int repcount)
5375796c8dcSSimon Schubert {
5385796c8dcSSimon Schubert   if (annotation_level == 2)
5395796c8dcSSimon Schubert     printf_filtered (("\n\032\032elt-rep %u\n"), repcount);
5405796c8dcSSimon Schubert }
5415796c8dcSSimon Schubert 
5425796c8dcSSimon Schubert void
5435796c8dcSSimon Schubert annotate_elt_rep_end (void)
5445796c8dcSSimon Schubert {
5455796c8dcSSimon Schubert   if (annotation_level == 2)
5465796c8dcSSimon Schubert     printf_filtered (("\n\032\032elt-rep-end\n"));
5475796c8dcSSimon Schubert }
5485796c8dcSSimon Schubert 
5495796c8dcSSimon Schubert void
5505796c8dcSSimon Schubert annotate_elt (void)
5515796c8dcSSimon Schubert {
5525796c8dcSSimon Schubert   if (annotation_level == 2)
5535796c8dcSSimon Schubert     printf_filtered (("\n\032\032elt\n"));
5545796c8dcSSimon Schubert }
5555796c8dcSSimon Schubert 
5565796c8dcSSimon Schubert void
5575796c8dcSSimon Schubert annotate_array_section_end (void)
5585796c8dcSSimon Schubert {
5595796c8dcSSimon Schubert   if (annotation_level == 2)
5605796c8dcSSimon Schubert     printf_filtered (("\n\032\032array-section-end\n"));
5615796c8dcSSimon Schubert }
5625796c8dcSSimon Schubert 
5635796c8dcSSimon Schubert static void
564*a45ae5f8SJohn Marino breakpoint_changed (struct breakpoint *b)
5655796c8dcSSimon Schubert {
5665796c8dcSSimon Schubert   breakpoints_changed ();
5675796c8dcSSimon Schubert }
5685796c8dcSSimon Schubert 
5695796c8dcSSimon Schubert void
5705796c8dcSSimon Schubert _initialize_annotate (void)
5715796c8dcSSimon Schubert {
5725796c8dcSSimon Schubert   if (annotation_level == 2)
5735796c8dcSSimon Schubert     {
5745796c8dcSSimon Schubert       observer_attach_breakpoint_deleted (breakpoint_changed);
5755796c8dcSSimon Schubert       observer_attach_breakpoint_modified (breakpoint_changed);
5765796c8dcSSimon Schubert     }
5775796c8dcSSimon Schubert }
578