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>
}
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"