gdb.base/skip.exp: Don't abuse gdb_test's question support
authorPedro Alves <pedro@palves.net>
Tue, 17 May 2022 09:25:12 +0000 (10:25 +0100)
committerPedro Alves <pedro@palves.net>
Tue, 17 May 2022 10:08:22 +0000 (11:08 +0100)
commitd7440bee9ffa6767e704f226ec28b9aa2fb748d6
treebaf6d19a2895221e52062b5d1469918590d75cfe
parent8d08cccb0147025f028898542263e3f83259bba9
gdb.base/skip.exp: Don't abuse gdb_test's question support

gdb.base/skip.exp abuses gdb_test's support for answering a GDB
question to do this:

    # With gcc 9.2.0 we jump once back to main before entering foo here.
    # If that happens try to step a second time.
    gdb_test "step" "foo \\(\\) at.*" "step 3" \
"main \\(\\) at .*\r\n$gdb_prompt " "step"

After a patch later in this series, gdb_test will FAIL if GDB does NOT
issue the question, so this test would start failing on older GCCs.

Switch to using gdb_test_multiple instead.  There are three spots in
the file that have the same pattern, and they're actually in a
sequence of commands that is repeated those 3 times.  Factor all that
out to a procedure.

I don't have gcc 9.2 handy, but I do have gcc 6.5, and that one is
affected as well, so update the comment.

Change-Id: If0a7e3cdf5191b4eec95ce0c8845c3a4d801c39e
gdb/testsuite/gdb.base/skip.exp