diff options
| author | David Srbecky <dsrbecky@google.com> | 2018-02-15 17:57:16 +0000 |
|---|---|---|
| committer | David Srbecky <dsrbecky@google.com> | 2018-02-16 14:54:49 +0000 |
| commit | 4015ef411a73ac93ff7cf2765a6efa540230a9e4 (patch) | |
| tree | 05483e27e6e7b8d19f4d552ebcca59ada992cfd0 /libunwindstack/DexFiles.cpp | |
| parent | e1ae2ff9e46547dfaa3947eedd5e471332c92a86 (diff) | |
| download | system_core-4015ef411a73ac93ff7cf2765a6efa540230a9e4.tar.gz system_core-4015ef411a73ac93ff7cf2765a6efa540230a9e4.tar.bz2 system_core-4015ef411a73ac93ff7cf2765a6efa540230a9e4.zip | |
Adjust DEX file reading to follow layout changes in ART.
I have changed the root DEX debug descriptor in ART to more
closely follow the JIT debug descriptor. Add the appropriate
offsets to correctly fetch the linked list head for DEX files.
Test: testrunner.py -t 137
Test: libunwindstack_test
Change-Id: I90402befc88fec42658f7330d51ee79756a7f872
Diffstat (limited to 'libunwindstack/DexFiles.cpp')
| -rw-r--r-- | libunwindstack/DexFiles.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libunwindstack/DexFiles.cpp b/libunwindstack/DexFiles.cpp index c5f8138ed..430f6c580 100644 --- a/libunwindstack/DexFiles.cpp +++ b/libunwindstack/DexFiles.cpp @@ -77,7 +77,8 @@ void DexFiles::SetArch(ArchEnum arch) { uint64_t DexFiles::ReadEntryPtr32(uint64_t addr) { uint32_t entry; - if (!memory_->ReadFully(addr, &entry, sizeof(entry))) { + const uint32_t field_offset = 12; // offset of first_entry_ in the descriptor struct. + if (!memory_->ReadFully(addr + field_offset, &entry, sizeof(entry))) { return 0; } return entry; @@ -85,7 +86,8 @@ uint64_t DexFiles::ReadEntryPtr32(uint64_t addr) { uint64_t DexFiles::ReadEntryPtr64(uint64_t addr) { uint64_t entry; - if (!memory_->ReadFully(addr, &entry, sizeof(entry))) { + const uint32_t field_offset = 16; // offset of first_entry_ in the descriptor struct. + if (!memory_->ReadFully(addr + field_offset, &entry, sizeof(entry))) { return 0; } return entry; @@ -122,7 +124,7 @@ void DexFiles::Init(Maps* maps) { initialized_ = true; entry_addr_ = 0; - const std::string dex_debug_name("__art_debug_dexfiles"); + const std::string dex_debug_name("__dex_debug_descriptor"); for (MapInfo* info : *maps) { if (!(info->flags & PROT_EXEC) || !(info->flags & PROT_READ) || info->offset != 0) { continue; |
