Don't use addr2line for dex and jar files.
Bug: 144594370
Test: Modify a run-test to invoke String.length interpreter intrinsic \
and call Runtime::Abort from interpreter intrinsic implementation
Change-Id: I2997dbfa59ce2bbe9d725f1d7fe7eed565f698fe
diff --git a/runtime/native_stack_dump.cc b/runtime/native_stack_dump.cc
index 0c9e726..74d9033 100644
--- a/runtime/native_stack_dump.cc
+++ b/runtime/native_stack_dump.cc
@@ -234,12 +234,17 @@
std::ostream& os,
const char* prefix,
std::unique_ptr<Addr2linePipe>* pipe /* inout */) {
- DCHECK(pipe != nullptr);
-
- if (map_src == "[vdso]" || android::base::EndsWith(map_src, ".vdex")) {
+ std::array<const char*, 3> kIgnoreSuffixes{ ".dex", ".jar", ".vdex" };
+ for (const char* ignore_suffix : kIgnoreSuffixes) {
+ if (android::base::EndsWith(map_src, ignore_suffix)) {
+ // Ignore file names that do not have map information addr2line can consume. e.g. vdex
+ // files are special frames injected for the interpreter so they don't have any line
+ // number information available.
+ return;
+ }
+ }
+ if (map_src == "[vdso]") {
// addr2line will not work on the vdso.
- // vdex files are special frames injected for the interpreter
- // so they don't have any line number information available.
return;
}