Make gdb.fortran/{array-slices,lbound-ubound} work against gdbserver
authorPedro Alves <pedro@palves.net>
Fri, 4 Mar 2022 17:34:18 +0000 (17:34 +0000)
committerPedro Alves <pedro@palves.net>
Wed, 16 Mar 2022 12:12:09 +0000 (12:12 +0000)
commit9bde221fecaa58b1be8e8288f5ec5c202a61d23f
tree43915d95b05d04d63424546c13bf31d632799a69
parent22546800ad34a5ac6bc90e6701de3e74bad75551
Make gdb.fortran/{array-slices,lbound-ubound} work against gdbserver

gdb.fortran/array-slices.exp and gdb.fortran/lbound-ubound.exp were
recently disabled unless testing with the native target, because they
rely on inferior I/O.  However, when testing against gdbserver using
the native-gdbserver/native-extended-gdbserver boards, we do have
access to inferior I/O.

The right way to check whether the board can do I/O, is via checking
the gdb,noinferiorio board variable.  Switch to using that.

And then, tweak the testcases to expect output to appear in
inferior_spawn_id, instead of gdb_spawn_id.  When testing against the
native target, inferior_spawn_id is the same as gdb_spawn_id.  When
testing against gdbserver, it maps to gdbserver_spawn_id.

This exposed a buglet in gdb.fortran/array-slices.f90's show_1d
subroutine -- it was missing printing newline at the end of the
"Expected GDB Output" text, leading to a test timeout.  All other
subroutines end with advance=yes, except this one.  Fix it by using
advance=yes here too.

Change-Id: I4640729f334431cfc24b0917e7d3977b677c6ca5
gdb/testsuite/gdb.fortran/array-slices.exp
gdb/testsuite/gdb.fortran/array-slices.f90
gdb/testsuite/gdb.fortran/lbound-ubound.exp