Fix foreach_with_prefix regression
Fix a silly bug in commit
a26c8de0ee93 ("Fix early return in
foreach_with_prefix").
That patch made foreach_with_prefix always return after the first
iteration, making ~10k tests disappear from test runs...
This fixes it, and as penance, adds a testcase that exercises all
kinds of different returns possible (ok, error, return, break,
continue). I've written it with regular "foreach", and then switched
to foreach_with_prefix and made sure we get the same results. I put
the testcase in a new gdb.testsuite/ subdir, since this is exercising
the testsuite harness bits. We can move this elsewhere if people
prefer a different place, but I'm going ahead in order to unbreak the
testsuite ASAP.
gdb/testsuite/ChangeLog:
2019-07-04 Pedro Alves <palves@redhat.com>
* lib/gdb.exp (foreach_with_prefix): Don't return early if
body returned ok(0), break(3) or continue(4).
* gdb.testsuite/foreach_with_prefix.exp: New file.