The munmap() kernel calls are traced but the tracing code wasn't doing
anything with them. This caused the number of mapped regions in a process
to grow large in some cases and also caused symbol lookup errors in some
rare cases. This change also adds support for new trace record types
for supporting JNI (native) calls from Java into native code. This helps
with constructing a more accurate call stack.
The check_stack program checks that the generated stack that includes both
native functions and Java methods (generated from the emulator instruction
trace plus the method trace) is consistent with the stack of Java methods
that is computed from the method trace alone. (The method trace is
generated by the Dalvik interpreter).
This fixes a bug that was causing a "stack overflow" because it sometimes
wasn't popping off a Java method when it should have. I also changed the
showStack() method so that instead of always printing to stderr, you can
pass in a FILE* object to print to.