summaryrefslogtreecommitdiff
path: root/libunwindstack/Elf.cpp
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2017-07-19 15:50:22 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-07-19 15:50:22 +0000
commit9f7c071743effb977ba19f4efeece55da09eb707 (patch)
tree70c4716dbbb062911e37eee1e8382c3c4ed2bb59 /libunwindstack/Elf.cpp
parent57db1511bdc8f1317997edc1850650f60055ad0c (diff)
parent2f80aa506fd17d84f00371f42b9bb274162cab6d (diff)
Merge "Add signal handling to the register object." am: 33913ebfb5 am: b945cc6de0
am: 2f80aa506f Change-Id: I0df6230ffb131aa0537802e00192ce9154963d02
Diffstat (limited to 'libunwindstack/Elf.cpp')
-rw-r--r--libunwindstack/Elf.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/libunwindstack/Elf.cpp b/libunwindstack/Elf.cpp
index a800c31246..e962a73197 100644
--- a/libunwindstack/Elf.cpp
+++ b/libunwindstack/Elf.cpp
@@ -96,7 +96,8 @@ bool Elf::GetFunctionName(uint64_t addr, std::string* name, uint64_t* func_offse
}
bool Elf::Step(uint64_t rel_pc, Regs* regs, Memory* process_memory) {
- return valid_ && (interface_->Step(rel_pc, regs, process_memory) ||
+ return valid_ && (regs->StepIfSignalHandler(process_memory) ||
+ interface_->Step(rel_pc, regs, process_memory) ||
(gnu_debugdata_interface_ &&
gnu_debugdata_interface_->Step(rel_pc, regs, process_memory)));
}
@@ -147,21 +148,22 @@ ElfInterface* Elf::CreateInterfaceFromMemory(Memory* memory) {
machine_type_ = e_machine;
if (e_machine == EM_ARM) {
interface.reset(new ElfInterfaceArm(memory));
- } else {
+ } else if (e_machine == EM_386) {
interface.reset(new ElfInterface32(memory));
+ } else {
+ ALOGI("32 bit elf that is neither arm nor x86: e_machine = %d\n", e_machine);
+ return nullptr;
}
} else if (class_type_ == ELFCLASS64) {
Elf64_Half e_machine;
if (!memory->Read(EI_NIDENT + sizeof(Elf64_Half), &e_machine, sizeof(e_machine))) {
return nullptr;
}
-
if (e_machine != EM_AARCH64 && e_machine != EM_X86_64) {
// Unsupported.
ALOGI("64 bit elf that is neither aarch64 nor x86_64: e_machine = %d\n", e_machine);
return nullptr;
}
-
machine_type_ = e_machine;
interface.reset(new ElfInterface64(memory));
}