summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtest/etc/run-test-jar62
-rwxr-xr-xtest/run-test15
2 files changed, 62 insertions, 15 deletions
diff --git a/test/etc/run-test-jar b/test/etc/run-test-jar
index d37e6bc4f3..f529d67eaa 100755
--- a/test/etc/run-test-jar
+++ b/test/etc/run-test-jar
@@ -16,6 +16,8 @@ BOOT_IMAGE=""
COMPILE_FLAGS=""
DALVIKVM="dalvikvm32"
DEBUGGER="n"
+DEBUGGER_AGENT=""
+WRAP_DEBUGGER_AGENT="n"
DEV_MODE="n"
DEX2OAT=""
EXPERIMENTAL=""
@@ -51,6 +53,7 @@ else
fi
USE_GDB="n"
USE_JVM="n"
+USE_JVMTI="n"
VERIFY="y" # y=yes,n=no,s=softfail
ZYGOTE=""
DEX_VERIFY=""
@@ -108,6 +111,7 @@ while true; do
DEX2OAT_TIMEOUT="$1"
shift
elif [ "x$1" = "x--jvmti" ]; then
+ USE_JVMTI="y"
IS_JVMTI_TEST="y"
shift
elif [ "x$1" = "x-O" ]; then
@@ -180,19 +184,23 @@ while true; do
shift
elif [ "x$1" = "x--jvmti-redefine-stress" ]; then
# APP_IMAGE doesn't really work with jvmti redefine stress
+ USE_JVMTI="y"
APP_IMAGE="n"
JVMTI_STRESS="y"
JVMTI_REDEFINE_STRESS="y"
shift
elif [ "x$1" = "x--jvmti-step-stress" ]; then
+ USE_JVMTI="y"
JVMTI_STRESS="y"
JVMTI_STEP_STRESS="y"
shift
elif [ "x$1" = "x--jvmti-field-stress" ]; then
+ USE_JVMTI="y"
JVMTI_STRESS="y"
JVMTI_FIELD_STRESS="y"
shift
elif [ "x$1" = "x--jvmti-trace-stress" ]; then
+ USE_JVMTI="y"
JVMTI_STRESS="y"
JVMTI_TRACE_STRESS="y"
shift
@@ -220,6 +228,16 @@ while true; do
FLAGS="${FLAGS} -Xcompiler-option --dump-cfg-append"
COMPILE_FLAGS="${COMPILE_FLAGS} --dump-cfg-append"
shift
+ elif [ "x$1" = "x--debug-wrap-agent" ]; then
+ WRAP_DEBUGGER_AGENT="y"
+ shift
+ elif [ "x$1" = "x--debug-agent" ]; then
+ shift
+ DEBUGGER="agent"
+ USE_JVMTI="y"
+ DEBUGGER_AGENT="$1"
+ TIME_OUT="n"
+ shift
elif [ "x$1" = "x--debug" ]; then
DEBUGGER="y"
TIME_OUT="n"
@@ -405,15 +423,43 @@ if [ "$DEBUGGER" = "y" ]; then
fi
msg " jdb -attach localhost:$PORT"
DEBUGGER_OPTS="-agentlib:jdwp=transport=dt_socket,address=$PORT,server=y,suspend=y"
+elif [ "$DEBUGGER" = "agent" ]; then
+ PORT=12345
+ # TODO Support ddms connection and support target.
+ if [ "$HOST" = "n" ]; then
+ echo "--debug-agent not supported yet for target!"
+ exit 1
+ fi
+ AGENTPATH=${DEBUGGER_AGENT}
+ if [ "$WRAP_DEBUGGER_AGENT" = "y" ]; then
+ WRAPPROPS="${ANDROID_ROOT}/${LIBRARY_DIRECTORY}/libwrapagentpropertiesd.so"
+ if [ "$TEST_IS_NDEBUG" = "y" ]; then
+ WRAPPROPS="${ANDROID_ROOT}/${LIBRARY_DIRECTORY}/libwrapagentproperties.so"
+ fi
+ AGENTPATH="${WRAPPROPS}=${ANDROID_BUILD_TOP}/art/tools/libjdwp-compat.props,${AGENTPATH}"
+ fi
+ msg "Connect to localhost:$PORT"
+ DEBUGGER_OPTS="-agentpath:${AGENTPATH}=transport=dt_socket,address=$PORT,server=y,suspend=y"
+fi
+
+if [ "$USE_JVMTI" = "y" ]; then
+ if [ "$USE_JVM" = "n" ]; then
+ plugin=libopenjdkjvmtid.so
+ if [[ "$TEST_IS_NDEBUG" = "y" ]]; then
+ plugin=libopenjdkjvmti.so
+ fi
+ FLAGS="${FLAGS} -Xplugin:${plugin}"
+ FLAGS="${FLAGS} -Xcompiler-option --debuggable"
+ # Always make the compilation be debuggable.
+ COMPILE_FLAGS="${COMPILE_FLAGS} --debuggable"
+ fi
fi
if [ "$IS_JVMTI_TEST" = "y" ]; then
- plugin=libopenjdkjvmtid.so
agent=libtiagentd.so
lib=tiagentd
if [[ "$TEST_IS_NDEBUG" = "y" ]]; then
agent=libtiagent.so
- plugin=libopenjdkjvmti.so
lib=tiagent
fi
@@ -422,19 +468,13 @@ if [ "$IS_JVMTI_TEST" = "y" ]; then
FLAGS="${FLAGS} -agentpath:${ANDROID_HOST_OUT}/nativetest64/${agent}=${TEST_NAME},jvm"
else
FLAGS="${FLAGS} -agentpath:${agent}=${TEST_NAME},art"
- FLAGS="${FLAGS} -Xplugin:${plugin}"
- FLAGS="${FLAGS} -Xcompiler-option --debuggable"
- # Always make the compilation be debuggable.
- COMPILE_FLAGS="${COMPILE_FLAGS} --debuggable"
fi
fi
if [[ "$JVMTI_STRESS" = "y" ]]; then
- plugin=libopenjdkjvmtid.so
agent=libtistressd.so
if [[ "$TEST_IS_NDEBUG" = "y" ]]; then
agent=libtistress.so
- plugin=libopenjdkjvmti.so
fi
# Just give it a default start so we can always add ',' to it.
@@ -459,12 +499,6 @@ if [[ "$JVMTI_STRESS" = "y" ]]; then
FLAGS="${FLAGS} -agentpath:${ANDROID_HOST_OUT}/nativetest64/${agent}=${agent_args}"
else
FLAGS="${FLAGS} -agentpath:${agent}=${agent_args}"
- if [ "$IS_JVMTI_TEST" = "n" ]; then
- FLAGS="${FLAGS} -Xplugin:${plugin}"
- FLAGS="${FLAGS} -Xcompiler-option --debuggable"
- # Always make the compilation be debuggable.
- COMPILE_FLAGS="${COMPILE_FLAGS} --debuggable"
- fi
fi
fi
diff --git a/test/run-test b/test/run-test
index d04cd05e58..09a70e50a9 100755
--- a/test/run-test
+++ b/test/run-test
@@ -288,6 +288,14 @@ while true; do
elif [ "x$1" = "x--debug" ]; then
run_args="${run_args} --debug"
shift
+ elif [ "x$1" = "x--debug-wrap-agent" ]; then
+ run_args="${run_args} --debug-wrap-agent"
+ shift
+ elif [ "x$1" = "x--debug-agent" ]; then
+ shift
+ option="$1"
+ run_args="${run_args} --debug-agent $1"
+ shift
elif [ "x$1" = "x--gdb" ]; then
run_args="${run_args} --gdb"
dev_mode="yes"
@@ -647,7 +655,12 @@ if [ "$usage" = "yes" ]; then
echo " -Xcompiler-option Pass an option to the compiler."
echo " --build-option Pass an option to the build script."
echo " --runtime-option Pass an option to the runtime."
- echo " --debug Wait for a debugger to attach."
+ echo " --debug Wait for the default debugger to attach."
+ echo " --debug-agent <agent-path>"
+ echo " Wait for the given debugger agent to attach. Currently"
+ echo " only supported on host."
+ echo " --debug-wrap-agent use libwrapagentproperties and tools/libjdwp-compat.props"
+ echo " to load the debugger agent specified by --debug-agent."
echo " --debuggable Whether to compile Java code for a debugger."
echo " --gdb Run under gdb; incompatible with some tests."
echo " --gdb-arg Pass an option to gdb."