diff options
author | David Srbecky <dsrbecky@google.com> | 2019-04-05 18:23:32 +0000 |
---|---|---|
committer | David Srbecky <dsrbecky@google.com> | 2019-04-12 12:55:50 +0000 |
commit | e5c4d62ba3fca09fed86ec605542b2be74a59851 (patch) | |
tree | da853107155df86b564454aad59b8ca9a5fcf598 /libunwindstack/DexFile.cpp | |
parent | 84ababefb7b7ec04027b741d7a6fe937cffee54b (diff) | |
download | system_core-e5c4d62ba3fca09fed86ec605542b2be74a59851.tar.gz system_core-e5c4d62ba3fca09fed86ec605542b2be74a59851.tar.bz2 system_core-e5c4d62ba3fca09fed86ec605542b2be74a59851.zip |
Revert "Check for data races when reading JIT/DEX entries."
This reverts commit 85b5fecec920208ec43b42488f08d4c2e5aaeda2.
Reason for revert: Breaks ART tests, reverting to investigate.
Exempt-From-Owner-Approval: Revert.
(cherry picked from commit b9cc4fbb268652744c812415cb2e5d1fbe04879a)
Bug: 130406806
Change-Id: I634e37060b97484d627fc544e3b406fd90aaa784
Diffstat (limited to 'libunwindstack/DexFile.cpp')
-rw-r--r-- | libunwindstack/DexFile.cpp | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/libunwindstack/DexFile.cpp b/libunwindstack/DexFile.cpp index d8d5a24de..eaf867fd0 100644 --- a/libunwindstack/DexFile.cpp +++ b/libunwindstack/DexFile.cpp @@ -35,31 +35,22 @@ namespace unwindstack { std::unique_ptr<DexFile> DexFile::Create(uint64_t dex_file_offset_in_memory, Memory* memory, MapInfo* info) { if (!info->name.empty()) { - std::unique_ptr<DexFile> dex_file_from_file = + std::unique_ptr<DexFile> dex_file = DexFileFromFile::Create(dex_file_offset_in_memory - info->start + info->offset, info->name); - if (dex_file_from_file) { - dex_file_from_file->addr_ = dex_file_offset_in_memory; - return dex_file_from_file; + if (dex_file) { + return dex_file; } } - std::unique_ptr<DexFile> dex_file_from_memory = - DexFileFromMemory::Create(dex_file_offset_in_memory, memory, info->name); - if (dex_file_from_memory) { - dex_file_from_memory->addr_ = dex_file_offset_in_memory; - return dex_file_from_memory; - } - return nullptr; + return DexFileFromMemory::Create(dex_file_offset_in_memory, memory, info->name); } -bool DexFile::GetFunctionName(uint64_t dex_pc, std::string* method_name, uint64_t* method_offset) { - uint64_t dex_offset = dex_pc - addr_; +bool DexFile::GetMethodInformation(uint64_t dex_offset, std::string* method_name, + uint64_t* method_offset) { art_api::dex::MethodInfo method_info = GetMethodInfoForOffset(dex_offset, false); if (method_info.offset == 0) { return false; } - if (method_name != nullptr) { - *method_name = method_info.name; - } + *method_name = method_info.name; *method_offset = dex_offset - method_info.offset; return true; } |