Android stack tool: Treat /data/data as a synonym for /data/user/0.
The Mojo shell prints messages with paths in "/data/user/0" but the
debugger may print paths with "/data/data". These paths are
equivalent ("/data/data" is maintained for backwards compatibility)
so make sure the stack tool understands that when it is mapping
symbols.
BUG=
R=etiennej@chromium.org, ppi@chromium.org
Review URL: https://codereview.chromium.org/1895863004 .
Cr-Mirrored-From: https://github.com/domokit/mojo
Cr-Mirrored-Commit: 25cb8d470c629fbbdddf062181929455330f2925
diff --git a/android_stack_parser/stack_utils.py b/android_stack_parser/stack_utils.py
index f6efb86..9a6bb82 100644
--- a/android_stack_parser/stack_utils.py
+++ b/android_stack_parser/stack_utils.py
@@ -78,8 +78,11 @@
result = regex.search(line)
if result:
url = GetBasenameFromMojoApp(result.group(1))
- mappings[os.path.normpath(result.group(2))] = GetSymboledNameForMojoApp(
- url)
+ path = os.path.normpath(result.group(2))
+ name = GetSymboledNameForMojoApp(url)
+ mappings[path] = name
+ if path.startswith('/data/user/0/'):
+ mappings[path.replace('/data/user/0/', '/data/data/', 1)] = name
return mappings