libbacktrace: expose BacktraceMap's unwindstack::Memory.

Test: mma
Change-Id: Icd2b891b121b90d55e3ac45037a59c24221a2496
This commit is contained in:
Josh Gao 2017-09-06 15:39:14 -07:00
parent 358de18b27
commit ebea0ef256
3 changed files with 10 additions and 0 deletions

View File

@ -96,6 +96,10 @@ std::string UnwindStackMap::GetFunctionName(uintptr_t pc, uintptr_t* offset) {
return name;
}
std::shared_ptr<unwindstack::Memory> UnwindStackMap::GetProcessMemory() {
return process_memory_;
}
//-------------------------------------------------------------------------
// BacktraceMap create function.
//-------------------------------------------------------------------------

View File

@ -35,6 +35,7 @@ class UnwindStackMap : public BacktraceMap {
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(); }

View File

@ -46,6 +46,10 @@ struct backtrace_map_t {
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 @@ public:
// 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_*.