aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtem Serov <artem.serov@linaro.org>2022-03-15 22:01:45 +0000
committerLinaro Android Code Review <android-review@review.linaro.org>2022-03-15 22:01:45 +0000
commit8d26558f1ee0e9c094cc28edf7b3a7d1881cf15f (patch)
tree2c7f2961b09308e5429614cf1275b577fad540db
parent12306558cd8ccd4952a1c02d7f8740d4102ec9c1 (diff)
parent2b40e65c33c65acb58faab0b0db2a1f10f6c4164 (diff)
downloadart-build-scripts-8d26558f1ee0e9c094cc28edf7b3a7d1881cf15f.tar.gz
Merge "Support running dalvikvm under gdb on host."
-rwxr-xr-xtests/test_art_host.sh16
-rwxr-xr-xtests/test_art_simulator.sh16
-rw-r--r--utils/utils_run.sh10
3 files changed, 36 insertions, 6 deletions
diff --git a/tests/test_art_host.sh b/tests/test_art_host.sh
index 20223804..537f7b4a 100755
--- a/tests/test_art_host.sh
+++ b/tests/test_art_host.sh
@@ -37,6 +37,7 @@ declare -A options_format=(
["64bit"]="false"
["default"]="p:set_defaults_wrapper()"
["dump-cfg"]=""
+ ["gdb"]="false"
["gdb-dex2oat"]="false"
["gdb-dex2oat-args"]=""
["gcstress"]="false"
@@ -93,9 +94,17 @@ validate_options() {
exit 1
fi
- if [[ "${options["gdb-dex2oat"]}" == "true" ]] && [[ -z "${options["single-test"]}" ]]; then
- log E "Can only run the debugger on dex2oat for a single test."
- exit 1
+ if [[ "${options["gdb"]}" == "true" || "${options["gdb-dex2oat"]}" == "true" ]]; then
+ if [[ -z "${options["single-test"]}" ]]; then
+ log E "Can only run the debugger for a single test."
+ exit 1
+ fi
+
+ local -r test_name="${options["single-test"]}"
+ if is_single_test_gtest "${test_name}"; then
+ log E "Can't run the debugger for a gtest."
+ exit 1
+ fi
fi
}
@@ -132,6 +141,7 @@ usage() {
generation."
log I " --dump-cfg <path> - dump .cfg to the specified host full path. Only runs for a"
log I " single test"
+ log I " --gdb - Run dalvikvm under gdb. Only runs for a single test."
log I " --gdb-dex2oat - Run dex2oat under lldb. Only runs for a single test."
log I " --gdb-dex2oat-args - Use LLDB with arguments to debug the compiler (dex2oat)
Each argument needs to be separated by a semicolon."
diff --git a/tests/test_art_simulator.sh b/tests/test_art_simulator.sh
index 320c4a94..473b54bb 100755
--- a/tests/test_art_simulator.sh
+++ b/tests/test_art_simulator.sh
@@ -64,6 +64,7 @@ usage() {
generation."
log I " --dump-cfg <path> - dump .cfg to the specified host full path. Only runs for a"
log I " single test"
+ log I " --gdb - Run dalvikvm under gdb. Only runs for a single test."
log I " --gdb-dex2oat - Run dex2oat under lldb. Only runs for a single test."
log I " --gdb-dex2oat-args - Use LLDB with arguments to debug the compiler (dex2oat)
Each argument needs to be separated by a semicolon."
@@ -82,6 +83,7 @@ declare -A options_format=(
["sve"]="false"
["s"]="r:&sve"
["dump-cfg"]=""
+ ["gdb"]="false"
["gdb-dex2oat"]="false"
["gdb-dex2oat-args"]=""
["gcstress"]="false"
@@ -107,9 +109,17 @@ validate_options() {
exit 1
fi
- if [[ "${options["gdb-dex2oat"]}" == "true" ]] && [[ -z "${options["single-test"]}" ]]; then
- log E "Can only run the debugger on dex2oat for a single test."
- exit 1
+ if [[ "${options["gdb"]}" == "true" || "${options["gdb-dex2oat"]}" == "true" ]]; then
+ if [[ -z "${options["single-test"]}" ]]; then
+ log E "Can only run the debugger for a single test."
+ exit 1
+ fi
+
+ local -r test_name="${options["single-test"]}"
+ if is_single_test_gtest "${test_name}"; then
+ log E "Can't run the debugger for a gtest."
+ exit 1
+ fi
fi
}
diff --git a/utils/utils_run.sh b/utils/utils_run.sh
index bf068771..bf346e04 100644
--- a/utils/utils_run.sh
+++ b/utils/utils_run.sh
@@ -55,9 +55,19 @@ run_test_with_python_runner() {
if ${local_options["gcstress"]}; then
test_command+=" --gcstress"
fi
+
if [[ -n "${local_options["dump-cfg"]}" ]]; then
test_command+=" --dump-cfg ${local_options["dump-cfg"]}"
fi
+
+ if ${local_options["gdb"]}; then
+ if [[ "${test_environment}" == "target" ]]; then
+ log E "The --gdb option is only available for host."
+ return 1
+ fi
+ test_command+=" --gdb"
+ fi
+
if ${local_options["gdb-dex2oat"]}; then
if [[ "${test_environment}" == "target" ]]; then
log E "The --gdb-dex2oat option is only available for host."