Loading libunwindstack/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -202,6 +202,7 @@ cc_test { "tests/files/offline/jit_debug_x86/*", "tests/files/offline/jit_map_arm/*", "tests/files/offline/gnu_debugdata_arm/*", "tests/files/offline/offset_arm/*", "tests/files/offline/straddle_arm/*", "tests/files/offline/straddle_arm64/*", ], Loading libunwindstack/Elf.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -160,14 +160,14 @@ uint64_t Elf::GetLastErrorAddress() { } // The relative pc is always relative to the start of the map from which it comes. bool Elf::Step(uint64_t rel_pc, uint64_t adjusted_rel_pc, uint64_t elf_offset, Regs* regs, Memory* process_memory, bool* finished) { bool Elf::Step(uint64_t rel_pc, uint64_t adjusted_rel_pc, Regs* regs, Memory* process_memory, bool* finished) { if (!valid_) { return false; } // The relative pc expectd by StepIfSignalHandler is relative to the start of the elf. if (regs->StepIfSignalHandler(rel_pc + elf_offset, this, process_memory)) { if (regs->StepIfSignalHandler(rel_pc, this, process_memory)) { *finished = false; return true; } Loading libunwindstack/Unwinder.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -220,8 +220,7 @@ void Unwinder::Unwind(const std::vector<std::string>* initial_map_names_to_skip, in_device_map = true; } else { bool finished; stepped = elf->Step(rel_pc, step_pc, map_info->elf_offset, regs_, process_memory_.get(), &finished); stepped = elf->Step(rel_pc, step_pc, regs_, process_memory_.get(), &finished); elf->GetLastError(&last_error_); if (stepped && finished) { break; Loading libunwindstack/include/unwindstack/Elf.h +2 −2 Original line number Diff line number Diff line Loading @@ -65,8 +65,8 @@ class Elf { uint64_t GetRelPc(uint64_t pc, const MapInfo* map_info); bool Step(uint64_t rel_pc, uint64_t adjusted_rel_pc, uint64_t elf_offset, Regs* regs, Memory* process_memory, bool* finished); bool Step(uint64_t rel_pc, uint64_t adjusted_rel_pc, Regs* regs, Memory* process_memory, bool* finished); ElfInterface* CreateInterfaceFromMemory(Memory* memory); Loading libunwindstack/tests/ElfTest.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -133,7 +133,7 @@ TEST_F(ElfTest, elf_invalid) { ASSERT_FALSE(elf.GetFunctionName(0, &name, &func_offset)); bool finished; ASSERT_FALSE(elf.Step(0, 0, 0, nullptr, nullptr, &finished)); ASSERT_FALSE(elf.Step(0, 0, nullptr, nullptr, &finished)); } TEST_F(ElfTest, elf32_invalid_machine) { Loading Loading @@ -330,7 +330,7 @@ TEST_F(ElfTest, step_in_signal_map) { elf.FakeSetValid(true); elf.FakeSetLoadBias(0); bool finished; ASSERT_TRUE(elf.Step(0x1000, 0x1000, 0x2000, ®s, &process_memory, &finished)); ASSERT_TRUE(elf.Step(0x3000, 0x1000, ®s, &process_memory, &finished)); EXPECT_FALSE(finished); EXPECT_EQ(15U, regs.pc()); EXPECT_EQ(13U, regs.sp()); Loading Loading @@ -370,7 +370,7 @@ TEST_F(ElfTest, step_in_interface) { EXPECT_CALL(*interface, Step(0x1000, 0, ®s, &process_memory, &finished)) .WillOnce(::testing::Return(true)); ASSERT_TRUE(elf.Step(0x1004, 0x1000, 0x2000, ®s, &process_memory, &finished)); ASSERT_TRUE(elf.Step(0x1004, 0x1000, ®s, &process_memory, &finished)); } TEST_F(ElfTest, step_in_interface_non_zero_load_bias) { Loading @@ -388,7 +388,7 @@ TEST_F(ElfTest, step_in_interface_non_zero_load_bias) { EXPECT_CALL(*interface, Step(0x7300, 0x4000, ®s, &process_memory, &finished)) .WillOnce(::testing::Return(true)); ASSERT_TRUE(elf.Step(0x7304, 0x7300, 0x2000, ®s, &process_memory, &finished)); ASSERT_TRUE(elf.Step(0x7304, 0x7300, ®s, &process_memory, &finished)); } TEST_F(ElfTest, get_global_invalid_elf) { Loading Loading
libunwindstack/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -202,6 +202,7 @@ cc_test { "tests/files/offline/jit_debug_x86/*", "tests/files/offline/jit_map_arm/*", "tests/files/offline/gnu_debugdata_arm/*", "tests/files/offline/offset_arm/*", "tests/files/offline/straddle_arm/*", "tests/files/offline/straddle_arm64/*", ], Loading
libunwindstack/Elf.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -160,14 +160,14 @@ uint64_t Elf::GetLastErrorAddress() { } // The relative pc is always relative to the start of the map from which it comes. bool Elf::Step(uint64_t rel_pc, uint64_t adjusted_rel_pc, uint64_t elf_offset, Regs* regs, Memory* process_memory, bool* finished) { bool Elf::Step(uint64_t rel_pc, uint64_t adjusted_rel_pc, Regs* regs, Memory* process_memory, bool* finished) { if (!valid_) { return false; } // The relative pc expectd by StepIfSignalHandler is relative to the start of the elf. if (regs->StepIfSignalHandler(rel_pc + elf_offset, this, process_memory)) { if (regs->StepIfSignalHandler(rel_pc, this, process_memory)) { *finished = false; return true; } Loading
libunwindstack/Unwinder.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -220,8 +220,7 @@ void Unwinder::Unwind(const std::vector<std::string>* initial_map_names_to_skip, in_device_map = true; } else { bool finished; stepped = elf->Step(rel_pc, step_pc, map_info->elf_offset, regs_, process_memory_.get(), &finished); stepped = elf->Step(rel_pc, step_pc, regs_, process_memory_.get(), &finished); elf->GetLastError(&last_error_); if (stepped && finished) { break; Loading
libunwindstack/include/unwindstack/Elf.h +2 −2 Original line number Diff line number Diff line Loading @@ -65,8 +65,8 @@ class Elf { uint64_t GetRelPc(uint64_t pc, const MapInfo* map_info); bool Step(uint64_t rel_pc, uint64_t adjusted_rel_pc, uint64_t elf_offset, Regs* regs, Memory* process_memory, bool* finished); bool Step(uint64_t rel_pc, uint64_t adjusted_rel_pc, Regs* regs, Memory* process_memory, bool* finished); ElfInterface* CreateInterfaceFromMemory(Memory* memory); Loading
libunwindstack/tests/ElfTest.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -133,7 +133,7 @@ TEST_F(ElfTest, elf_invalid) { ASSERT_FALSE(elf.GetFunctionName(0, &name, &func_offset)); bool finished; ASSERT_FALSE(elf.Step(0, 0, 0, nullptr, nullptr, &finished)); ASSERT_FALSE(elf.Step(0, 0, nullptr, nullptr, &finished)); } TEST_F(ElfTest, elf32_invalid_machine) { Loading Loading @@ -330,7 +330,7 @@ TEST_F(ElfTest, step_in_signal_map) { elf.FakeSetValid(true); elf.FakeSetLoadBias(0); bool finished; ASSERT_TRUE(elf.Step(0x1000, 0x1000, 0x2000, ®s, &process_memory, &finished)); ASSERT_TRUE(elf.Step(0x3000, 0x1000, ®s, &process_memory, &finished)); EXPECT_FALSE(finished); EXPECT_EQ(15U, regs.pc()); EXPECT_EQ(13U, regs.sp()); Loading Loading @@ -370,7 +370,7 @@ TEST_F(ElfTest, step_in_interface) { EXPECT_CALL(*interface, Step(0x1000, 0, ®s, &process_memory, &finished)) .WillOnce(::testing::Return(true)); ASSERT_TRUE(elf.Step(0x1004, 0x1000, 0x2000, ®s, &process_memory, &finished)); ASSERT_TRUE(elf.Step(0x1004, 0x1000, ®s, &process_memory, &finished)); } TEST_F(ElfTest, step_in_interface_non_zero_load_bias) { Loading @@ -388,7 +388,7 @@ TEST_F(ElfTest, step_in_interface_non_zero_load_bias) { EXPECT_CALL(*interface, Step(0x7300, 0x4000, ®s, &process_memory, &finished)) .WillOnce(::testing::Return(true)); ASSERT_TRUE(elf.Step(0x7304, 0x7300, 0x2000, ®s, &process_memory, &finished)); ASSERT_TRUE(elf.Step(0x7304, 0x7300, ®s, &process_memory, &finished)); } TEST_F(ElfTest, get_global_invalid_elf) { Loading