[pushed,gdb/testsuite] Fix gdb.fortran/call-no-debug.exp with native-gdbserver

Message ID 20211013093555.8047-1-tdevries@suse.de
State New
Headers show
Series
  • [pushed,gdb/testsuite] Fix gdb.fortran/call-no-debug.exp with native-gdbserver
Related show

Commit Message

Bruno Larsen via Gdb-patches Oct. 13, 2021, 9:35 a.m.
When running test-case gdb.fortran/call-no-debug.exp with target board
native-gdbserver, I run into:
...
(gdb) PASS: gdb.fortran/call-no-debug.exp: print string_func_ (&'abcdefg', 3)
call (integer) string_func_ (&'abcdefg', 3)^M
$2 = 0^M
(gdb) FAIL: gdb.fortran/call-no-debug.exp: call (integer) string_func_ (&'abcdefg', 3)
...

The problem is that gdb_test is used to match inferior output.

Fix this by using gdb_test_stdio.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.fortran/call-no-debug.exp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)


base-commit: 2786ef85faf16c13029548832c4e4b025bf2624c
-- 
2.26.2

Patch

diff --git a/gdb/testsuite/gdb.fortran/call-no-debug.exp b/gdb/testsuite/gdb.fortran/call-no-debug.exp
index 3c5172e7e36..cbdefb6a7d9 100644
--- a/gdb/testsuite/gdb.fortran/call-no-debug.exp
+++ b/gdb/testsuite/gdb.fortran/call-no-debug.exp
@@ -102,5 +102,7 @@  if { $symbol_name == "" } {
     gdb_test "ptype ${symbol_name}" "type = <unknown return type> \\(\\)"
     gdb_test "print ${symbol_name} (&'abcdefg', 3)" \
 	"'${symbol_name}' has unknown return type; cast the call to its declared return type"
-    gdb_test "call (integer) ${symbol_name} (&'abcdefg', 3)" " abc\r\n\\\$\\d+ = 0"
+    gdb_test_stdio "call (integer) ${symbol_name} (&'abcdefg', 3)" \
+	" abc" \
+	"\\\$\\d+ = 0"
 }