Commit | Line | Data |
---|---|---|
c906108c | 1 | /* Annotation routines for GDB. |
e2882c85 | 2 | Copyright (C) 1986-2018 Free Software Foundation, Inc. |
c906108c | 3 | |
c5aa993b | 4 | This file is part of GDB. |
c906108c | 5 | |
c5aa993b JM |
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 | |
a9762ec7 | 8 | the Free Software Foundation; either version 3 of the License, or |
c5aa993b | 9 | (at your option) any later version. |
c906108c | 10 | |
c5aa993b JM |
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. | |
c906108c | 15 | |
c5aa993b | 16 | You should have received a copy of the GNU General Public License |
a9762ec7 | 17 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
c906108c SS |
18 | |
19 | #include "defs.h" | |
20 | #include "annotate.h" | |
21 | #include "value.h" | |
22 | #include "target.h" | |
23 | #include "gdbtypes.h" | |
24 | #include "breakpoint.h" | |
76727919 | 25 | #include "observable.h" |
bd00c694 | 26 | #include "inferior.h" |
45741a9c | 27 | #include "infrun.h" |
3b12939d | 28 | #include "top.h" |
c906108c SS |
29 | \f |
30 | ||
0e2de366 | 31 | /* Prototypes for local functions. */ |
c906108c | 32 | |
a14ed312 | 33 | static void print_value_flags (struct type *); |
c906108c | 34 | |
8d3788bd | 35 | static void breakpoint_changed (struct breakpoint *b); |
7f4b89d1 | 36 | |
c906108c | 37 | |
9a4105ab AC |
38 | void (*deprecated_annotate_signalled_hook) (void); |
39 | void (*deprecated_annotate_signal_hook) (void); | |
c906108c | 40 | |
bd00c694 PA |
41 | /* Booleans indicating whether we've emitted certain notifications. |
42 | Used to suppress useless repeated notifications until the next time | |
43 | we're ready to accept more commands. Reset whenever a prompt is | |
44 | displayed. */ | |
45 | static int frames_invalid_emitted; | |
46 | static int breakpoints_invalid_emitted; | |
47 | ||
c906108c | 48 | static void |
fba45db2 | 49 | print_value_flags (struct type *t) |
c906108c SS |
50 | { |
51 | if (can_dereference (t)) | |
a3f17187 | 52 | printf_filtered (("*")); |
c906108c | 53 | else |
a3f17187 | 54 | printf_filtered (("-")); |
c906108c | 55 | } |
9c97429f PA |
56 | |
57 | static void | |
58 | annotate_breakpoints_invalid (void) | |
c906108c | 59 | { |
bd00c694 PA |
60 | if (annotation_level == 2 |
61 | && (!breakpoints_invalid_emitted | |
3b12939d | 62 | || current_ui->prompt_state != PROMPT_BLOCKED)) |
c906108c | 63 | { |
6fdebc3d PA |
64 | /* If the inferior owns the terminal (e.g., we're resuming), |
65 | make sure to leave with the inferior still owning it. */ | |
223ffa71 | 66 | int was_inferior = target_terminal::is_inferior (); |
6fdebc3d | 67 | |
223ffa71 | 68 | target_terminal::ours_for_output (); |
6fdebc3d | 69 | |
a3f17187 | 70 | printf_unfiltered (("\n\032\032breakpoints-invalid\n")); |
6fdebc3d PA |
71 | |
72 | if (was_inferior) | |
223ffa71 | 73 | target_terminal::inferior (); |
6fdebc3d | 74 | |
bd00c694 | 75 | breakpoints_invalid_emitted = 1; |
c906108c SS |
76 | } |
77 | } | |
78 | ||
79 | void | |
fba45db2 | 80 | annotate_breakpoint (int num) |
c906108c SS |
81 | { |
82 | if (annotation_level > 1) | |
a3f17187 | 83 | printf_filtered (("\n\032\032breakpoint %d\n"), num); |
c906108c SS |
84 | } |
85 | ||
86 | void | |
fba45db2 | 87 | annotate_catchpoint (int num) |
c906108c SS |
88 | { |
89 | if (annotation_level > 1) | |
a3f17187 | 90 | printf_filtered (("\n\032\032catchpoint %d\n"), num); |
c906108c SS |
91 | } |
92 | ||
93 | void | |
fba45db2 | 94 | annotate_watchpoint (int num) |
c906108c SS |
95 | { |
96 | if (annotation_level > 1) | |
a3f17187 | 97 | printf_filtered (("\n\032\032watchpoint %d\n"), num); |
c906108c SS |
98 | } |
99 | ||
100 | void | |
fba45db2 | 101 | annotate_starting (void) |
c906108c | 102 | { |
7f4b89d1 TT |
103 | if (annotation_level > 1) |
104 | printf_filtered (("\n\032\032starting\n")); | |
c906108c SS |
105 | } |
106 | ||
107 | void | |
fba45db2 | 108 | annotate_stopped (void) |
c906108c | 109 | { |
7f4b89d1 TT |
110 | if (annotation_level > 1) |
111 | printf_filtered (("\n\032\032stopped\n")); | |
c906108c SS |
112 | } |
113 | ||
114 | void | |
fba45db2 | 115 | annotate_exited (int exitstatus) |
c906108c | 116 | { |
7f4b89d1 TT |
117 | if (annotation_level > 1) |
118 | printf_filtered (("\n\032\032exited %d\n"), exitstatus); | |
c906108c SS |
119 | } |
120 | ||
121 | void | |
fba45db2 | 122 | annotate_signalled (void) |
c906108c | 123 | { |
9a4105ab AC |
124 | if (deprecated_annotate_signalled_hook) |
125 | deprecated_annotate_signalled_hook (); | |
c906108c SS |
126 | |
127 | if (annotation_level > 1) | |
a3f17187 | 128 | printf_filtered (("\n\032\032signalled\n")); |
c906108c SS |
129 | } |
130 | ||
131 | void | |
fba45db2 | 132 | annotate_signal_name (void) |
c906108c | 133 | { |
e5c113a1 | 134 | if (annotation_level == 2) |
a3f17187 | 135 | printf_filtered (("\n\032\032signal-name\n")); |
c906108c SS |
136 | } |
137 | ||
138 | void | |
fba45db2 | 139 | annotate_signal_name_end (void) |
c906108c | 140 | { |
e5c113a1 | 141 | if (annotation_level == 2) |
a3f17187 | 142 | printf_filtered (("\n\032\032signal-name-end\n")); |
c906108c SS |
143 | } |
144 | ||
145 | void | |
fba45db2 | 146 | annotate_signal_string (void) |
c906108c | 147 | { |
e5c113a1 | 148 | if (annotation_level == 2) |
a3f17187 | 149 | printf_filtered (("\n\032\032signal-string\n")); |
c906108c SS |
150 | } |
151 | ||
152 | void | |
fba45db2 | 153 | annotate_signal_string_end (void) |
c906108c | 154 | { |
e5c113a1 | 155 | if (annotation_level == 2) |
a3f17187 | 156 | printf_filtered (("\n\032\032signal-string-end\n")); |
c906108c SS |
157 | } |
158 | ||
159 | void | |
fba45db2 | 160 | annotate_signal (void) |
c906108c | 161 | { |
9a4105ab AC |
162 | if (deprecated_annotate_signal_hook) |
163 | deprecated_annotate_signal_hook (); | |
7a292a7a | 164 | |
c906108c | 165 | if (annotation_level > 1) |
a3f17187 | 166 | printf_filtered (("\n\032\032signal\n")); |
c906108c SS |
167 | } |
168 | \f | |
169 | void | |
fba45db2 | 170 | annotate_breakpoints_headers (void) |
c906108c | 171 | { |
e5c113a1 | 172 | if (annotation_level == 2) |
a3f17187 | 173 | printf_filtered (("\n\032\032breakpoints-headers\n")); |
c906108c SS |
174 | } |
175 | ||
176 | void | |
fba45db2 | 177 | annotate_field (int num) |
c906108c | 178 | { |
e5c113a1 | 179 | if (annotation_level == 2) |
a3f17187 | 180 | printf_filtered (("\n\032\032field %d\n"), num); |
c906108c SS |
181 | } |
182 | ||
183 | void | |
fba45db2 | 184 | annotate_breakpoints_table (void) |
c906108c | 185 | { |
e5c113a1 | 186 | if (annotation_level == 2) |
a3f17187 | 187 | printf_filtered (("\n\032\032breakpoints-table\n")); |
c906108c SS |
188 | } |
189 | ||
190 | void | |
fba45db2 | 191 | annotate_record (void) |
c906108c | 192 | { |
e5c113a1 | 193 | if (annotation_level == 2) |
a3f17187 | 194 | printf_filtered (("\n\032\032record\n")); |
c906108c SS |
195 | } |
196 | ||
197 | void | |
fba45db2 | 198 | annotate_breakpoints_table_end (void) |
c906108c | 199 | { |
e5c113a1 | 200 | if (annotation_level == 2) |
a3f17187 | 201 | printf_filtered (("\n\032\032breakpoints-table-end\n")); |
c906108c SS |
202 | } |
203 | ||
204 | void | |
fba45db2 | 205 | annotate_frames_invalid (void) |
c906108c | 206 | { |
bd00c694 PA |
207 | if (annotation_level == 2 |
208 | && (!frames_invalid_emitted | |
3b12939d | 209 | || current_ui->prompt_state != PROMPT_BLOCKED)) |
c906108c | 210 | { |
6fdebc3d PA |
211 | /* If the inferior owns the terminal (e.g., we're resuming), |
212 | make sure to leave with the inferior still owning it. */ | |
223ffa71 | 213 | int was_inferior = target_terminal::is_inferior (); |
6fdebc3d | 214 | |
223ffa71 | 215 | target_terminal::ours_for_output (); |
6fdebc3d | 216 | |
a3f17187 | 217 | printf_unfiltered (("\n\032\032frames-invalid\n")); |
6fdebc3d PA |
218 | |
219 | if (was_inferior) | |
223ffa71 | 220 | target_terminal::inferior (); |
6fdebc3d | 221 | |
bd00c694 | 222 | frames_invalid_emitted = 1; |
c906108c SS |
223 | } |
224 | } | |
225 | ||
d17d4947 NR |
226 | void |
227 | annotate_new_thread (void) | |
228 | { | |
229 | if (annotation_level > 1) | |
230 | { | |
231 | printf_unfiltered (("\n\032\032new-thread\n")); | |
232 | } | |
233 | } | |
234 | ||
b8fa951a NR |
235 | void |
236 | annotate_thread_changed (void) | |
237 | { | |
238 | if (annotation_level > 1) | |
239 | { | |
240 | printf_unfiltered (("\n\032\032thread-changed\n")); | |
241 | } | |
242 | } | |
243 | ||
c906108c | 244 | void |
fba45db2 | 245 | annotate_field_begin (struct type *type) |
c906108c | 246 | { |
e5c113a1 | 247 | if (annotation_level == 2) |
c906108c | 248 | { |
a3f17187 | 249 | printf_filtered (("\n\032\032field-begin ")); |
c906108c | 250 | print_value_flags (type); |
a3f17187 | 251 | printf_filtered (("\n")); |
c906108c SS |
252 | } |
253 | } | |
254 | ||
255 | void | |
fba45db2 | 256 | annotate_field_name_end (void) |
c906108c | 257 | { |
e5c113a1 | 258 | if (annotation_level == 2) |
a3f17187 | 259 | printf_filtered (("\n\032\032field-name-end\n")); |
c906108c SS |
260 | } |
261 | ||
262 | void | |
fba45db2 | 263 | annotate_field_value (void) |
c906108c | 264 | { |
e5c113a1 | 265 | if (annotation_level == 2) |
a3f17187 | 266 | printf_filtered (("\n\032\032field-value\n")); |
c906108c SS |
267 | } |
268 | ||
269 | void | |
fba45db2 | 270 | annotate_field_end (void) |
c906108c | 271 | { |
e5c113a1 | 272 | if (annotation_level == 2) |
a3f17187 | 273 | printf_filtered (("\n\032\032field-end\n")); |
c906108c SS |
274 | } |
275 | \f | |
276 | void | |
fba45db2 | 277 | annotate_quit (void) |
c906108c SS |
278 | { |
279 | if (annotation_level > 1) | |
a3f17187 | 280 | printf_filtered (("\n\032\032quit\n")); |
c906108c SS |
281 | } |
282 | ||
283 | void | |
fba45db2 | 284 | annotate_error (void) |
c906108c SS |
285 | { |
286 | if (annotation_level > 1) | |
a3f17187 | 287 | printf_filtered (("\n\032\032error\n")); |
c906108c SS |
288 | } |
289 | ||
290 | void | |
fba45db2 | 291 | annotate_error_begin (void) |
c906108c SS |
292 | { |
293 | if (annotation_level > 1) | |
294 | fprintf_filtered (gdb_stderr, "\n\032\032error-begin\n"); | |
295 | } | |
296 | ||
297 | void | |
fba45db2 | 298 | annotate_value_history_begin (int histindex, struct type *type) |
c906108c | 299 | { |
e5c113a1 | 300 | if (annotation_level == 2) |
c906108c | 301 | { |
a3f17187 | 302 | printf_filtered (("\n\032\032value-history-begin %d "), histindex); |
c906108c | 303 | print_value_flags (type); |
a3f17187 | 304 | printf_filtered (("\n")); |
c906108c SS |
305 | } |
306 | } | |
307 | ||
308 | void | |
fba45db2 | 309 | annotate_value_begin (struct type *type) |
c906108c | 310 | { |
e5c113a1 | 311 | if (annotation_level == 2) |
c906108c | 312 | { |
a3f17187 | 313 | printf_filtered (("\n\032\032value-begin ")); |
c906108c | 314 | print_value_flags (type); |
a3f17187 | 315 | printf_filtered (("\n")); |
c906108c SS |
316 | } |
317 | } | |
318 | ||
319 | void | |
fba45db2 | 320 | annotate_value_history_value (void) |
c906108c | 321 | { |
e5c113a1 | 322 | if (annotation_level == 2) |
a3f17187 | 323 | printf_filtered (("\n\032\032value-history-value\n")); |
c906108c SS |
324 | } |
325 | ||
326 | void | |
fba45db2 | 327 | annotate_value_history_end (void) |
c906108c | 328 | { |
e5c113a1 | 329 | if (annotation_level == 2) |
a3f17187 | 330 | printf_filtered (("\n\032\032value-history-end\n")); |
c906108c SS |
331 | } |
332 | ||
333 | void | |
fba45db2 | 334 | annotate_value_end (void) |
c906108c | 335 | { |
e5c113a1 | 336 | if (annotation_level == 2) |
a3f17187 | 337 | printf_filtered (("\n\032\032value-end\n")); |
c906108c SS |
338 | } |
339 | ||
340 | void | |
fba45db2 | 341 | annotate_display_begin (void) |
c906108c | 342 | { |
e5c113a1 | 343 | if (annotation_level == 2) |
a3f17187 | 344 | printf_filtered (("\n\032\032display-begin\n")); |
c906108c SS |
345 | } |
346 | ||
347 | void | |
fba45db2 | 348 | annotate_display_number_end (void) |
c906108c | 349 | { |
e5c113a1 | 350 | if (annotation_level == 2) |
a3f17187 | 351 | printf_filtered (("\n\032\032display-number-end\n")); |
c906108c SS |
352 | } |
353 | ||
354 | void | |
fba45db2 | 355 | annotate_display_format (void) |
c906108c | 356 | { |
e5c113a1 | 357 | if (annotation_level == 2) |
a3f17187 | 358 | printf_filtered (("\n\032\032display-format\n")); |
c906108c SS |
359 | } |
360 | ||
361 | void | |
fba45db2 | 362 | annotate_display_expression (void) |
c906108c | 363 | { |
e5c113a1 | 364 | if (annotation_level == 2) |
a3f17187 | 365 | printf_filtered (("\n\032\032display-expression\n")); |
c906108c SS |
366 | } |
367 | ||
368 | void | |
fba45db2 | 369 | annotate_display_expression_end (void) |
c906108c | 370 | { |
e5c113a1 | 371 | if (annotation_level == 2) |
a3f17187 | 372 | printf_filtered (("\n\032\032display-expression-end\n")); |
c906108c SS |
373 | } |
374 | ||
375 | void | |
fba45db2 | 376 | annotate_display_value (void) |
c906108c | 377 | { |
e5c113a1 | 378 | if (annotation_level == 2) |
a3f17187 | 379 | printf_filtered (("\n\032\032display-value\n")); |
c906108c SS |
380 | } |
381 | ||
382 | void | |
fba45db2 | 383 | annotate_display_end (void) |
c906108c | 384 | { |
e5c113a1 | 385 | if (annotation_level == 2) |
a3f17187 | 386 | printf_filtered (("\n\032\032display-end\n")); |
c906108c SS |
387 | } |
388 | ||
389 | void | |
fba45db2 | 390 | annotate_arg_begin (void) |
c906108c | 391 | { |
e5c113a1 | 392 | if (annotation_level == 2) |
a3f17187 | 393 | printf_filtered (("\n\032\032arg-begin\n")); |
c906108c SS |
394 | } |
395 | ||
396 | void | |
fba45db2 | 397 | annotate_arg_name_end (void) |
c906108c | 398 | { |
e5c113a1 | 399 | if (annotation_level == 2) |
a3f17187 | 400 | printf_filtered (("\n\032\032arg-name-end\n")); |
c906108c SS |
401 | } |
402 | ||
403 | void | |
fba45db2 | 404 | annotate_arg_value (struct type *type) |
c906108c | 405 | { |
e5c113a1 | 406 | if (annotation_level == 2) |
c906108c | 407 | { |
a3f17187 | 408 | printf_filtered (("\n\032\032arg-value ")); |
c906108c | 409 | print_value_flags (type); |
a3f17187 | 410 | printf_filtered (("\n")); |
c906108c SS |
411 | } |
412 | } | |
413 | ||
414 | void | |
fba45db2 | 415 | annotate_arg_end (void) |
c906108c | 416 | { |
e5c113a1 | 417 | if (annotation_level == 2) |
a3f17187 | 418 | printf_filtered (("\n\032\032arg-end\n")); |
c906108c SS |
419 | } |
420 | ||
421 | void | |
5af949e3 UW |
422 | annotate_source (char *filename, int line, int character, int mid, |
423 | struct gdbarch *gdbarch, CORE_ADDR pc) | |
c906108c SS |
424 | { |
425 | if (annotation_level > 1) | |
a3f17187 | 426 | printf_filtered (("\n\032\032source ")); |
c906108c | 427 | else |
a3f17187 | 428 | printf_filtered (("\032\032")); |
c906108c | 429 | |
50ee7535 | 430 | printf_filtered (("%s:%d:%d:%s:%s\n"), filename, line, character, |
5af949e3 | 431 | mid ? "middle" : "beg", paddress (gdbarch, pc)); |
c906108c SS |
432 | } |
433 | ||
434 | void | |
5af949e3 | 435 | annotate_frame_begin (int level, struct gdbarch *gdbarch, CORE_ADDR pc) |
c906108c | 436 | { |
24ca4723 | 437 | if (annotation_level > 1) |
5af949e3 UW |
438 | printf_filtered (("\n\032\032frame-begin %d %s\n"), |
439 | level, paddress (gdbarch, pc)); | |
c906108c SS |
440 | } |
441 | ||
442 | void | |
fba45db2 | 443 | annotate_function_call (void) |
c906108c | 444 | { |
e5c113a1 | 445 | if (annotation_level == 2) |
a3f17187 | 446 | printf_filtered (("\n\032\032function-call\n")); |
c906108c SS |
447 | } |
448 | ||
449 | void | |
fba45db2 | 450 | annotate_signal_handler_caller (void) |
c906108c | 451 | { |
e5c113a1 | 452 | if (annotation_level == 2) |
a3f17187 | 453 | printf_filtered (("\n\032\032signal-handler-caller\n")); |
c906108c SS |
454 | } |
455 | ||
456 | void | |
fba45db2 | 457 | annotate_frame_address (void) |
c906108c | 458 | { |
e5c113a1 | 459 | if (annotation_level == 2) |
a3f17187 | 460 | printf_filtered (("\n\032\032frame-address\n")); |
c906108c SS |
461 | } |
462 | ||
463 | void | |
fba45db2 | 464 | annotate_frame_address_end (void) |
c906108c | 465 | { |
e5c113a1 | 466 | if (annotation_level == 2) |
a3f17187 | 467 | printf_filtered (("\n\032\032frame-address-end\n")); |
c906108c SS |
468 | } |
469 | ||
470 | void | |
fba45db2 | 471 | annotate_frame_function_name (void) |
c906108c | 472 | { |
e5c113a1 | 473 | if (annotation_level == 2) |
a3f17187 | 474 | printf_filtered (("\n\032\032frame-function-name\n")); |
c906108c SS |
475 | } |
476 | ||
477 | void | |
fba45db2 | 478 | annotate_frame_args (void) |
c906108c | 479 | { |
e5c113a1 | 480 | if (annotation_level == 2) |
a3f17187 | 481 | printf_filtered (("\n\032\032frame-args\n")); |
c906108c SS |
482 | } |
483 | ||
484 | void | |
fba45db2 | 485 | annotate_frame_source_begin (void) |
c906108c | 486 | { |
e5c113a1 | 487 | if (annotation_level == 2) |
a3f17187 | 488 | printf_filtered (("\n\032\032frame-source-begin\n")); |
c906108c SS |
489 | } |
490 | ||
491 | void | |
fba45db2 | 492 | annotate_frame_source_file (void) |
c906108c | 493 | { |
e5c113a1 | 494 | if (annotation_level == 2) |
a3f17187 | 495 | printf_filtered (("\n\032\032frame-source-file\n")); |
c906108c SS |
496 | } |
497 | ||
498 | void | |
fba45db2 | 499 | annotate_frame_source_file_end (void) |
c906108c | 500 | { |
e5c113a1 | 501 | if (annotation_level == 2) |
a3f17187 | 502 | printf_filtered (("\n\032\032frame-source-file-end\n")); |
c906108c SS |
503 | } |
504 | ||
505 | void | |
fba45db2 | 506 | annotate_frame_source_line (void) |
c906108c | 507 | { |
e5c113a1 | 508 | if (annotation_level == 2) |
a3f17187 | 509 | printf_filtered (("\n\032\032frame-source-line\n")); |
c906108c SS |
510 | } |
511 | ||
512 | void | |
fba45db2 | 513 | annotate_frame_source_end (void) |
c906108c | 514 | { |
e5c113a1 | 515 | if (annotation_level == 2) |
a3f17187 | 516 | printf_filtered (("\n\032\032frame-source-end\n")); |
c906108c SS |
517 | } |
518 | ||
519 | void | |
fba45db2 | 520 | annotate_frame_where (void) |
c906108c | 521 | { |
e5c113a1 | 522 | if (annotation_level == 2) |
a3f17187 | 523 | printf_filtered (("\n\032\032frame-where\n")); |
c906108c SS |
524 | } |
525 | ||
526 | void | |
fba45db2 | 527 | annotate_frame_end (void) |
c906108c | 528 | { |
e5c113a1 | 529 | if (annotation_level == 2) |
a3f17187 | 530 | printf_filtered (("\n\032\032frame-end\n")); |
c906108c SS |
531 | } |
532 | \f | |
533 | void | |
917793af | 534 | annotate_array_section_begin (int idx, struct type *elttype) |
c906108c | 535 | { |
e5c113a1 | 536 | if (annotation_level == 2) |
c906108c | 537 | { |
917793af | 538 | printf_filtered (("\n\032\032array-section-begin %d "), idx); |
c906108c | 539 | print_value_flags (elttype); |
a3f17187 | 540 | printf_filtered (("\n")); |
c906108c SS |
541 | } |
542 | } | |
543 | ||
544 | void | |
fba45db2 | 545 | annotate_elt_rep (unsigned int repcount) |
c906108c | 546 | { |
e5c113a1 | 547 | if (annotation_level == 2) |
a3f17187 | 548 | printf_filtered (("\n\032\032elt-rep %u\n"), repcount); |
c906108c SS |
549 | } |
550 | ||
551 | void | |
fba45db2 | 552 | annotate_elt_rep_end (void) |
c906108c | 553 | { |
e5c113a1 | 554 | if (annotation_level == 2) |
a3f17187 | 555 | printf_filtered (("\n\032\032elt-rep-end\n")); |
c906108c SS |
556 | } |
557 | ||
558 | void | |
fba45db2 | 559 | annotate_elt (void) |
c906108c | 560 | { |
e5c113a1 | 561 | if (annotation_level == 2) |
a3f17187 | 562 | printf_filtered (("\n\032\032elt\n")); |
c906108c SS |
563 | } |
564 | ||
565 | void | |
fba45db2 | 566 | annotate_array_section_end (void) |
c906108c | 567 | { |
e5c113a1 | 568 | if (annotation_level == 2) |
a3f17187 | 569 | printf_filtered (("\n\032\032array-section-end\n")); |
c906108c SS |
570 | } |
571 | ||
bd00c694 PA |
572 | /* Called when GDB is about to display the prompt. Used to reset |
573 | annotation suppression whenever we're ready to accept new | |
574 | frontend/user commands. */ | |
575 | ||
576 | void | |
577 | annotate_display_prompt (void) | |
578 | { | |
579 | frames_invalid_emitted = 0; | |
580 | breakpoints_invalid_emitted = 0; | |
581 | } | |
582 | ||
c906108c | 583 | static void |
8d3788bd | 584 | breakpoint_changed (struct breakpoint *b) |
c906108c | 585 | { |
0928e93d PA |
586 | if (b->number <= 0) |
587 | return; | |
588 | ||
9c97429f | 589 | annotate_breakpoints_invalid (); |
c906108c SS |
590 | } |
591 | ||
592 | void | |
fba45db2 | 593 | _initialize_annotate (void) |
c906108c | 594 | { |
76727919 TT |
595 | gdb::observers::breakpoint_created.attach (breakpoint_changed); |
596 | gdb::observers::breakpoint_deleted.attach (breakpoint_changed); | |
597 | gdb::observers::breakpoint_modified.attach (breakpoint_changed); | |
c906108c | 598 | } |