Move sp/pc not changing check into Unwinder.
Remove this check from the DwarfSection class.
Rather than have every step function make the check, doing it at the
top level avoids having every function do the same check.
Bug: 68167269
Test: New unit tests, ran debuggerd -b on processes.
Change-Id: I23b7c799faaf26c93c1b72848df18c78de6c42fb
diff --git a/libunwindstack/DwarfSection.cpp b/libunwindstack/DwarfSection.cpp
index b8164c5..2292168 100644
--- a/libunwindstack/DwarfSection.cpp
+++ b/libunwindstack/DwarfSection.cpp
@@ -107,7 +107,6 @@
return false;
}
- AddressType prev_pc = regs->pc();
AddressType prev_cfa = regs->sp();
AddressType cfa;
@@ -233,8 +232,8 @@
*finished = (cur_regs->pc() == 0) ? true : false;
cur_regs->set_sp(cfa);
- // Return false if the unwind is not finished or the cfa and pc didn't change.
- return *finished || prev_cfa != cfa || prev_pc != cur_regs->pc();
+
+ return true;
}
template <typename AddressType>