return -1
}
+# This testcase only makes sense when GDB and the inferior are reading
+# from the same input file (aka sharing the terminal's input buffer).
+gdb_test_no_output "tty /dev/tty"
+
# Because runto_main doesn't know how to handle the prompt with annotations,
# run to main before we set the annotation level.
if ![runto_main] then {
save_vars { GDBFLAGS } {
set GDBFLAGS "$GDBFLAGS -ex \"set non-stop on\""
+ # This test only makes sense when GDB and the inferior are reading
+ # from the same input file / sharing the terminal.
+ append GDBFLAGS " -ex \"tty /dev/tty\""
if { [prepare_for_testing "failed to prepare" ${testfile} $srcfile] } {
return -1
}
continue
}
-if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
+if {[build_executable "failed to compile" $testfile $srcfile debug]} {
return -1
}
+save_vars { GDBFLAGS } {
+ # This test only makes sense when GDB and the inferior are reading
+ # from the same input file / sharing the terminal. If we instead
+ # let GDB put the inferior in its own session, then while the
+ # inferior is running in the foreground, input would be redirected
+ # to the inferior, and GDB would never see that input.
+ append GDBFLAGS " -ex \"tty /dev/tty\""
+ clean_restart $binfile
+}
+
if ![runto_main] then {
fail "couldn't run to main"
return -1