aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStelios Ioannou <stelios.ioannou@linaro.org>2021-08-18 12:46:20 +0100
committerStelios Ioannou <stelios.ioannou@linaro.org>2021-09-11 02:34:31 +0100
commit65172257808ce730493b88cb437a2d878396d856 (patch)
tree107e75680af34919dff2ba13cb3e5ee0a870a17d
parent22bbceb875dc61a9dec480c458ad294afc9acacb (diff)
downloadart-build-scripts-65172257808ce730493b88cb437a2d878396d856.tar.gz
ART: Add gdb-dex2oat options to test_art_host.sh
This patch adds the --gdb-dex2oat and --gdb-dex2oat-args option for the test_art_host.sh script. Note that this option is only available when running a single test. When the --single-test and --gdb-dex2oat options are present, logging is disabled so that the key bindings and colours of the debugger can function as expected. Test: ./scripts/tests/test_art_host.sh --single-test \ test-art-host-run-test-debug-prebuild-optimizing-no-relocate\ -ntrace-cms-checkjni-picimage-ndebuggable\-no-jvmti-cdex-\ fast-404-optimizing-allocator64 --gdb-dex2oat \ --gdb-dex2oat-args '-X' Change-Id: I483e322dbf6287f1ac0e12c5cf32ee5a0969ffcc
-rwxr-xr-xtests/test_art_host.sh10
-rw-r--r--utils/utils_run.sh24
2 files changed, 31 insertions, 3 deletions
diff --git a/tests/test_art_host.sh b/tests/test_art_host.sh
index a5c76b4f..9918910a 100755
--- a/tests/test_art_host.sh
+++ b/tests/test_art_host.sh
@@ -38,6 +38,8 @@ declare -A options_format=(
["64bit"]="false"
["default"]="p:set_defaults_wrapper()"
["dump-cfg"]=""
+ ["gdb-dex2oat"]="false"
+ ["gdb-dex2oat-args"]=""
["gcstress"]="false"
["gtest"]="false"
["help"]="p:usage()"
@@ -91,6 +93,11 @@ validate_options() {
log E "Can only dump .cfg for a single test."
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
+ fi
}
set_job_count() {
@@ -126,6 +133,9 @@ 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-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."
log I "-------------------------------------------"
log I "Tests:"
log I " --gtest - run gtests."
diff --git a/utils/utils_run.sh b/utils/utils_run.sh
index 85d9eef0..b1cd905f 100644
--- a/utils/utils_run.sh
+++ b/utils/utils_run.sh
@@ -42,6 +42,16 @@ run_test_with_python_runner() {
if [[ -n "${local_options["dump-cfg"]}" ]]; then
test_command+=" --dump-cfg ${local_options["dump-cfg"]}"
fi
+ if ${local_options["gdb-dex2oat"]}; then
+ if [[ "$5" != "host" ]]; then
+ log E "The --gdb-dex2oat option is only available for host."
+ return 1
+ fi
+ test_command+=" --gdb-dex2oat"
+ if [[ -n "${local_options["gdb-dex2oat-args"]}" ]]; then
+ test_command+=" --gdb-dex2oat-args='${local_options["gdb-dex2oat-args"]}"\'
+ fi
+ fi
if [[ $1 == "single-test" ]]; then
test_command+=" -t $3 --run-test --${4}"
else
@@ -126,10 +136,18 @@ test_single() {
fi
fi
else
- section_name+="ART_$1"
- section_starter "${section_name}" "${2}"
+ # Start logging for non-debug sections. Logging is
+ # disabled when debugging so that the key bindings and
+ # colours of the debugger can function as expected.
+ if [[ "${local_options["gdb-dex2oat"]}" == "false" ]]; then
+ section_name+="ART_$1"
+ section_starter "${section_name}" "${2}"
+ fi
run_test_unwrapped "single-test" "" "${test_name}" "$1" "$2" "$3" "$4"
return_code=$?
fi
- section_ender "${section_name}" "$2" "${return_code}" "${local_options["keep-going"]}"
+ # End logging for non-debug sections.
+ if [[ "${local_options["gdb-dex2oat"]}" == "false" ]]; then
+ section_ender "${section_name}" "$2" "${return_code}" "${local_options["keep-going"]}"
+ fi
}