aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRohr, Stephan <stephan.rohr@intel.com>2024-09-19 12:55:19 +0200
committerStephan Rohr <stephan.rohr@intel.com>2024-11-21 00:49:39 -0800
commitbe740e7cc62fed098ad62cef3b2e2b25b44d8748 (patch)
tree0dc2a1eefc521536f835a4836223528646565266
parentAutomatic date update in version.in (diff)
downloadbinutils-gdb-be740e7cc62fed098ad62cef3b2e2b25b44d8748.tar.gz
binutils-gdb-be740e7cc62fed098ad62cef3b2e2b25b44d8748.tar.bz2
binutils-gdb-be740e7cc62fed098ad62cef3b2e2b25b44d8748.zip
testsuite: skip confirmation in 'gdb_reinitialize_dir'
Some shells automatically confirm the 'dir' command: (gdb) dir Reinitialize source path to empty? (y or n) [answered Y; input not from terminal] Source directories searched: $cdir;$cwd (gdb) y dir <...>/gdb/testsuite/gdb.base Undefined command: "y". Try "help". For example, this reprdocues in a MinGW32 environment with 'TERM=dumb'. Skip sending 'y' if the command is already confirmed. Approved-By: Tom Tromey <tom@tromey.com>
-rw-r--r--gdb/testsuite/lib/gdb.exp6
1 files changed, 4 insertions, 2 deletions
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 5d4d9db3ea4..2b27d7fc9e7 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -2238,8 +2238,10 @@ proc gdb_reinitialize_dir { subdir } {
}
send_gdb "dir\n"
gdb_expect 60 {
- -re "Reinitialize source path to empty.*y or n. " {
- send_gdb "y\n" answer
+ -re "Reinitialize source path to empty.*y or n.(\\\s.answered Y; input not from terminal.)?" {
+ if {![info exists expect_out(1,string)]} {
+ send_gdb "y\n" answer
+ }
gdb_expect 60 {
-re "Source directories searched.*$gdb_prompt $" {
send_gdb "dir $subdir\n"