Always use llvm-addr2line for DumpNativeStack
Bug: 232402476
Test: m
Change-Id: Ic1ce44e94e35b36b4344a97b3692ffd353dd91fe
diff --git a/runtime/native_stack_dump.cc b/runtime/native_stack_dump.cc
index b7c3665..1f09f45 100644
--- a/runtime/native_stack_dump.cc
+++ b/runtime/native_stack_dump.cc
@@ -69,13 +69,16 @@
static constexpr bool kUseAddr2line = !kIsTargetBuild;
std::string FindAddr2line() {
-#ifdef ART_CLANG_PATH
+#if !defined(ART_TARGET_ANDROID) and !defined(ART_CLANG_PATH)
+ #error "ART_CLANG_PATH must be defined on host build"
+#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
- return std::string("/usr/bin/addr2line");
+ return std::string("llvm-addr2line");
}
ALWAYS_INLINE