-# In mid-execution
-gdb_breakpoint main
-gdb_run_cmd 5
-gdb_expect {
- -re ".*Breakpoint \[0-9\]+,.*main.*if .argc != 2.*$gdb_prompt $" {
- gdb_test "info terminal" "Inferior's terminal status .currently saved by GDB.:.*" "info terminal at breakpoint"
+ # Continue again...
+ gdb_continue_to_breakpoint "continue again"
+
+ # ... and verify again, to validate that when resuming, GDB restored the
+ # inferior's terminal settings correctly.
+ with_test_prefix "after last resume" {
+ array set termios3 [read_term_settings_from_inferior]
+ compare_gdb_and_inferior_settings [array get termios3]
+ gdb_assert {${termios2(c_iflag)} == ${termios3(c_iflag)}}
+ gdb_assert {${termios2(c_oflag)} == ${termios3(c_oflag)}}
+ gdb_assert {${termios2(c_cflag)} == ${termios3(c_cflag)}}
+ gdb_assert {${termios2(c_lflag)} == ${termios3(c_lflag)}}