libbacktrace: expose BacktraceMap's unwindstack::Memory.
Test: mma
Change-Id: Icd2b891b121b90d55e3ac45037a59c24221a2496
diff --git a/libbacktrace/UnwindStackMap.cpp b/libbacktrace/UnwindStackMap.cpp
index a9121a8..e7e5e4c 100644
--- a/libbacktrace/UnwindStackMap.cpp
+++ b/libbacktrace/UnwindStackMap.cpp
@@ -96,6 +96,10 @@
return name;
}
+std::shared_ptr<unwindstack::Memory> UnwindStackMap::GetProcessMemory() {
+ return process_memory_;
+}
+
//-------------------------------------------------------------------------
// BacktraceMap create function.
//-------------------------------------------------------------------------
diff --git a/libbacktrace/UnwindStackMap.h b/libbacktrace/UnwindStackMap.h
index 2a8af83..bc432e7 100644
--- a/libbacktrace/UnwindStackMap.h
+++ b/libbacktrace/UnwindStackMap.h
@@ -35,6 +35,7 @@
void FillIn(uintptr_t addr, backtrace_map_t* map) override;
virtual std::string GetFunctionName(uintptr_t pc, uintptr_t* offset) override;
+ virtual std::shared_ptr<unwindstack::Memory> GetProcessMemory() override final;
unwindstack::Maps* stack_maps() { return stack_maps_.get(); }
diff --git a/libbacktrace/include/backtrace/BacktraceMap.h b/libbacktrace/include/backtrace/BacktraceMap.h
index 104479d..e176c78 100644
--- a/libbacktrace/include/backtrace/BacktraceMap.h
+++ b/libbacktrace/include/backtrace/BacktraceMap.h
@@ -46,6 +46,10 @@
std::string name;
};
+namespace unwindstack {
+class Memory;
+}
+
class BacktraceMap {
public:
// If uncached is true, then parse the current process map as of the call.
@@ -64,6 +68,7 @@
// Only supported with the new unwinder.
virtual std::string GetFunctionName(uintptr_t /*pc*/, uintptr_t* /*offset*/) { return ""; }
+ virtual std::shared_ptr<unwindstack::Memory> GetProcessMemory() { return nullptr; }
// The flags returned are the same flags as used by the mmap call.
// The values are PROT_*.