[gdb/testsuite] Fix have_mpx with remote-gdbserver-on-localhost

With target board remote-gdbserver-on-localhost and gdb.arch/i386-mpx-call.exp
I run into:
...
FAIL: gdb.arch/i386-mpx-call.exp: upper_bnd0: continue to a bnd violation
...

This is due to the have_mpx test which should return 0, but instead returns 1
because the captured output:
...
No MPX support
No MPX support
...
does not match the used regexp:
...
    set status [expr ($status == 0) \
                   && ![regexp "^No MPX support\r\n" $output]]
...
which does match the captured output with native:
...
No MPX support^M
No MPX support^M
...

Fix this by making the \r in the regexp optional.

Tested on x86_64-linux, with native and target board
remote-gdbserver-on-localhost.
This commit is contained in:
Tom de Vries
2022-10-07 16:17:35 +02:00
parent 7fe3f84145
commit 43792b0de4

View File

@ -8636,7 +8636,7 @@ gdb_caching_proc have_mpx {
set status [lindex $result 0] set status [lindex $result 0]
set output [lindex $result 1] set output [lindex $result 1]
set status [expr ($status == 0) \ set status [expr ($status == 0) \
&& ![regexp "^No MPX support\r\n" $output]] && ![regexp "^No MPX support\r?\n" $output]]
remote_file build delete $obj remote_file build delete $obj