gdb/testsuite: Introduce and use gdb_spawn_attach_cmdline
Following
a7e6a19e87f3d719ea23c65b580a6d9bca4ccab3 "gdb: testsuite: add
new gdb_attach to check "attach" command", this commit proposes to
introduce the gdb_spawn_attach_cmdline helper and use it in
gdb.base/attach.exp.
This helper starts GDB and adds the "--pid=$PID" argument.
Also note that both the original and new implementation use
gdb_spawn_with_cmdline_opts, which in the end uses default_gdb_spawn.
This makes sure that we use $INTERNAL_GDBFLAGS, which by default already
contain "-iex \"set height 0\" -iex \"set width 0\"". To avoid
repetition of those arguments, gdb_spawn_attach_cmdline does not repeat
those arguments.
To maintain a behavior similat to what gdb.base/attach.exp used to do,
gdb_spawn_attach_cmdline keeps the -quiet flag.
Tested on x86_64-gnu-linux
Change-Id: I1fdcdb71c86d9c5d34bb28fc86fac68bcec37358