summaryrefslogtreecommitdiff
path: root/libunwindstack/include
diff options
context:
space:
mode:
Diffstat (limited to 'libunwindstack/include')
-rw-r--r--libunwindstack/include/unwindstack/ElfInterface.h7
-rw-r--r--libunwindstack/include/unwindstack/MapInfo.h10
-rw-r--r--libunwindstack/include/unwindstack/Maps.h11
3 files changed, 18 insertions, 10 deletions
diff --git a/libunwindstack/include/unwindstack/ElfInterface.h b/libunwindstack/include/unwindstack/ElfInterface.h
index 5cfe74d..5d3cd5e 100644
--- a/libunwindstack/include/unwindstack/ElfInterface.h
+++ b/libunwindstack/include/unwindstack/ElfInterface.h
@@ -60,7 +60,8 @@ class ElfInterface {
virtual bool GetFunctionName(uint64_t addr, uint64_t load_bias, std::string* name,
uint64_t* offset) = 0;
- virtual bool Step(uint64_t rel_pc, Regs* regs, Memory* process_memory, bool* finished);
+ virtual bool Step(uint64_t rel_pc, uint64_t load_bias, Regs* regs, Memory* process_memory,
+ bool* finished);
Memory* CreateGnuDebugdataMemory();
@@ -68,6 +69,8 @@ class ElfInterface {
const std::unordered_map<uint64_t, LoadInfo>& pt_loads() { return pt_loads_; }
+ void SetGnuDebugdataInterface(ElfInterface* interface) { gnu_debugdata_interface_ = interface; }
+
uint64_t dynamic_offset() { return dynamic_offset_; }
uint64_t dynamic_size() { return dynamic_size_; }
uint64_t eh_frame_hdr_offset() { return eh_frame_hdr_offset_; }
@@ -134,6 +137,8 @@ class ElfInterface {
std::unique_ptr<DwarfSection> eh_frame_;
std::unique_ptr<DwarfSection> debug_frame_;
+ // The Elf object owns the gnu_debugdata interface object.
+ ElfInterface* gnu_debugdata_interface_ = nullptr;
std::vector<Symbols*> symbols_;
};
diff --git a/libunwindstack/include/unwindstack/MapInfo.h b/libunwindstack/include/unwindstack/MapInfo.h
index 6f8ceca..22e48f7 100644
--- a/libunwindstack/include/unwindstack/MapInfo.h
+++ b/libunwindstack/include/unwindstack/MapInfo.h
@@ -19,6 +19,7 @@
#include <stdint.h>
+#include <atomic>
#include <mutex>
#include <string>
@@ -33,7 +34,12 @@ struct MapInfo {
MapInfo() = default;
MapInfo(uint64_t start, uint64_t end) : start(start), end(end) {}
MapInfo(uint64_t start, uint64_t end, uint64_t offset, uint64_t flags, const std::string& name)
- : start(start), end(end), offset(offset), flags(flags), name(name) {}
+ : start(start),
+ end(end),
+ offset(offset),
+ flags(flags),
+ name(name),
+ load_bias(static_cast<uint64_t>(-1)) {}
~MapInfo() { delete elf; }
uint64_t start = 0;
@@ -48,6 +54,8 @@ struct MapInfo {
// instead of a portion of the file.
uint64_t elf_offset = 0;
+ std::atomic_uint64_t load_bias;
+
// This function guarantees it will never return nullptr.
Elf* GetElf(const std::shared_ptr<Memory>& process_memory, bool init_gnu_debugdata = false);
diff --git a/libunwindstack/include/unwindstack/Maps.h b/libunwindstack/include/unwindstack/Maps.h
index 34fef7f..17a2d28 100644
--- a/libunwindstack/include/unwindstack/Maps.h
+++ b/libunwindstack/include/unwindstack/Maps.h
@@ -42,6 +42,9 @@ class Maps {
virtual const std::string GetMapsFile() const { return ""; }
+ void Add(uint64_t start, uint64_t end, uint64_t offset, uint64_t flags, const std::string& name,
+ uint64_t load_bias);
+
typedef std::vector<MapInfo*>::iterator iterator;
iterator begin() { return maps_.begin(); }
iterator end() { return maps_.end(); }
@@ -100,14 +103,6 @@ class FileMaps : public Maps {
const std::string file_;
};
-class OfflineMaps : public FileMaps {
- public:
- OfflineMaps(const std::string& file) : FileMaps(file) {}
- virtual ~OfflineMaps() = default;
-
- bool Parse() override;
-};
-
} // namespace unwindstack
#endif // _LIBUNWINDSTACK_MAPS_H