[v2,07/16] Make inferior/GDB share terminal in tests expecting output after detach

Message ID 20210614212410.1612666-8-pedro@palves.net
State New
Headers show
Series
  • Interrupting programs that block/ignore SIGINT
Related show

Commit Message

Pedro Alves June 14, 2021, 9:24 p.m.
A following patch will make GDB put spawned inferiors in their own
terminal/session.  A consequence of that is that if you do "run", and
then "detach", GDB closes the terminal, so expecting inferior output
after detach no longer works, the inferior is alive, but its output
goes nowhere.

There's only one testcase that expects output out of an inferior after
detach.  Tweak it to output to GDB's terminal instead.

gdb/testsuite/ChangeLog:
yyyy-mm-dd  Pedro Alves  <pedro@palves.net>

	* gdb.threads/process-dies-while-detaching.exp: Issue "tty
	/dev/tty" before starting program.

Change-Id: Ic62bca178295763fb9c47657ee459fe715f7865e
---
 gdb/testsuite/gdb.threads/process-dies-while-detaching.exp | 3 +++
 1 file changed, 3 insertions(+)

-- 
2.26.2

Patch

diff --git a/gdb/testsuite/gdb.threads/process-dies-while-detaching.exp b/gdb/testsuite/gdb.threads/process-dies-while-detaching.exp
index ac1aad26ec5..f01d4cf0666 100644
--- a/gdb/testsuite/gdb.threads/process-dies-while-detaching.exp
+++ b/gdb/testsuite/gdb.threads/process-dies-while-detaching.exp
@@ -215,6 +215,7 @@  proc test_detach {multi_process cmd} {
 	global binfile
 
 	clean_restart ${binfile}
+	gdb_test_no_output "tty /dev/tty"
 
 	if ![runto_main] {
 	    fail "can't run to main"
@@ -240,6 +241,7 @@  proc test_detach_watch {multi_process cmd} {
 	global binfile decimal
 
 	clean_restart ${binfile}
+	gdb_test_no_output "tty /dev/tty"
 
 	if ![runto_main] {
 	    fail "can't run to main"
@@ -276,6 +278,7 @@  proc test_detach_killed_outside {multi_process cmd} {
 	global binfile
 
 	clean_restart ${binfile}
+	gdb_test_no_output "tty /dev/tty"
 
 	if ![runto_main] {
 	    fail "can't run to main"