diff options
Diffstat (limited to 'gdb/annotate.c')
-rw-r--r-- | gdb/annotate.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/gdb/annotate.c b/gdb/annotate.c index 6cce693..97e2b2b 100644 --- a/gdb/annotate.c +++ b/gdb/annotate.c @@ -72,8 +72,17 @@ annotate_breakpoints_invalid (void) && (!breakpoints_invalid_emitted || async_background_execution_p ())) { - target_terminal_ours (); + /* If the inferior owns the terminal (e.g., we're resuming), + make sure to leave with the inferior still owning it. */ + int was_inferior = target_terminal_is_inferior (); + + target_terminal_ours_for_output (); + printf_unfiltered (("\n\032\032breakpoints-invalid\n")); + + if (was_inferior) + target_terminal_inferior (); + breakpoints_invalid_emitted = 1; } } @@ -210,8 +219,17 @@ annotate_frames_invalid (void) && (!frames_invalid_emitted || async_background_execution_p ())) { - target_terminal_ours (); + /* If the inferior owns the terminal (e.g., we're resuming), + make sure to leave with the inferior still owning it. */ + int was_inferior = target_terminal_is_inferior (); + + target_terminal_ours_for_output (); + printf_unfiltered (("\n\032\032frames-invalid\n")); + + if (was_inferior) + target_terminal_inferior (); + frames_invalid_emitted = 1; } } |