diff options
| author | 2012-12-11 10:44:28 -0800 | |
|---|---|---|
| committer | 2012-12-11 11:25:21 -0800 | |
| commit | 4c1bf1a86cc0ca1323c317597583c01b3f7f8cf0 (patch) | |
| tree | c0c1211d7b41143d8c6fa765c263fff82841bf00 | |
| parent | a169e1d8d968800380245cda450505d969ebff76 (diff) | |
Support for --gdb for target run-test.
Add a --gdb option for target run-test that starts the test with
gdbserver. So that this is clear it forces the test to be run in dev
mode too.
Change-Id: I539e30d49b6e0beea38c6e9c60abb16e3f4062f7
| -rwxr-xr-x | test/etc/host-run-test-jar | 7 | ||||
| -rwxr-xr-x | test/etc/push-and-run-test-jar | 23 | ||||
| -rwxr-xr-x | test/run-test | 2 |
3 files changed, 12 insertions, 20 deletions
diff --git a/test/etc/host-run-test-jar b/test/etc/host-run-test-jar index 5c9d9edbfe..7e76c17e29 100755 --- a/test/etc/host-run-test-jar +++ b/test/etc/host-run-test-jar @@ -2,13 +2,6 @@ # # Run the code in test.jar using the host-mode virtual machine. The jar should # contain a top-level class named Main to run. -# -# Options: -# --quiet -- don't chatter -# --debug -- wait for debugger to attach -# --interpreter -- enable interpreter only mode (off by default) -# --no-verify -- turn off verification (on by default) -# --no-optimize -- turn off optimization (on by default) msg() { if [ "$QUIET" = "n" ]; then diff --git a/test/etc/push-and-run-test-jar b/test/etc/push-and-run-test-jar index 7154ac26fc..ce80ae45cd 100755 --- a/test/etc/push-and-run-test-jar +++ b/test/etc/push-and-run-test-jar @@ -2,17 +2,6 @@ # # Run the code in test.jar on the device. The jar should contain a top-level # class named Main to run. -# -# Options: -# --quiet -- don't chatter -# --debug -- wait for debugger to attach -# --zygote -- use the zygote (if so, all other options are ignored) -# --dev -- development mode (print the vm invocation cmdline) -# --interpreter -- enable interpreter only mode (off by default) -# --no-verify -- turn off verification (on by default) -# --no-optimize -- turn off optimization (on by default) -# --no-precise -- turn off precise GC (on by default) -# -O -- run non-debug code msg() { if [ "$QUIET" = "n" ]; then @@ -21,6 +10,7 @@ msg() { } OATEXEC="oatexecd" +GDB="n" DEBUG="n" INTERPRETER="n" VERIFY="y" @@ -40,6 +30,10 @@ while true; do elif [ "x$1" = "x--debug" ]; then DEBUG="y" shift + elif [ "x$1" = "x--gdb" ]; then + GDB="y" + DEV_MODE="y" + shift elif [ "x$1" = "x--zygote" ]; then ZYGOTE="--zygote" msg "Spawning from zygote" @@ -119,6 +113,11 @@ if [ "$DEBUG" = "y" ]; then DEBUG_OPTS="-agentlib:jdwp=transport=dt_socket,address=$PORT,server=y,suspend=y" fi +if [ "$GDB" = "y" ]; then + gdb="gdbserver :5039" + gdbargs="--args $exe" +fi + if [ "$INTERPRETER" = "y" ]; then INT_OPTS="-Xint" fi @@ -126,7 +125,7 @@ fi JNI_OPTS="-Xjnigreflimit:512 -Xcheck:jni" cmdline="cd $DEX_LOCATION && mkdir art-cache && export ANDROID_DATA=$DEX_LOCATION && export DEX_LOCATION=$DEX_LOCATION && \ - $INVOKE_WITH $OATEXEC $ZYGOTE $JNI_OPTS $INT_OPTS $DEBUG_OPTS -Ximage:/data/art-test/core.art -cp $DEX_LOCATION/$TEST_NAME.jar Main" + $INVOKE_WITH $gdb $OATEXEC $gdbargs $ZYGOTE $JNI_OPTS $INT_OPTS $DEBUG_OPTS -Ximage:/data/art-test/core.art -cp $DEX_LOCATION/$TEST_NAME.jar Main" if [ "$DEV_MODE" = "y" ]; then echo $cmdline "$@" fi diff --git a/test/run-test b/test/run-test index 739b589cd3..46d966c635 100755 --- a/test/run-test +++ b/test/run-test @@ -168,7 +168,7 @@ if [ "$usage" = "yes" ]; then echo " Runtime Options:" echo " -O Run oatexec rather than oatexecd (off by default)." echo " --debug Wait for a debugger to attach." - #echo " --gdb Run under gdb; incompatible with some tests." + echo " --gdb Run under gdb; incompatible with some tests." echo " --build-only Build test files only (off by default)." echo " --interpreter Enable interpreter only mode (off by default)." echo " --no-verify Turn off verification (on by default)." |