testsuite: Create .cmd files for gdb and gdbserver

When spawning gdb or gdbserver create a .cmd file in the test output
directory containing the full command line, ensuring the current gdb
instance is appended to the files so that they can be quickly matched
to the corresponding gdb.in file.

gdb/testsuite/ChangeLog:

	* lib/gdb.exp (default_gdb_spawn): Call gdb_write_cmd_file.
	(gdb_write_cmd_file): New procedure.
	* lib/gdbserver-support.exp (gdbserver_start): Call
	gdbserver_write_cmd_file.
	(gdbserver_write_cmd_file): New proedure.
3 files changed