summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'libunwindstack/include/unwindstack/Elf.h')
-rw-r--r--libunwindstack/include/unwindstack/Elf.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/libunwindstack/include/unwindstack/Elf.h b/libunwindstack/include/unwindstack/Elf.h
index da2ddc027..d27727b89 100644
--- a/libunwindstack/include/unwindstack/Elf.h
+++ b/libunwindstack/include/unwindstack/Elf.h
@@ -36,6 +36,14 @@ namespace unwindstack {
36struct MapInfo; 36struct MapInfo;
37class Regs; 37class Regs;
38 38
39enum ArchEnum : uint8_t {
40 ARCH_UNKNOWN = 0,
41 ARCH_ARM,
42 ARCH_ARM64,
43 ARCH_X86,
44 ARCH_X86_64,
45};
46
39class Elf { 47class Elf {
40 public: 48 public:
41 Elf(Memory* memory) : memory_(memory) {} 49 Elf(Memory* memory) : memory_(memory) {}
@@ -64,6 +72,8 @@ class Elf {
64 72
65 uint8_t class_type() { return class_type_; } 73 uint8_t class_type() { return class_type_; }
66 74
75 ArchEnum arch() { return arch_; }
76
67 Memory* memory() { return memory_.get(); } 77 Memory* memory() { return memory_.get(); }
68 78
69 ElfInterface* interface() { return interface_.get(); } 79 ElfInterface* interface() { return interface_.get(); }
@@ -74,6 +84,8 @@ class Elf {
74 84
75 static void GetInfo(Memory* memory, bool* valid, uint64_t* size); 85 static void GetInfo(Memory* memory, bool* valid, uint64_t* size);
76 86
87 static uint64_t GetLoadBias(Memory* memory);
88
77 protected: 89 protected:
78 bool valid_ = false; 90 bool valid_ = false;
79 uint64_t load_bias_ = 0; 91 uint64_t load_bias_ = 0;
@@ -81,6 +93,7 @@ class Elf {
81 std::unique_ptr<Memory> memory_; 93 std::unique_ptr<Memory> memory_;
82 uint32_t machine_type_; 94 uint32_t machine_type_;
83 uint8_t class_type_; 95 uint8_t class_type_;
96 ArchEnum arch_;
84 // Protect calls that can modify internal state of the interface object. 97 // Protect calls that can modify internal state of the interface object.
85 std::mutex lock_; 98 std::mutex lock_;
86 99