From 55a9699db337d719ecaeb9c22311c065ee49d19b Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Wed, 13 Mar 2019 15:37:31 -0700 Subject: [PATCH] Add support for soname display in apk. Bug: 29218999 Test: Verified unwind through an apk works with both formats. Change-Id: I20dba918e94024902968ab320dc03e1e343d8a31 --- scripts/stack_core.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/scripts/stack_core.py b/scripts/stack_core.py index e3910ff85..ed4561821 100755 --- a/scripts/stack_core.py +++ b/scripts/stack_core.py @@ -364,8 +364,21 @@ class TraceConverter: # a shared so that was loaded directly out of it. In that case, # extract the shared library and the name of the shared library. lib = None - if area.endswith(".apk") and so_offset: - lib_name, lib = self.GetLibFromApk(area, so_offset) + # The format of the map name: + # Some.apk!libshared.so + # or + # Some.apk + if so_offset: + # If it ends in apk, we are done. + apk = None + if area.endswith(".apk"): + apk = area + else: + index = area.rfind(".apk!") + if index != -1: + apk = area[0:index + 4] + if not apk: + lib_name, lib = self.GetLibFromApk(apk, so_offset) if not lib: lib = area lib_name = None