Create an UnwindMapLocal object.
The way libunwind handles local unwinds is different from remote unwinds,
so create a new map object to handle the differences.
Add new test to verify the map data is being generated correctly.
Add new tests to check for leaks.
Refactor the BACK_LOGW code into a single header file.
Change-Id: I01f3cbfc4b927646174ea1b614fa25d23b9b3427
diff --git a/libbacktrace/UnwindMap.h b/libbacktrace/UnwindMap.h
index 5a874e8..2fdb29f 100644
--- a/libbacktrace/UnwindMap.h
+++ b/libbacktrace/UnwindMap.h
@@ -32,8 +32,25 @@
unw_map_cursor_t* GetMapCursor() { return &map_cursor_; }
-private:
+protected:
+ virtual bool GenerateMap();
+
unw_map_cursor_t map_cursor_;
};
+class UnwindMapLocal : public UnwindMap {
+public:
+ UnwindMapLocal();
+ virtual ~UnwindMapLocal();
+
+ virtual bool Build();
+
+ virtual const backtrace_map_t* Find(uintptr_t addr);
+
+protected:
+ virtual bool GenerateMap();
+
+ bool map_created_;
+};
+
#endif // _LIBBACKTRACE_UNWIND_MAP_H