On Oct 14, 6:19 pm, "Chris Peterson (Adobe)" <
chris...@adobe.com>
wrote:
> I am trying to port some stack tracing code (for tracking memory
> leaks) from Linux to Android. The original code used dladdr() to
> resolve function names from program counter addresses.
>
> I see that Android has some libdl functions, but not dladdr(). Is
> there an Android alternative?
Most of the symbolic / debug information is stripped out of the
binaries that ship on the device. Conversion of addresses to names is
generally done on the host side, using a copy of the objects with
symbols (out/target/product/<name>/symbols/system/...).
http://groups.google.com/group/android-developers/browse_thread/thread/73f89bb8739c24bb/5228e7a5dcfff090
Some memory allocation tracking already exists in the sources; see
bionic/libc/bionic/malloc_leak.c. For this purpose, the raw values
are sent up to DDMS, which uses the "symbols" files and arm-eabi-
addr2line to convert values.