Loading libunwindstack/DexFiles.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -126,7 +126,7 @@ void DexFiles::Init(Maps* maps) { 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) { if (!(info->flags & PROT_READ) || info->offset != 0) { continue; } Loading libunwindstack/JitDebug.cpp +4 −5 Original line number Diff line number Diff line Loading @@ -174,7 +174,7 @@ void JitDebug::Init(Maps* maps) { const std::string descriptor_name("__jit_debug_descriptor"); for (MapInfo* info : *maps) { if (!(info->flags & PROT_EXEC) || !(info->flags & PROT_READ) || info->offset != 0) { if (!(info->flags & PROT_READ) || info->offset != 0) { continue; } Loading @@ -194,10 +194,9 @@ void JitDebug::Init(Maps* maps) { Elf* elf = info->GetElf(memory_, true); uint64_t descriptor_addr; if (elf->GetGlobalVariable(descriptor_name, &descriptor_addr)) { // Search for the first non-zero entry. descriptor_addr += info->start; entry_addr_ = (this->*read_descriptor_func_)(descriptor_addr); // Find first non-empty entry (libart might be loaded multiple times). if (elf->GetGlobalVariable(descriptor_name, &descriptor_addr) && descriptor_addr != 0) { entry_addr_ = (this->*read_descriptor_func_)(descriptor_addr + info->start); if (entry_addr_ != 0) { break; } Loading libunwindstack/tests/DexFilesTest.cpp +7 −7 Original line number Diff line number Diff line Loading @@ -46,17 +46,17 @@ class DexFilesTest : public ::testing::Test { maps_.reset( new BufferMaps("1000-4000 ---s 00000000 00:00 0\n" "4000-6000 r--s 00000000 00:00 0\n" "6000-8000 -w-s 00000000 00:00 0\n" "a000-c000 r-xp 00000000 00:00 0\n" "c000-f000 rwxp 00000000 00:00 0\n" "f000-11000 r-xp 00000000 00:00 0\n" "6000-8000 -wxs 00000000 00:00 0\n" "a000-c000 r--p 00000000 00:00 0\n" "c000-f000 rw-p 00000000 00:00 0\n" "f000-11000 r--p 00000000 00:00 0\n" "100000-110000 rw-p 0000000 00:00 0\n" "200000-210000 rw-p 0000000 00:00 0\n" "300000-400000 rw-p 0000000 00:00 0\n")); ASSERT_TRUE(maps_->Parse()); // Global variable in a section that is not readable/executable. MapInfo* map_info = maps_->Get(kMapGlobalNonReadableExectable); // Global variable in a section that is not readable. MapInfo* map_info = maps_->Get(kMapGlobalNonReadable); ASSERT_TRUE(map_info != nullptr); MemoryFake* memory = new MemoryFake; ElfFake* elf = new ElfFake(memory); Loading Loading @@ -95,7 +95,7 @@ class DexFilesTest : public ::testing::Test { void WriteEntry64(uint64_t entry_addr, uint64_t next, uint64_t prev, uint64_t dex_file); void WriteDex(uint64_t dex_file); static constexpr size_t kMapGlobalNonReadableExectable = 3; static constexpr size_t kMapGlobalNonReadable = 2; static constexpr size_t kMapGlobalSetToZero = 4; static constexpr size_t kMapGlobal = 5; static constexpr size_t kMapDexFileEntries = 7; Loading libunwindstack/tests/JitDebugTest.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -45,11 +45,11 @@ class JitDebugTest : public ::testing::Test { maps_.reset( new BufferMaps("1000-4000 ---s 00000000 00:00 0\n" "4000-6000 r--s 00000000 00:00 0\n" "6000-8000 -w-s 00000000 00:00 0\n" "6000-8000 -wxs 00000000 00:00 0\n" "a000-c000 --xp 00000000 00:00 0\n" "c000-f000 rwxp 00000000 00:00 0\n" "f000-11000 r-xp 00000000 00:00 0\n" "12000-14000 r-xp 00000000 00:00 0\n" "c000-f000 rw-p 00000000 00:00 0\n" "f000-11000 r--p 00000000 00:00 0\n" "12000-14000 r--p 00000000 00:00 0\n" "100000-110000 rw-p 0000000 00:00 0\n" "200000-210000 rw-p 0000000 00:00 0\n")); ASSERT_TRUE(maps_->Parse()); Loading Loading
libunwindstack/DexFiles.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -126,7 +126,7 @@ void DexFiles::Init(Maps* maps) { 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) { if (!(info->flags & PROT_READ) || info->offset != 0) { continue; } Loading
libunwindstack/JitDebug.cpp +4 −5 Original line number Diff line number Diff line Loading @@ -174,7 +174,7 @@ void JitDebug::Init(Maps* maps) { const std::string descriptor_name("__jit_debug_descriptor"); for (MapInfo* info : *maps) { if (!(info->flags & PROT_EXEC) || !(info->flags & PROT_READ) || info->offset != 0) { if (!(info->flags & PROT_READ) || info->offset != 0) { continue; } Loading @@ -194,10 +194,9 @@ void JitDebug::Init(Maps* maps) { Elf* elf = info->GetElf(memory_, true); uint64_t descriptor_addr; if (elf->GetGlobalVariable(descriptor_name, &descriptor_addr)) { // Search for the first non-zero entry. descriptor_addr += info->start; entry_addr_ = (this->*read_descriptor_func_)(descriptor_addr); // Find first non-empty entry (libart might be loaded multiple times). if (elf->GetGlobalVariable(descriptor_name, &descriptor_addr) && descriptor_addr != 0) { entry_addr_ = (this->*read_descriptor_func_)(descriptor_addr + info->start); if (entry_addr_ != 0) { break; } Loading
libunwindstack/tests/DexFilesTest.cpp +7 −7 Original line number Diff line number Diff line Loading @@ -46,17 +46,17 @@ class DexFilesTest : public ::testing::Test { maps_.reset( new BufferMaps("1000-4000 ---s 00000000 00:00 0\n" "4000-6000 r--s 00000000 00:00 0\n" "6000-8000 -w-s 00000000 00:00 0\n" "a000-c000 r-xp 00000000 00:00 0\n" "c000-f000 rwxp 00000000 00:00 0\n" "f000-11000 r-xp 00000000 00:00 0\n" "6000-8000 -wxs 00000000 00:00 0\n" "a000-c000 r--p 00000000 00:00 0\n" "c000-f000 rw-p 00000000 00:00 0\n" "f000-11000 r--p 00000000 00:00 0\n" "100000-110000 rw-p 0000000 00:00 0\n" "200000-210000 rw-p 0000000 00:00 0\n" "300000-400000 rw-p 0000000 00:00 0\n")); ASSERT_TRUE(maps_->Parse()); // Global variable in a section that is not readable/executable. MapInfo* map_info = maps_->Get(kMapGlobalNonReadableExectable); // Global variable in a section that is not readable. MapInfo* map_info = maps_->Get(kMapGlobalNonReadable); ASSERT_TRUE(map_info != nullptr); MemoryFake* memory = new MemoryFake; ElfFake* elf = new ElfFake(memory); Loading Loading @@ -95,7 +95,7 @@ class DexFilesTest : public ::testing::Test { void WriteEntry64(uint64_t entry_addr, uint64_t next, uint64_t prev, uint64_t dex_file); void WriteDex(uint64_t dex_file); static constexpr size_t kMapGlobalNonReadableExectable = 3; static constexpr size_t kMapGlobalNonReadable = 2; static constexpr size_t kMapGlobalSetToZero = 4; static constexpr size_t kMapGlobal = 5; static constexpr size_t kMapDexFileEntries = 7; Loading
libunwindstack/tests/JitDebugTest.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -45,11 +45,11 @@ class JitDebugTest : public ::testing::Test { maps_.reset( new BufferMaps("1000-4000 ---s 00000000 00:00 0\n" "4000-6000 r--s 00000000 00:00 0\n" "6000-8000 -w-s 00000000 00:00 0\n" "6000-8000 -wxs 00000000 00:00 0\n" "a000-c000 --xp 00000000 00:00 0\n" "c000-f000 rwxp 00000000 00:00 0\n" "f000-11000 r-xp 00000000 00:00 0\n" "12000-14000 r-xp 00000000 00:00 0\n" "c000-f000 rw-p 00000000 00:00 0\n" "f000-11000 r--p 00000000 00:00 0\n" "12000-14000 r--p 00000000 00:00 0\n" "100000-110000 rw-p 0000000 00:00 0\n" "200000-210000 rw-p 0000000 00:00 0\n")); ASSERT_TRUE(maps_->Parse()); Loading