Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ebea0ef2 authored by Josh Gao's avatar Josh Gao
Browse files

libbacktrace: expose BacktraceMap's unwindstack::Memory.

Test: mma
Change-Id: Icd2b891b121b90d55e3ac45037a59c24221a2496
parent 358de18b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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.
//-------------------------------------------------------------------------
+1 −0
Original line number Diff line number Diff line
@@ -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(); }

+5 −0
Original line number Diff line number Diff line
@@ -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_*.