diff options
author | 2023-02-23 17:09:32 +0000 | |
---|---|---|
committer | 2023-02-23 22:04:47 +0000 | |
commit | c2042a191fbaea8f2c51aa76a85f73c4d937a695 (patch) | |
tree | 4095509f6f2c0eed237d5990a3c4b7a82393b300 | |
parent | 2ff66dc52e1bbe65d5e1c934da7b113c046a2fd6 (diff) |
Improve crash reporting of ART tools during build.
ANDROID_BUILD_TOP is not defined when called from soong,
so try the current working dir instead.
Using unqualified path is forbidden since it not hermetic,
and will fail.
Test: Check that crashes produce line numbers.
Change-Id: I379f81e65aade1ee7f1f982e9502417e4fb16cf4
-rw-r--r-- | runtime/native_stack_dump.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/runtime/native_stack_dump.cc b/runtime/native_stack_dump.cc index be41a6807a..d35188d048 100644 --- a/runtime/native_stack_dump.cc +++ b/runtime/native_stack_dump.cc @@ -74,11 +74,11 @@ std::string FindAddr2line() { #endif #if defined(ART_CLANG_PATH) const char* env_value = getenv("ANDROID_BUILD_TOP"); - if (env_value != nullptr) { - return std::string(env_value) + "/" + ART_CLANG_PATH + "/bin/llvm-addr2line"; - } -#endif + std::string_view top(env_value != nullptr ? env_value : "."); + return std::string(top) + "/" + ART_CLANG_PATH + "/bin/llvm-addr2line"; +#else return std::string("llvm-addr2line"); +#endif } ALWAYS_INLINE |