From 5e4b37213dbcc91700d1dc1c0d469ad664fe3b59 Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Fri, 31 Jan 2020 14:38:07 -0800 Subject: [PATCH] Add support for xxx.so!xxx.so lines. When seeing a line like: #01 pc 0012ea14 /system/lib/libart.so!libart.so (offset 0x134000) Treat it like this line instead: #01 pc 0012ea14 /system/lib/libart.so This will allow the symbolizer to properly figure out the line numbers. Bug: 148657674 Test: Ran lines with xxx.so!xxx.so lines and verified that they decode. Change-Id: Ieea516b46a00b414c740d0b4302a5cc73da2b0a8 --- scripts/stack_core.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/stack_core.py b/scripts/stack_core.py index 452d83bb0..977e4cb5f 100755 --- a/scripts/stack_core.py +++ b/scripts/stack_core.py @@ -374,9 +374,17 @@ class TraceConverter: if area.endswith(".apk"): apk = area else: - index = area.rfind(".apk!") + index = area.rfind(".so!") if index != -1: - apk = area[0:index + 4] + # Sometimes we'll see something like: + # #01 pc abcd libart.so!libart.so (offset 0x134000) + # Remove everything after the ! and zero the offset value. + area = area[0:index + 3] + so_offset = 0 + else: + index = area.rfind(".apk!") + if index != -1: + apk = area[0:index + 4] if apk: lib_name, lib = self.GetLibFromApk(apk, so_offset) if not lib: