forked from Imagelibrary/binutils-gdb
gdb: Use scoped_restore_terminal_state in annotate.c
In a couple of places in annotate.c we are manually backing up and restoring the terminal ownership, we could instead make use of scoped_restore_terminal_state. gdb/ChangeLog: * annotate.c (annotate_breakpoints_invalid): Make use of scoped_restore_terminal_state. (annotate_frames_invalid): Likewise.
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2019-06-14 Andrew Burgess <andrew.burgess@embecosm.com>
|
||||||
|
|
||||||
|
* annotate.c (annotate_breakpoints_invalid): Make use of
|
||||||
|
scoped_restore_terminal_state.
|
||||||
|
(annotate_frames_invalid): Likewise.
|
||||||
|
|
||||||
2019-06-14 Tom Tromey <tromey@adacore.com>
|
2019-06-14 Tom Tromey <tromey@adacore.com>
|
||||||
|
|
||||||
* ada-lang.c (ada_evaluate_subexp) <case BINOP_ASSIGN>: Always
|
* ada-lang.c (ada_evaluate_subexp) <case BINOP_ASSIGN>: Always
|
||||||
|
|||||||
@@ -61,17 +61,10 @@ annotate_breakpoints_invalid (void)
|
|||||||
&& (!breakpoints_invalid_emitted
|
&& (!breakpoints_invalid_emitted
|
||||||
|| current_ui->prompt_state != PROMPT_BLOCKED))
|
|| current_ui->prompt_state != PROMPT_BLOCKED))
|
||||||
{
|
{
|
||||||
/* If the inferior owns the terminal (e.g., we're resuming),
|
target_terminal::scoped_restore_terminal_state term_state;
|
||||||
make sure to leave with the inferior still owning it. */
|
|
||||||
int was_inferior = target_terminal::is_inferior ();
|
|
||||||
|
|
||||||
target_terminal::ours_for_output ();
|
target_terminal::ours_for_output ();
|
||||||
|
|
||||||
printf_unfiltered (("\n\032\032breakpoints-invalid\n"));
|
printf_unfiltered (("\n\032\032breakpoints-invalid\n"));
|
||||||
|
|
||||||
if (was_inferior)
|
|
||||||
target_terminal::inferior ();
|
|
||||||
|
|
||||||
breakpoints_invalid_emitted = 1;
|
breakpoints_invalid_emitted = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -208,17 +201,10 @@ annotate_frames_invalid (void)
|
|||||||
&& (!frames_invalid_emitted
|
&& (!frames_invalid_emitted
|
||||||
|| current_ui->prompt_state != PROMPT_BLOCKED))
|
|| current_ui->prompt_state != PROMPT_BLOCKED))
|
||||||
{
|
{
|
||||||
/* If the inferior owns the terminal (e.g., we're resuming),
|
target_terminal::scoped_restore_terminal_state term_state;
|
||||||
make sure to leave with the inferior still owning it. */
|
|
||||||
int was_inferior = target_terminal::is_inferior ();
|
|
||||||
|
|
||||||
target_terminal::ours_for_output ();
|
target_terminal::ours_for_output ();
|
||||||
|
|
||||||
printf_unfiltered (("\n\032\032frames-invalid\n"));
|
printf_unfiltered (("\n\032\032frames-invalid\n"));
|
||||||
|
|
||||||
if (was_inferior)
|
|
||||||
target_terminal::inferior ();
|
|
||||||
|
|
||||||
frames_invalid_emitted = 1;
|
frames_invalid_emitted = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user