Move map data into backtrace data proper.
The backtrace structure used to include a pointer to a backtrace_map_t
that represented the map data for a particular pc. This introduced a
race condition where the pointer could be discarded, but the backtrace
structure still contained a pointer to garbage memory. Now all of the map
information is right in the structure.
Bug: 19028453
Change-Id: If7088a73f3c6bf1f3bc8cdd2bb4b62e7cab831c0
diff --git a/libbacktrace/UnwindCurrent.cpp b/libbacktrace/UnwindCurrent.cpp
index b176aaf..372555b 100755
--- a/libbacktrace/UnwindCurrent.cpp
+++ b/libbacktrace/UnwindCurrent.cpp
@@ -137,9 +137,8 @@
if (!within_handler) {
frame->func_name = GetFunctionName(frame->pc, &frame->func_offset);
- frame->map = FindMap(frame->pc);
+ FillInMap(frame->pc, &frame->map);
} else {
- frame->map = NULL;
frame->func_offset = 0;
}
num_frames++;