Elf interface for new unwinder.
This cl includes the code to read arm unwind information from a shared
library.
Bug: 23762183
Test: Passes all unit tests. I can dump the arm unwind information
Test: for an arm shared library.
Change-Id: I43501ea2eab843b81de8bd5128401dd1971af8d3
diff --git a/libunwindstack/ArmExidx.cpp b/libunwindstack/ArmExidx.cpp
index 3b78918..12adf57 100644
--- a/libunwindstack/ArmExidx.cpp
+++ b/libunwindstack/ArmExidx.cpp
@@ -25,6 +25,8 @@
#include "ArmExidx.h"
#include "Log.h"
#include "Machine.h"
+#include "Memory.h"
+#include "Regs.h"
void ArmExidx::LogRawData() {
std::string log_str("Raw Data:");
@@ -216,10 +218,16 @@
cfa_ += 4;
}
}
+
// If the sp register is modified, change the cfa value.
if (registers & (1 << ARM_REG_SP)) {
cfa_ = (*regs_)[ARM_REG_SP];
}
+
+ // Indicate if the pc register was set.
+ if (registers & (1 << ARM_REG_PC)) {
+ pc_set_ = true;
+ }
return true;
}
@@ -296,9 +304,6 @@
return false;
}
}
- if (!(*regs_)[ARM_REG_PC]) {
- (*regs_)[ARM_REG_PC] = (*regs_)[ARM_REG_LR];
- }
status_ = ARM_STATUS_FINISH;
return false;
}
@@ -675,6 +680,7 @@
}
bool ArmExidx::Eval() {
+ pc_set_ = false;
while (Decode());
return status_ == ARM_STATUS_FINISH;
}