1 /* Annotation routines for GDB. 2 Copyright (C) 1986-2024 Free Software Foundation, Inc. 3 4 This file is part of GDB. 5 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 3 of the License, or 9 (at your option) any later version. 10 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. 15 16 You should have received a copy of the GNU General Public License 17 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 18 19 #ifndef ANNOTATE_H 20 #define ANNOTATE_H 21 22 #include "symtab.h" 23 #include "gdbtypes.h" 24 25 /* Zero means do things normally; we are interacting directly with the 26 user. One means print the full filename and linenumber when a 27 frame is printed, and do so in a format emacs18/emacs19.22 can 28 parse. Two means print similar annotations, but in many more 29 cases and in a slightly different syntax. */ 30 31 extern int annotation_level; 32 33 extern void annotate_breakpoint (int); 34 extern void annotate_catchpoint (int); 35 extern void annotate_watchpoint (int); 36 extern void annotate_starting (void); 37 extern void annotate_stopped (void); 38 extern void annotate_exited (int); 39 extern void annotate_signalled (void); 40 extern void annotate_signal_name (void); 41 extern void annotate_signal_name_end (void); 42 extern void annotate_signal_string (void); 43 extern void annotate_signal_string_end (void); 44 extern void annotate_signal (void); 45 46 extern void annotate_breakpoints_headers (void); 47 extern void annotate_field (int); 48 extern void annotate_breakpoints_table (void); 49 extern void annotate_record (void); 50 extern void annotate_breakpoints_table_end (void); 51 52 extern void annotate_frames_invalid (void); 53 extern void annotate_new_thread (void); 54 extern void annotate_thread_changed (void); 55 56 extern void annotate_display_prompt (void); 57 58 struct type; 59 60 extern void annotate_field_begin (struct type *); 61 extern void annotate_field_name_end (void); 62 extern void annotate_field_value (void); 63 extern void annotate_field_end (void); 64 65 extern void annotate_quit (void); 66 extern void annotate_error (void); 67 extern void annotate_error_begin (void); 68 69 extern void annotate_value_history_begin (int, struct type *); 70 extern void annotate_value_begin (struct type *); 71 extern void annotate_value_history_value (void); 72 extern void annotate_value_history_end (void); 73 extern void annotate_value_end (void); 74 75 extern void annotate_display_begin (void); 76 extern void annotate_display_number_end (void); 77 extern void annotate_display_format (void); 78 extern void annotate_display_expression (void); 79 extern void annotate_display_expression_end (void); 80 extern void annotate_display_value (void); 81 extern void annotate_display_end (void); 82 83 extern void annotate_arg_begin (void); 84 extern void annotate_arg_name_end (void); 85 extern void annotate_arg_value (struct type *); 86 extern void annotate_arg_end (void); 87 88 /* Wrap calls to annotate_arg_begin and annotate_arg_end in an RAII 89 class. */ 90 struct annotate_arg_emitter 91 { annotate_arg_emitterannotate_arg_emitter92 annotate_arg_emitter () { annotate_arg_begin (); } ~annotate_arg_emitterannotate_arg_emitter93 ~annotate_arg_emitter () { annotate_arg_end (); } 94 95 DISABLE_COPY_AND_ASSIGN (annotate_arg_emitter); 96 }; 97 98 /* If annotations are turned on then print annotation describing the full 99 name of the source file S and the line number LINE and its corresponding 100 character position. 101 102 MID_STATEMENT is nonzero if the PC is not at the beginning of that 103 line. 104 105 The current symtab and line is updated to reflect S and LINE. 106 107 Return true if the annotation was printed and the current symtab and 108 line were updated, otherwise return false, which can happen if the 109 source file for S can't be found, or LINE is out of range. 110 111 This does leave GDB in the weird situation where, even when annotations 112 are on, we only sometimes print the annotation, and only sometimes 113 update the current symtab and line. However, this particular annotation 114 has behaved this way for some time, and front ends that still use 115 annotations now depend on this behaviour. */ 116 extern bool annotate_source_line (struct symtab *s, int line, 117 int mid_statement, CORE_ADDR pc); 118 119 extern void annotate_frame_begin (int, struct gdbarch *, CORE_ADDR); 120 extern void annotate_function_call (void); 121 extern void annotate_signal_handler_caller (void); 122 extern void annotate_frame_address (void); 123 extern void annotate_frame_address_end (void); 124 extern void annotate_frame_function_name (void); 125 extern void annotate_frame_args (void); 126 extern void annotate_frame_source_begin (void); 127 extern void annotate_frame_source_file (void); 128 extern void annotate_frame_source_file_end (void); 129 extern void annotate_frame_source_line (void); 130 extern void annotate_frame_source_end (void); 131 extern void annotate_frame_where (void); 132 extern void annotate_frame_end (void); 133 134 extern void annotate_array_section_begin (int, struct type *); 135 extern void annotate_elt_rep (unsigned int); 136 extern void annotate_elt_rep_end (void); 137 extern void annotate_elt (void); 138 extern void annotate_array_section_end (void); 139 140 extern void (*deprecated_annotate_signalled_hook) (void); 141 extern void (*deprecated_annotate_signal_hook) (void); 142 143 #endif /* ANNOTATE_H */ 144