From f9006ec9b6b16e955b29724e4ae05424e11389e0 Mon Sep 17 00:00:00 2001 From: David Srbecky Date: Thu, 1 Feb 2018 14:49:14 +0000 Subject: [PATCH] Fix symbol resolution within a dex file. Fixes the ART 137-cfi test, currently failing on buildbot. Test: testrunner.py -j40 --host --cdex-none -t 137 -b Change-Id: I16a007b291702207bbd003fd1e78e8e5ced7cd68 --- libunwindstack/DexFiles.cpp | 6 +++--- libunwindstack/Unwinder.cpp | 3 ++- libunwindstack/include/unwindstack/DexFiles.h | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/libunwindstack/DexFiles.cpp b/libunwindstack/DexFiles.cpp index 3d67a6a5b..fe6d3c625 100644 --- a/libunwindstack/DexFiles.cpp +++ b/libunwindstack/DexFiles.cpp @@ -52,9 +52,9 @@ DexFile* DexFiles::GetDexFile(uint64_t dex_file_offset, MapInfo* info) { return dex_file; } -void DexFiles::GetMethodInformation(uint64_t dex_offset, MapInfo* info, std::string* method_name, - uint64_t* method_offset) { - DexFile* dex_file = GetDexFile(dex_offset, info); +void DexFiles::GetMethodInformation(uint64_t dex_file_offset, uint64_t dex_offset, MapInfo* info, + std::string* method_name, uint64_t* method_offset) { + DexFile* dex_file = GetDexFile(dex_file_offset, info); if (dex_file != nullptr) { dex_file->GetMethodInformation(dex_offset, method_name, method_offset); } diff --git a/libunwindstack/Unwinder.cpp b/libunwindstack/Unwinder.cpp index d22e1e88a..db8278e5c 100644 --- a/libunwindstack/Unwinder.cpp +++ b/libunwindstack/Unwinder.cpp @@ -95,7 +95,8 @@ void Unwinder::FillInDexFrame() { } #if !defined(NO_LIBDEXFILE_SUPPORT) - dex_files_->GetMethodInformation(dex_offset, info, &frame->function_name, &frame->function_offset); + dex_files_->GetMethodInformation(dex_pc - dex_offset, dex_offset, info, &frame->function_name, + &frame->function_offset); #endif } diff --git a/libunwindstack/include/unwindstack/DexFiles.h b/libunwindstack/include/unwindstack/DexFiles.h index d80e9b73a..50c9c321e 100644 --- a/libunwindstack/include/unwindstack/DexFiles.h +++ b/libunwindstack/include/unwindstack/DexFiles.h @@ -38,10 +38,10 @@ class DexFiles { explicit DexFiles(std::shared_ptr& memory); ~DexFiles(); - DexFile* GetDexFile(uint64_t dex_offset, MapInfo* info); + DexFile* GetDexFile(uint64_t dex_file_offset, MapInfo* info); - void GetMethodInformation(uint64_t dex_offset, MapInfo* info, std::string* method_name, - uint64_t* method_offset); + void GetMethodInformation(uint64_t dex_file_offset, uint64_t dex_offset, MapInfo* info, + std::string* method_name, uint64_t* method_offset); void SetArch(ArchEnum arch);