On openSUSE Leap 15.2, when running test-case
gdb.base/batch-preserve-term-settings.exp I get:
...
spawn /bin/sh^M
PS1="gdb-subshell$ "^M
sh-4.4$ PS1="gdb-subshell$ "^M
gdb-subshell$ PASS: gdb.base/batch-preserve-term-settings.exp: batch run: \
spawn shell
...
but on Ubuntu 18.04.5, I get instead:
...
spawn /bin/sh^M
PS1="gdb-subshell$ "^M
$ gdb-subshell$ FAIL: gdb.base/batch-preserve-term-settings.exp: batch run: \
spawn shell (timeout)
...
Fix this by making the regexp recognize the second pattern as well.
Tested on x86_64-linux.
gdb/testsuite/ChangeLog:
2020-12-16 Tom de Vries <tdevries@suse.de>
* gdb.base/batch-preserve-term-settings.exp:
+2020-12-16 Tom de Vries <tdevries@suse.de>
+
+ * gdb.base/batch-preserve-term-settings.exp:
+
2020-12-16 Tom de Vries <tdevries@suse.de>
* lib/gdb.exp (gdb_compile_shlib_1): Factor out of ...
set gotit 0
set test "spawn shell"
gdb_expect {
- -re "PS1=\[^\r\n\]*\r\n$shell_prompt_re$" {
+ -re "PS1=\[^\r\n\]*\r\n.*$shell_prompt_re$" {
pass $test
set gotit 1
}