summaryrefslogtreecommitdiffstats
path: root/libunwindstack/RegsArm64.cpp
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2018-02-21 15:39:07 -0800
committerChristopher Ferris <cferris@google.com>2018-02-21 20:16:39 -0800
commita2ec50bf57c9dba78459ef011cd13f8525ea57b4 (patch)
treeace0f0bd418003176089db54641bd11f00c08244 /libunwindstack/RegsArm64.cpp
parent2733708cfb2ed041e0a82593eeaae5b48ca44a66 (diff)
downloadsystem_core-a2ec50bf57c9dba78459ef011cd13f8525ea57b4.tar.gz
system_core-a2ec50bf57c9dba78459ef011cd13f8525ea57b4.tar.bz2
system_core-a2ec50bf57c9dba78459ef011cd13f8525ea57b4.zip
Change the GetAdjustedRelPc to GetPcAdjustment.
This cleans up a bit of the Unwinder code to make it clear what's going on. Modify the offline unit tests to verify the pc and sp to make sure that those values get computed correctly. Test: Passes unit tests. Test: Passes 137-cfi art tests. Change-Id: I0787a1d77b8726d3defd08f31c7476f6798f8d0d
Diffstat (limited to 'libunwindstack/RegsArm64.cpp')
-rw-r--r--libunwindstack/RegsArm64.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/libunwindstack/RegsArm64.cpp b/libunwindstack/RegsArm64.cpp
index d6b467ade..cc6f5ce87 100644
--- a/libunwindstack/RegsArm64.cpp
+++ b/libunwindstack/RegsArm64.cpp
@@ -35,15 +35,11 @@ ArchEnum RegsArm64::Arch() {
return ARCH_ARM64;
}
-uint64_t RegsArm64::GetAdjustedPc(uint64_t rel_pc, Elf* elf) {
- if (!elf->valid()) {
- return rel_pc;
+uint64_t RegsArm64::GetPcAdjustment(uint64_t rel_pc, Elf* elf) {
+ if (!elf->valid() || rel_pc < 4) {
+ return 0;
}
-
- if (rel_pc < 4) {
- return rel_pc;
- }
- return rel_pc - 4;
+ return 4;
}
void RegsArm64::SetFromRaw() {