From 7d4d527a1c831e4b412d1095e568db7f652d23cf Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Thu, 5 May 2022 15:04:58 -0700 Subject: [PATCH] Modify any lines with libc.so!libc.so to libc.so. I had made this change if there was an offset on the line, but I didn't make if there is no offset present. Add the no offset present case. Bug: 206463081 Test: Ran unit tests. Test: Modified a normal stack line with libart.so to be Test: libart.so!libart.so and verified the line numbers Test: are still present. Change-Id: I75e3fbe5eaa3a5419a2dca2c4542731c61c7b971 --- scripts/stack_core.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/stack_core.py b/scripts/stack_core.py index 5a7b981be..5eadef82f 100755 --- a/scripts/stack_core.py +++ b/scripts/stack_core.py @@ -487,6 +487,13 @@ class TraceConverter: apk = area[0:index + 4] if apk: lib_name, lib = self.GetLibFromApk(apk, so_offset) + else: + # Sometimes we'll see something like: + # #01 pc abcd libart.so!libart.so + # Remove everything after the !. + index = area.rfind(".so!") + if index != -1: + area = area[0:index + 3] if not lib: lib = area lib_name = None