[gdb/testsuite] Fix gdb.server/non-existing-program.exp with remote-gdbserver-on...
authorTom de Vries <tdevries@suse.de>
Tue, 28 Mar 2023 12:18:44 +0000 (14:18 +0200)
committerTom de Vries <tdevries@suse.de>
Tue, 28 Mar 2023 12:18:44 +0000 (14:18 +0200)
commit134ec14b1502f30f0028293b35f57c18e44614d0
tree2e103c24cc1623495d9b37f343025317cb3f8fea
parentc61b7b7b8ea5e3a55b4642dade4798e5c896df66
[gdb/testsuite] Fix gdb.server/non-existing-program.exp with remote-gdbserver-on-localhost

With test-case gdb.server/non-existing-program.exp and native, I have reliably:
...
(gdb) builtin_spawn gdbserver stdio non-existing-program^M
stdin/stdout redirected^M
/bin/bash: line 0: exec: non-existing-program: not found^M
During startup program exited with code 127.^M
Exiting^M
PASS: gdb.server/non-existing-program.exp: gdbserver exits cleanly
...

But with target board remote-gdbserver-on-localhost I sometimes have:
...
(gdb) builtin_spawn /usr/bin/ssh -t -l remote-target localhost gdbserver \
  stdio non-existing-program^M
stdin/stdout redirected^M
/bin/bash: line 0: exec: non-existing-program: not found^M
During startup program exited with code 127.^M
Exiting^M
Connection to localhost closed.^M^M
PASS: gdb.server/non-existing-program.exp: gdbserver exits cleanly
...
and sometimes the exact same output, but a FAIL instead.

Fix this by replacing "Exiting\r\n$" with "Exiting\r\n" in the regexps.

Tested on x86_64-linux.
gdb/testsuite/gdb.server/non-existing-program.exp