diff options
Diffstat (limited to 'libunwindstack/include/unwindstack/Memory.h')
-rw-r--r-- | libunwindstack/include/unwindstack/Memory.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libunwindstack/include/unwindstack/Memory.h b/libunwindstack/include/unwindstack/Memory.h index dee5e98..9c425cb 100644 --- a/libunwindstack/include/unwindstack/Memory.h +++ b/libunwindstack/include/unwindstack/Memory.h @@ -22,6 +22,7 @@ #include <unistd.h> #include <atomic> +#include <map> #include <memory> #include <string> #include <vector> @@ -119,6 +120,9 @@ class MemoryRange : public Memory { size_t Read(uint64_t addr, void* dst, size_t size) override; + uint64_t offset() { return offset_; } + uint64_t length() { return length_; } + private: std::shared_ptr<Memory> memory_; uint64_t begin_; @@ -126,6 +130,19 @@ class MemoryRange : public Memory { uint64_t offset_; }; +class MemoryRanges : public Memory { + public: + MemoryRanges() = default; + virtual ~MemoryRanges() = default; + + void Insert(MemoryRange* memory); + + size_t Read(uint64_t addr, void* dst, size_t size) override; + + private: + std::map<uint64_t, std::unique_ptr<MemoryRange>> maps_; +}; + class MemoryOffline : public Memory { public: MemoryOffline() = default; |