From a2ec50bf57c9dba78459ef011cd13f8525ea57b4 Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Wed, 21 Feb 2018 15:39:07 -0800 Subject: 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 --- libunwindstack/RegsX86_64.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'libunwindstack/RegsX86_64.cpp') diff --git a/libunwindstack/RegsX86_64.cpp b/libunwindstack/RegsX86_64.cpp index 0f66943aa..3175a90c2 100644 --- a/libunwindstack/RegsX86_64.cpp +++ b/libunwindstack/RegsX86_64.cpp @@ -35,16 +35,11 @@ ArchEnum RegsX86_64::Arch() { return ARCH_X86_64; } -uint64_t RegsX86_64::GetAdjustedPc(uint64_t rel_pc, Elf* elf) { - if (!elf->valid()) { - return rel_pc; - } - - if (rel_pc == 0) { +uint64_t RegsX86_64::GetPcAdjustment(uint64_t rel_pc, Elf* elf) { + if (!elf->valid() || rel_pc == 0) { return 0; } - - return rel_pc - 1; + return 1; } void RegsX86_64::SetFromRaw() { -- cgit v1.2.3