summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2014-10-17 15:58:01 -0700
committerMathieu Chartier <mathieuc@google.com>2014-12-02 11:04:39 -0800
commitc0a8a80a3d45aa6040ce6c10108bcb96a14dc9c6 (patch)
treed25be01706b9cef5a4e53009d6d4d6360ee1f240
parente7106cbcfcbb07d11948dbc45d2719d32e5e3908 (diff)
downloadart-c0a8a80a3d45aa6040ce6c10108bcb96a14dc9c6.zip
art-c0a8a80a3d45aa6040ce6c10108bcb96a14dc9c6.tar.gz
art-c0a8a80a3d45aa6040ce6c10108bcb96a14dc9c6.tar.bz2
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
-rwxr-xr-xtest/etc/run-test-jar9
-rwxr-xr-xtest/run-test5
2 files changed, 12 insertions, 2 deletions
diff --git a/test/etc/run-test-jar b/test/etc/run-test-jar
index d2cd8ab..5c0f83f 100755
--- a/test/etc/run-test-jar
+++ b/test/etc/run-test-jar
@@ -108,6 +108,11 @@ while true; do
DEV_MODE="y"
TIME_OUT="n"
shift
+ elif [ "x$1" = "x--gdb-arg" ]; then
+ shift
+ gdb_arg="$1"
+ GDB_ARGS="${GDB_ARGS} $gdb_arg"
+ shift
elif [ "x$1" = "x--zygote" ]; then
ZYGOTE="-Xzygote"
msg "Spawning from zygote"
@@ -229,11 +234,11 @@ if [ "$USE_GDB" = "y" ]; then
else
if [ `uname` = "Darwin" ]; then
GDB=lldb
- GDB_ARGS="-- $DALVIKVM"
+ GDB_ARGS="$GDB_ARGS -- $DALVIKVM"
DALVIKVM=
else
GDB=gdb
- GDB_ARGS="--args $DALVIKVM"
+ GDB_ARGS="$GDB_ARGS --args $DALVIKVM"
# Enable for Emacs "M-x gdb" support. TODO: allow extra gdb arguments on command line.
# gdbargs="--annotate=3 $gdbargs"
fi
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 @@ while true; do
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