/system/core/libunwindstack/tests/ |
D | ElfTest.cpp | 111 Elf elf(memory_); in TEST_F() local 113 ASSERT_FALSE(elf.Init()); in TEST_F() 114 ASSERT_FALSE(elf.valid()); in TEST_F() 118 Elf elf(memory_); in TEST_F() local 125 ASSERT_FALSE(elf.Init()); in TEST_F() 126 ASSERT_FALSE(elf.valid()); in TEST_F() 127 ASSERT_TRUE(elf.interface() == nullptr); in TEST_F() 129 ASSERT_EQ("", elf.GetSoname()); in TEST_F() 133 ASSERT_FALSE(elf.GetFunctionName(0, &name, &func_offset)); in TEST_F() 135 ASSERT_FALSE(elf.StepIfSignalHandler(0, nullptr, nullptr)); in TEST_F() [all …]
|
D | MapInfoGetElfTest.cpp | 74 Elf* elf = info.GetElf(process_memory_, ARCH_ARM); in TEST_F() local 75 ASSERT_TRUE(elf != nullptr); in TEST_F() 76 ASSERT_FALSE(elf->valid()); in TEST_F() 86 Elf* elf = info.GetElf(process_memory_, ARCH_ARM); in TEST_F() local 87 ASSERT_TRUE(elf != nullptr); in TEST_F() 88 ASSERT_TRUE(elf->valid()); in TEST_F() 89 EXPECT_EQ(static_cast<uint32_t>(EM_ARM), elf->machine_type()); in TEST_F() 90 EXPECT_EQ(ELFCLASS32, elf->class_type()); in TEST_F() 93 info.elf.reset(); in TEST_F() 94 elf = info.GetElf(std::shared_ptr<Memory>(), ARCH_ARM); in TEST_F() [all …]
|
D | ElfInterfaceTest.cpp | 153 std::unique_ptr<ElfInterface> elf(new ElfInterfaceType(&memory_)); in SinglePtLoad() local 170 ASSERT_TRUE(elf->Init(&load_bias)); in SinglePtLoad() 173 const std::unordered_map<uint64_t, LoadInfo>& pt_loads = elf->pt_loads(); in SinglePtLoad() 191 std::unique_ptr<ElfInterface> elf(new ElfInterfaceType(&memory_)); in MultipleExecutablePtLoads() local 226 ASSERT_TRUE(elf->Init(&load_bias)); in MultipleExecutablePtLoads() 229 const std::unordered_map<uint64_t, LoadInfo>& pt_loads = elf->pt_loads(); in MultipleExecutablePtLoads() 258 std::unique_ptr<ElfInterface> elf(new ElfInterfaceType(&memory_)); in MultipleExecutablePtLoadsIncrementsNotSizeOfPhdr() local 293 ASSERT_TRUE(elf->Init(&load_bias)); in MultipleExecutablePtLoadsIncrementsNotSizeOfPhdr() 296 const std::unordered_map<uint64_t, LoadInfo>& pt_loads = elf->pt_loads(); in MultipleExecutablePtLoadsIncrementsNotSizeOfPhdr() 327 std::unique_ptr<ElfInterface> elf(new ElfInterfaceType(&memory_)); in NonExecutablePtLoads() local [all …]
|
D | JitDebugTest.cpp | 40 ElfFake* elf = new ElfFake(memory); in CreateFakeElf() local 41 elf->FakeSetValid(true); in CreateFakeElf() 43 elf->FakeSetInterface(interface); in CreateFakeElf() 45 map_info->elf.reset(elf); in CreateFakeElf() 241 Elf* elf = jit_debug_->GetElf(maps_.get(), 0x1500); in TEST_F() local 242 ASSERT_TRUE(elf == nullptr); in TEST_F() 247 Elf* elf = jit_debug_->GetElf(maps_.get(), 0x1500); in TEST_F() local 248 ASSERT_TRUE(elf == nullptr); in TEST_F() 254 Elf* elf = jit_debug_->GetElf(maps_.get(), 0x1500); in TEST_F() local 255 ASSERT_TRUE(elf == nullptr); in TEST_F() [all …]
|
D | MapInfoTest.cpp | 40 EXPECT_TRUE(map_info.elf.get() == nullptr); in TEST() 56 EXPECT_TRUE(map_info.elf.get() == nullptr); in TEST() 60 ElfFake* elf = new ElfFake(nullptr); in TEST() local 62 elf->FakeSetInterface(interface); in TEST() 66 map_info.elf.reset(elf); in TEST()
|
D | UnwinderTest.cpp | 48 const char* name, Elf* elf = nullptr) { in AddMapInfo() argument 51 if (elf != nullptr) { in AddMapInfo() 53 map_info->elf.reset(elf); in AddMapInfo() 60 ElfFake* elf = new ElfFake(new MemoryFake); in SetUpTestCase() local 63 elf->FakeSetInterface(interface_fake); in SetUpTestCase() 64 AddMapInfo(0x1000, 0x8000, 0, PROT_READ | PROT_WRITE, "/system/fake/libc.so", elf); in SetUpTestCase() 71 elf = new ElfFake(new MemoryFake); in SetUpTestCase() 72 elf->FakeSetInterface(new ElfInterfaceFake(nullptr)); in SetUpTestCase() 73 AddMapInfo(0x20000, 0x22000, 0, PROT_READ | PROT_WRITE, "/system/fake/libunwind.so", elf); in SetUpTestCase() 75 elf = new ElfFake(new MemoryFake); in SetUpTestCase() [all …]
|
D | MapInfoGetLoadBiasTest.cpp | 72 map_info_->elf.reset(elf_container_.release()); in TEST_F() 82 map_info_->elf.reset(elf_container_.release()); in TEST_F() 125 map_info_->elf.reset(elf_container_.release()); in TEST_F()
|
/system/core/libunwindstack/tools/ |
D | unwind_info.cpp | 40 void DumpArm(Elf* elf, ElfInterfaceArm* interface) { in DumpArm() argument 47 uint64_t load_bias = elf->GetLoadBias(); in DumpArm() 55 if (elf->GetFunctionName(pc + load_bias, &name, &func_offset) && !name.empty()) { in DumpArm() 84 void DumpDwarfSection(Elf* elf, DwarfSection* section, uint64_t) { in DumpDwarfSection() argument 94 if (elf->GetFunctionName(fde->pc_start, &name, &func_offset) && !name.empty()) { in DumpDwarfSection() 115 Elf elf(memory); in GetElfInfo() local 116 if (!elf.Init() || !elf.valid()) { in GetElfInfo() 121 std::string soname(elf.GetSoname()); in GetElfInfo() 126 std::string build_id = elf.GetBuildID(); in GetElfInfo() 135 ElfInterface* interface = elf.interface(); in GetElfInfo() [all …]
|
D | unwind_symbols.cpp | 68 unwindstack::Elf elf(memory); in main() local 69 if (!elf.Init() || !elf.valid()) { in main() 74 std::string soname(elf.GetSoname()); in main() 79 switch (elf.machine_type()) { in main() 101 if (!elf.GetFunctionName(func_addr, &cur_name, &func_offset)) { in main() 114 for (const auto& entry : elf.interface()->pt_loads()) { in main() 120 if (elf.GetFunctionName(addr, &cur_name, &func_offset)) { in main()
|
D | unwind_reg_info.cpp | 175 Elf elf(memory); in GetInfo() local 176 if (!elf.Init() || !elf.valid()) { in GetInfo() 181 ElfInterface* interface = elf.interface(); in GetInfo() 182 uint64_t load_bias = elf.GetLoadBias(); in GetInfo() 188 std::string soname(elf.GetSoname()); in GetInfo() 196 if (elf.GetFunctionName(pc, &function_name, &function_offset)) { in GetInfo() 201 if (elf.machine_type() == EM_ARM) { in GetInfo() 208 PrintRegInformation(section, memory, pc, elf.class_type()); in GetInfo() 216 PrintRegInformation(section, memory, pc, elf.class_type()); in GetInfo() 223 ElfInterface* gnu_debugdata_interface = elf.gnu_debugdata_interface(); in GetInfo() [all …]
|
/system/extras/simpleperf/ |
D | read_elf.cpp | 145 ElfStatus GetBuildIdFromELFFile(const llvm::object::ELFObjectFile<ELFT>* elf, BuildId* build_id) { in GetBuildIdFromELFFile() argument 146 llvm::StringRef data = elf->getData(); in GetBuildIdFromELFFile() 149 for (auto it = elf->section_begin(); it != elf->section_end(); ++it) { in GetBuildIdFromELFFile() 167 if (auto elf = llvm::dyn_cast<llvm::object::ELF32LEObjectFile>(obj)) { in GetBuildIdFromObjectFile() local 168 return GetBuildIdFromELFFile(elf, build_id); in GetBuildIdFromObjectFile() 169 } else if (auto elf = llvm::dyn_cast<llvm::object::ELF64LEObjectFile>(obj)) { in GetBuildIdFromObjectFile() local 170 return GetBuildIdFromELFFile(elf, build_id); in GetBuildIdFromObjectFile() 246 ElfStatus ReadSectionFromELFFile(const llvm::object::ELFObjectFile<ELFT>* elf, const std::string& s… in ReadSectionFromELFFile() argument 248 for (llvm::object::section_iterator it = elf->section_begin(); it != elf->section_end(); ++it) { in ReadSectionFromELFFile() 329 void AddSymbolForPltSection(const llvm::object::ELFObjectFile<ELFT>* elf, in AddSymbolForPltSection() argument [all …]
|
D | read_apk.cpp | 45 std::unique_ptr<EmbeddedElf> elf = FindElfInApkByOffsetWithoutCache(apk_path, file_offset); in FindElfInApkByOffset() local 46 EmbeddedElf* result = elf.get(); in FindElfInApkByOffset() 47 node.offset_map[file_offset] = std::move(elf); in FindElfInApkByOffset() 61 std::unique_ptr<EmbeddedElf> elf = FindElfInApkByNameWithoutCache(apk_path, entry_name); in FindElfInApkByName() local 62 EmbeddedElf* result = elf.get(); in FindElfInApkByName() 65 node.offset_map[result->entry_offset()] = std::move(elf); in FindElfInApkByName()
|
D | dso.cpp | 480 EmbeddedElf* elf = ApkInspector::FindElfInApkByName(std::get<1>(tuple), in GetMinExecutableVaddr() local 482 if (elf == nullptr) { in GetMinExecutableVaddr() 486 elf->filepath(), elf->entry_offset(), elf->entry_size(), build_id, &addr, &offset); in GetMinExecutableVaddr() 552 EmbeddedElf* elf = ApkInspector::FindElfInApkByName(std::get<1>(tuple), std::get<2>(tuple)); in LoadSymbols() local 553 if (elf == nullptr) { in LoadSymbols() 556 status = ParseSymbolsFromEmbeddedElfFile(elf->filepath(), elf->entry_offset(), in LoadSymbols() 557 elf->entry_size(), build_id, symbol_callback); in LoadSymbols() 725 EmbeddedElf* elf = ApkInspector::FindElfInApkByName(std::get<1>(tuple), std::get<2>(tuple)); in GetBuildIdFromDsoPath() local 726 if (elf == nullptr) { in GetBuildIdFromDsoPath() 729 result = GetBuildIdFromEmbeddedElfFile(elf->filepath(), elf->entry_offset(), in GetBuildIdFromDsoPath() [all …]
|
/system/core/libunwindstack/ |
D | MapInfo.cpp | 197 if (elf.get() != nullptr) { in GetElf() 198 return elf.get(); in GetElf() 207 return elf.get(); in GetElf() 216 return elf.get(); in GetElf() 219 elf.reset(new Elf(memory)); in GetElf() 222 elf->Init(); in GetElf() 223 if (elf->valid() && expected_arch != elf->arch()) { in GetElf() 225 elf->Invalidate(); in GetElf() 240 if (prev_map->elf.get() == nullptr) { in GetElf() 241 prev_map->elf = elf; in GetElf() [all …]
|
D | JitDebug.cpp | 78 for (auto* elf : elf_list_) { in ~JitDebug() local 79 delete elf; in ~JitDebug() 192 for (Elf* elf : elf_list_) { in GetElf() 193 if (elf->IsValidPc(pc)) { in GetElf() 194 return elf; in GetElf() 203 Elf* elf = new Elf(new MemoryRange(memory_, start, size, 0)); in GetElf() local 204 elf->Init(); in GetElf() 205 if (!elf->valid()) { in GetElf() 209 delete elf; in GetElf() 212 elf_list_.push_back(elf); in GetElf() [all …]
|
D | LocalUnwinder.cpp | 104 Elf* elf = map_info->GetElf(process_memory_, arch); in Unwind() local 105 uint64_t rel_pc = elf->GetRelPc(cur_pc, map_info); in Unwind() 109 pc_adjustment = regs->GetPcAdjustment(rel_pc, elf); in Unwind() 116 if (elf->StepIfSignalHandler(rel_pc, regs.get(), process_memory_.get())) { in Unwind() 118 } else if (!elf->Step(step_pc, regs.get(), process_memory_.get(), &finished)) { in Unwind() 127 if (elf->GetFunctionName(rel_pc, &func_name, &func_offset)) { in Unwind()
|
D | Unwinder.cpp | 93 FrameData* Unwinder::FillInFrame(MapInfo* map_info, Elf* elf, uint64_t rel_pc, in FillInFrame() argument 111 std::string soname = elf->GetSoname(); in FillInFrame() 122 frame->map_load_bias = elf->GetLoadBias(); in FillInFrame() 159 Elf* elf; in Unwind() local 168 elf = map_info->GetElf(process_memory_, arch); in Unwind() 176 rel_pc = elf->GetRelPc(step_pc, map_info); in Unwind() 182 pc_adjustment = regs_->GetPcAdjustment(rel_pc, elf); in Unwind() 190 if (!elf->valid() && jit_debug_ != nullptr) { in Unwind() 196 elf = jit_elf; in Unwind() 218 frame = FillInFrame(map_info, elf, rel_pc, pc_adjustment); in Unwind() [all …]
|
D | RegsArm.cpp | 54 uint64_t RegsArm::GetPcAdjustment(uint64_t rel_pc, Elf* elf) { in GetPcAdjustment() argument 55 if (!elf->valid()) { in GetPcAdjustment() 59 uint64_t load_bias = elf->GetLoadBias(); in GetPcAdjustment() 77 if (!elf->memory()->ReadFully(adjusted_rel_pc - 5, &value, sizeof(value)) || in GetPcAdjustment() 130 bool RegsArm::StepIfSignalHandler(uint64_t rel_pc, Elf* elf, Memory* process_memory) { in StepIfSignalHandler() argument 132 Memory* elf_memory = elf->memory(); in StepIfSignalHandler()
|
D | Global.cpp | 57 Elf* elf = info->GetElf(memory_, arch()); in GetVariableOffset() local 60 if (elf->GetGlobalVariable(variable, &ptr) && ptr != 0) { in GetVariableOffset()
|
/system/core/libunwindstack/include/unwindstack/ |
D | RegsMips.h | 39 uint64_t GetPcAdjustment(uint64_t rel_pc, Elf* elf) override; 43 bool StepIfSignalHandler(uint64_t rel_pc, Elf* elf, Memory* process_memory) override;
|
D | RegsArm64.h | 39 uint64_t GetPcAdjustment(uint64_t rel_pc, Elf* elf) override; 43 bool StepIfSignalHandler(uint64_t rel_pc, Elf* elf, Memory* process_memory) override;
|
D | RegsArm.h | 39 uint64_t GetPcAdjustment(uint64_t rel_pc, Elf* elf) override; 43 bool StepIfSignalHandler(uint64_t rel_pc, Elf* elf, Memory* process_memory) override;
|
D | RegsMips64.h | 39 uint64_t GetPcAdjustment(uint64_t rel_pc, Elf* elf) override; 43 bool StepIfSignalHandler(uint64_t rel_pc, Elf* elf, Memory* process_memory) override;
|
D | RegsX86_64.h | 40 uint64_t GetPcAdjustment(uint64_t rel_pc, Elf* elf) override; 44 bool StepIfSignalHandler(uint64_t rel_pc, Elf* elf, Memory* process_memory) override;
|
D | RegsX86.h | 40 uint64_t GetPcAdjustment(uint64_t rel_pc, Elf* elf) override; 44 bool StepIfSignalHandler(uint64_t rel_pc, Elf* elf, Memory* process_memory) override;
|