diff options
author | Artem Serov <artem.serov@linaro.org> | 2021-09-20 15:35:26 +0000 |
---|---|---|
committer | Linaro Android Code Review <android-review@review.linaro.org> | 2021-09-20 15:35:26 +0000 |
commit | 09d6701e5a67dc63c540ecd7c10983730bee7287 (patch) | |
tree | ba53a9a2634bc9b023f3d65952802a72cc723622 | |
parent | e753245a16d8265b504cb32793d829738e2d2a39 (diff) | |
parent | 65172257808ce730493b88cb437a2d878396d856 (diff) | |
download | art-build-scripts-09d6701e5a67dc63c540ecd7c10983730bee7287.tar.gz |
Merge "ART: Add gdb-dex2oat options to test_art_host.sh"
-rwxr-xr-x | tests/test_art_host.sh | 10 | ||||
-rw-r--r-- | utils/utils_run.sh | 24 |
2 files changed, 31 insertions, 3 deletions
diff --git a/tests/test_art_host.sh b/tests/test_art_host.sh index b08876e5..20223804 100755 --- a/tests/test_art_host.sh +++ b/tests/test_art_host.sh @@ -37,6 +37,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()" @@ -90,6 +92,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() { @@ -125,6 +132,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 } |