OSDN Git Service

Add offset to backtrace_string printing.
authorChristopher Ferris <cferris@google.com>
Fri, 26 May 2017 01:26:37 +0000 (18:26 -0700)
committerChristopher Ferris <cferris@google.com>
Fri, 26 May 2017 01:38:45 +0000 (18:38 -0700)
commitc0352bbd5f8bd4c7696d3b71a0056dcfb2b44708
treeae90fd70a7381d5c9366feb8cfb16a240a06e1cd
parenta559cff654afd31d718d5f476003584f48c5932b
Add offset to backtrace_string printing.

The libmemunreachable code uses backtrace_string to print out the backtrace
information. However, when the offset of the map that a frame is in is
non-zero, no information is printed. This means that when a frame comes from
a shared library loaded from an apk, it's impossible to tell which
shared library the frame is really coming from.

Add the offset display when it's non-zero. This means this can now be fed
to development/scripts/stack to decode the frame.

Bug: 37276041

Test: Ran dumpsys meminfo --unreachable on an app that leaks from a
Test: shared library and verified the offset output is present.
Change-Id: I61d34ae3f617622d354cc099eff520a64782b6e2
libc/malloc_debug/backtrace.cpp