gdb/testsuite: add inferior arguments test
Add a test for verifying different methods of passing arguments to the
inferior: the start, starti and run commands, as well as `set args`.
All these methods work naturally when using the unix or
native-extended-gdbserver target boards. Since those are non-stub
boards, GDB runs new inferiors and therefore pass arguments to them.
With target boards where GDB connects to a stub, for example with
native-gdbserver, they don't really make sense. The inferior process is
already started when GDB connects.
However, the "run" method is still tested with stub targets, because the
gdb_run_cmd procedure is adapted for stub targets. Instead of issuing
the `run` command, it spawns whatever program is supposed to bring up
the stub (gdbserver, for example) using gdb_reload and makes GDB connect
to it. So this allows us to exercise argument passing through the
gdbserver command line, when testing with the native-gdbserver board.
Note that there is already a gdb.base/args.exp, but this tests
specifically the --args switch of GDB. Perhaps it could be integrated
in this new test, as a new "method".
gdb/testsuite/ChangeLog:
* lib/gdb.exp (gdb_run_cmd): Return success or failure.
* gdb.base/inferior-args.exp: New file.
* gdb.base/inferior-args.c: New file.
Change-Id: Ib61ea6220a47f9f67aed2960dcacd240cb57af70