summaryrefslogtreecommitdiff
path: root/libunwindstack/Elf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libunwindstack/Elf.cpp')
-rw-r--r--libunwindstack/Elf.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/libunwindstack/Elf.cpp b/libunwindstack/Elf.cpp
index 4b93abb..5b402ed 100644
--- a/libunwindstack/Elf.cpp
+++ b/libunwindstack/Elf.cpp
@@ -243,6 +243,24 @@ bool Elf::IsValidPc(uint64_t pc) {
return false;
}
+bool Elf::GetTextRange(uint64_t* addr, uint64_t* size) {
+ if (!valid_) {
+ return false;
+ }
+
+ if (interface_->GetTextRange(addr, size)) {
+ *addr += load_bias_;
+ return true;
+ }
+
+ if (gnu_debugdata_interface_ != nullptr && gnu_debugdata_interface_->GetTextRange(addr, size)) {
+ *addr += load_bias_;
+ return true;
+ }
+
+ return false;
+}
+
ElfInterface* Elf::CreateInterfaceFromMemory(Memory* memory) {
if (!IsValidElf(memory)) {
return nullptr;