Fix run-test on host.

Change-Id: I44ebb4cdc2f5966be51a063e3c7256ab3016c404
diff --git a/test/etc/default-build b/test/etc/default-build
index 3e5ccd3..01bac6b 100755
--- a/test/etc/default-build
+++ b/test/etc/default-build
@@ -26,7 +26,8 @@
 
 dx -JXmx256m --debug --dex --dump-to=classes.lst --output=classes.dex --dump-width=1000 classes
 zip $TEST_NAME.jar classes.dex
-dex2oatd --boot-image=${ANDROID_PRODUCT_OUT}/data/art-test/core.art --dex-file=$TEST_NAME.jar --dex-location=/data/run-test/$TEST_NAME.jar --oat-file=$TEST_NAME.jar.oat
+
+dex2oatd --boot-image=$IMAGE --dex-file=$TEST_NAME.jar --dex-location=$DEX_LOCATION/$TEST_NAME.jar --oat-file=$TEST_NAME.jar.oat $DEX2OAT_ARGS
 
 if [ -r src-ex ]; then
     mkdir classes-ex
@@ -37,7 +38,7 @@
     mv classes.dex classes-1.dex
     mv classes-ex.dex classes.dex
     zip $TEST_NAME-ex.jar classes.dex
-    dex2oatd --boot-image=${ANDROID_PRODUCT_OUT}/data/art-test/core.art --dex-file=$TEST_NAME-ex.jar --dex-location=/data/run-test/$TEST_NAME-ex.jar --oat-file=$TEST_NAME-ex.jar.oat
+    dex2oatd --boot-image=$IMAGE --dex-file=$TEST_NAME-ex.jar --dex-location=$DEX_LOCATION/$TEST_NAME-ex.jar --oat-file=$TEST_NAME-ex.jar.oat $DEX2OAT_ARGS
     mv classes.dex classes-ex.dex
     mv classes-1.dex classes.dex
 fi
diff --git a/test/etc/host-run-test-jar b/test/etc/host-run-test-jar
index f424487..b56549e 100755
--- a/test/etc/host-run-test-jar
+++ b/test/etc/host-run-test-jar
@@ -61,7 +61,7 @@
 
 HOSTBASE="${ANDROID_BUILD_TOP}/out/host"
 DATA_DIR=/tmp
-DEBUG_OPTS="-Xcheck:jni -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"
+DEBUG_OPTS="-Xcheck:jni"
 
 if [ ! -d $DATA_DIR/art-cache ]; then
     mkdir -p $DATA_DIR/art-cache
@@ -84,7 +84,10 @@
 if [ "$DEBUG" = "y" ]; then
     PORT=8000
     msg "Waiting for debugger to connect on localhost:$PORT"
-    DEX_DEBUG="-agentlib:jdwp=transport=dt_socket,addres=$PORT,server=y,suspend=y"
+	# This is for jdb:
+    DEX_DEBUG="-agentlib:jdwp=transport=dt_socket,address=$PORT,server=y,suspend=y"
+	# Connect thus:
+	#   jdb -attach localhost:12345
 fi
 
 if [ "$GDB" = "y" ]; then
@@ -94,5 +97,5 @@
 
 cd $ANDROID_BUILD_TOP
 $INVOKE_WITH $gdb $exe $gdbargs -Ximage:$ANDROID_ROOT/framework/core.art \
-    $DEX_DEBUG ${DEBUG_OPTS} \
-    -cp test.jar Main "$@"
+    $DEBUG_OPTS $DEX_DEBUG -verbose:log-to=$DEX_LOCATION/log.txt\
+    -cp $DEX_LOCATION/$TEST_NAME.jar Main "$@"