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
diff --git a/libunwindstack/DexFile.cpp b/libunwindstack/DexFile.cpp
index d8d5a24..eaf867f 100644
--- a/libunwindstack/DexFile.cpp
+++ b/libunwindstack/DexFile.cpp
@@ -35,31 +35,22 @@
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;
}