Add a way to pass GDB commands

Passing --gdb-arg to run-test sends the arg to GDB, example:
test/run-test --host --gdb --gdb-arg "--command=command.txt" 001-HelloWorld
Would run the test with the GDB script at command.txt on the host, this is
useful for running tests in GDB in a loop.

Bug: 17387969

Change-Id: I5ad455159a6d92783eacb17eecbb0f1e670cb4a3
diff --git a/test/run-test b/test/run-test
index e9dd86a..6b8f007 100755
--- a/test/run-test
+++ b/test/run-test
@@ -171,6 +171,11 @@
         option="$1"
         run_args="${run_args} --runtime-option $option"
         shift
+    elif [ "x$1" = "x--gdb-arg" ]; then
+        shift
+        gdb_arg="$1"
+        run_args="${run_args} --gdb-arg $gdb_arg"
+        shift
     elif [ "x$1" = "x--debug" ]; then
         run_args="${run_args} --debug"
         shift