/system/core/libunwindstack/tests/ |
D | ElfTest.cpp | 113 Elf elf(memory_); in TEST_F() local 115 ASSERT_FALSE(elf.Init()); in TEST_F() 116 ASSERT_FALSE(elf.valid()); in TEST_F() 120 Elf elf(memory_); in TEST_F() local 127 ASSERT_FALSE(elf.Init()); in TEST_F() 128 ASSERT_FALSE(elf.valid()); in TEST_F() 129 ASSERT_TRUE(elf.interface() == nullptr); in TEST_F() 131 ASSERT_EQ("", elf.GetSoname()); in TEST_F() 135 ASSERT_FALSE(elf.GetFunctionName(0, &name, &func_offset)); in TEST_F() 137 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 | 174 std::unique_ptr<ElfInterface> elf(new ElfInterfaceType(&memory_)); in SinglePtLoad() local 191 ASSERT_TRUE(elf->Init(&load_bias)); in SinglePtLoad() 194 const std::unordered_map<uint64_t, LoadInfo>& pt_loads = elf->pt_loads(); in SinglePtLoad() 212 std::unique_ptr<ElfInterface> elf(new ElfInterfaceType(&memory_)); in MultipleExecutablePtLoads() local 247 ASSERT_TRUE(elf->Init(&load_bias)); in MultipleExecutablePtLoads() 250 const std::unordered_map<uint64_t, LoadInfo>& pt_loads = elf->pt_loads(); in MultipleExecutablePtLoads() 279 std::unique_ptr<ElfInterface> elf(new ElfInterfaceType(&memory_)); in MultipleExecutablePtLoadsIncrementsNotSizeOfPhdr() local 314 ASSERT_TRUE(elf->Init(&load_bias)); in MultipleExecutablePtLoadsIncrementsNotSizeOfPhdr() 317 const std::unordered_map<uint64_t, LoadInfo>& pt_loads = elf->pt_loads(); in MultipleExecutablePtLoadsIncrementsNotSizeOfPhdr() 348 std::unique_ptr<ElfInterface> elf(new ElfInterfaceType(&memory_)); in NonExecutablePtLoads() local [all …]
|
D | JitDebugTest.cpp | 41 ElfFake* elf = new ElfFake(memory); in CreateFakeElf() local 42 elf->FakeSetValid(true); in CreateFakeElf() 44 elf->FakeSetInterface(interface); in CreateFakeElf() 49 map_info->elf.reset(elf); in CreateFakeElf() 245 Elf* elf = jit_debug_->GetElf(maps_.get(), 0x1500); in TEST_F() local 246 ASSERT_TRUE(elf == nullptr); in TEST_F() 251 Elf* elf = jit_debug_->GetElf(maps_.get(), 0x1500); in TEST_F() local 252 ASSERT_TRUE(elf == nullptr); in TEST_F() 258 Elf* elf = jit_debug_->GetElf(maps_.get(), 0x1500); in TEST_F() local 259 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 | VerifyBionicTerminationTest.cpp | 72 Elf elf(Memory::CreateFileMemory(frame.map_name, 0).release()); in VerifyReturnAddress() local 73 ASSERT_TRUE(elf.Init()) << "Failed to init elf object from " << frame.map_name; in VerifyReturnAddress() 74 ASSERT_TRUE(elf.valid()) << "Elf " << frame.map_name << " is not valid."; in VerifyReturnAddress() 75 ElfInterface* interface = elf.interface(); in VerifyReturnAddress()
|
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 SetUpTestSuite() local 63 elf->FakeSetInterface(interface_fake); in SetUpTestSuite() 64 AddMapInfo(0x1000, 0x8000, 0, PROT_READ | PROT_WRITE, "/system/fake/libc.so", elf); in SetUpTestSuite() 71 elf = new ElfFake(new MemoryFake); in SetUpTestSuite() 72 elf->FakeSetInterface(new ElfInterfaceFake(nullptr)); in SetUpTestSuite() 73 AddMapInfo(0x20000, 0x22000, 0, PROT_READ | PROT_WRITE, "/system/fake/libunwind.so", elf); in SetUpTestSuite() 75 elf = new ElfFake(new MemoryFake); in SetUpTestSuite() [all …]
|
/system/core/libunwindstack/tools/ |
D | unwind_info.cpp | 41 void DumpArm(Elf* elf, ElfInterfaceArm* interface) { in DumpArm() argument 48 uint64_t load_bias = elf->GetLoadBias(); in DumpArm() 56 if (elf->GetFunctionName(pc + load_bias, &name, &func_offset) && !name.empty()) { in DumpArm() 85 void DumpDwarfSection(Elf* elf, DwarfSection* section, uint64_t) { in DumpDwarfSection() argument 95 if (elf->GetFunctionName(fde->pc_start, &name, &func_offset) && !name.empty()) { in DumpDwarfSection() 99 if (!section->Log(2, UINT64_MAX, fde, elf->arch())) { in DumpDwarfSection() 109 Elf elf(Memory::CreateFileMemory(file, offset).release()); in GetElfInfo() local 110 if (!elf.Init() || !elf.valid()) { in GetElfInfo() 115 std::string soname(elf.GetSoname()); in GetElfInfo() 120 std::string build_id = elf.GetBuildID(); in GetElfInfo() [all …]
|
D | unwind_reg_info.cpp | 175 Elf elf(Memory::CreateFileMemory(file, offset).release()); 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, elf.memory(), pc, elf.class_type(), elf.arch()); in GetInfo() 216 PrintRegInformation(section, elf.memory(), pc, elf.class_type(), elf.arch()); in GetInfo() 223 ElfInterface* gnu_debugdata_interface = elf.gnu_debugdata_interface(); in GetInfo() [all …]
|
D | unwind_symbols.cpp | 62 unwindstack::Elf elf(unwindstack::Memory::CreateFileMemory(argv[1], 0).release()); in main() local 63 if (!elf.Init() || !elf.valid()) { in main() 68 std::string soname(elf.GetSoname()); in main() 73 switch (elf.machine_type()) { in main() 95 if (!elf.GetFunctionName(func_addr, &cur_name, &func_offset)) { in main() 108 for (const auto& entry : elf.interface()->pt_loads()) { in main() 114 if (elf.GetFunctionName(addr, &cur_name, &func_offset)) { in main()
|
/system/extras/simpleperf/ |
D | read_elf_test.cpp | 68 auto elf = ElfFile::Open(GetTestData(ELF_FILE), &status); in TEST() local 70 ASSERT_EQ(ElfStatus::NO_ERROR, elf->GetBuildId(&build_id)); in TEST() 78 auto elf = ElfFile::Open(GetTestData(path), &status); in TEST() local 80 ASSERT_EQ(ElfStatus::NO_ERROR, elf->GetBuildId(&build_id)); in TEST() 109 auto elf = ElfFile::Open(GetTestData(ELF_FILE), &elf_file_build_id, &status); in TEST() local 112 elf->ParseSymbols(std::bind(ParseSymbol, std::placeholders::_1, &symbols))); in TEST() 120 auto elf = ElfFile::Open(GetTestData(ELF_FILE), &status); in TEST() local 123 elf->ParseSymbols(std::bind(ParseSymbol, std::placeholders::_1, &symbols))); in TEST() 129 elf = ElfFile::Open(GetTestData(ELF_FILE), &build_id, &status); in TEST() 132 elf->ParseSymbols(std::bind(ParseSymbol, std::placeholders::_1, &symbols))); in TEST() [all …]
|
D | read_elf.cpp | 258 void AddSymbolForPltSection(const llvm::object::ELFObjectFile<ELFT>* elf, in AddSymbolForPltSection() argument 266 for (auto it = elf->section_begin(); it != elf->section_end(); ++it) { in AddSymbolForPltSection() 273 const auto* shdr = elf->getSection(section_ref.getRawDataRefImpl()); in AddSymbolForPltSection() 290 void CheckSymbolSections(const llvm::object::ELFObjectFile<ELFT>* elf, in CheckSymbolSections() argument 294 for (auto it = elf->section_begin(); it != elf->section_end(); ++it) { in CheckSymbolSections() 479 auto elf = Open(filename, &status); in Open() local 480 if (!elf) { in Open() 483 return elf; in Open() 491 EmbeddedElf* elf = ApkInspector::FindElfInApkByName(std::get<1>(tuple), std::get<2>(tuple)); in Open() local 492 if (elf == nullptr) { in Open() [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 | 93 auto elf = ElfFile::Open(path, &status); in CollectBuildIdInDir() local 94 if (status == ElfStatus::NO_ERROR && elf->GetBuildId(&build_id) == ElfStatus::NO_ERROR) { in CollectBuildIdInDir() 112 auto elf = ElfFile::Open(path, &status); in CheckDebugFilePath() local 113 if (!elf) { in CheckDebugFilePath() 117 status = elf->GetBuildId(&debug_build_id); in CheckDebugFilePath() 508 auto elf = ElfFile::Open(debug_file_path_, &build_id, &status); in GetMinExecutableVaddr() local 509 if (elf) { in GetMinExecutableVaddr() 510 min_vaddr_ = elf->ReadMinExecutableVaddr(&file_offset_of_min_vaddr_); in GetMinExecutableVaddr() 566 auto elf = ElfFile::Open(debug_file_path_, &build_id, &status); in LoadSymbols() local 567 if (elf) { in LoadSymbols() [all …]
|
/system/core/libunwindstack/ |
D | MapInfo.cpp | 200 if (elf.get() != nullptr) { in GetElf() 201 return elf.get(); in GetElf() 210 return elf.get(); in GetElf() 219 return elf.get(); in GetElf() 222 elf.reset(new Elf(memory)); in GetElf() 225 elf->Init(); in GetElf() 226 if (elf->valid() && expected_arch != elf->arch()) { in GetElf() 228 elf->Invalidate(); in GetElf() 237 if (!elf->valid()) { in GetElf() 245 if (prev_real_map->elf.get() == nullptr) { in GetElf() [all …]
|
D | JitDebug.cpp | 79 for (auto* elf : elf_list_) { in ~JitDebug() local 80 delete elf; in ~JitDebug() 193 for (Elf* elf : elf_list_) { in GetElf() 194 if (elf->IsValidPc(pc)) { in GetElf() 195 return elf; in GetElf() 204 Elf* elf = new Elf(new MemoryRange(memory_, start, size, 0)); in GetElf() local 205 elf->Init(); in GetElf() 206 if (!elf->valid()) { in GetElf() 210 delete elf; in GetElf() 213 elf_list_.push_back(elf); in GetElf() [all …]
|
D | Unwinder.cpp | 95 FrameData* Unwinder::FillInFrame(MapInfo* map_info, Elf* elf, uint64_t rel_pc, in FillInFrame() argument 113 std::string soname = elf->GetSoname(); in FillInFrame() 124 frame->map_load_bias = elf->GetLoadBias(); in FillInFrame() 161 Elf* elf; in Unwind() local 170 elf = map_info->GetElf(process_memory_, arch); in Unwind() 178 rel_pc = elf->GetRelPc(step_pc, map_info); in Unwind() 184 pc_adjustment = GetPcAdjustment(rel_pc, elf, arch); in Unwind() 192 if (!elf->valid() && jit_debug_ != nullptr) { in Unwind() 198 elf = jit_elf; in Unwind() 220 frame = FillInFrame(map_info, elf, rel_pc, pc_adjustment); in Unwind() [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 = GetPcAdjustment(rel_pc, elf, arch); 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 | Regs.cpp | 124 uint64_t GetPcAdjustment(uint64_t rel_pc, Elf* elf, ArchEnum arch) { in GetPcAdjustment() argument 127 if (!elf->valid()) { in GetPcAdjustment() 131 uint64_t load_bias = elf->GetLoadBias(); in GetPcAdjustment() 149 if (!elf->memory()->ReadFully(adjusted_rel_pc - 5, &value, sizeof(value)) || in GetPcAdjustment()
|
D | AndroidVersions.md | 22 By default, lld creates two separate maps of the elf in memory, one read-only 36 to add the linker option `-Wl,-zseparate-code` to avoid creating an elf 49 elf files with this format only ever occurs if the file was generated 57 * Be permissive of badly formed elf files. Previously, any detected error 68 contain elf data. The first is read-only and contains the elf header data, 70 contains the executable code from the elf. Before this, the unwinder 72 contained the elf header data and the executable code. 73 * Build ID information for elf objects added. This will display the 74 NT\_GNU\_BUILD\_ID note found in elf files. This information can be used 82 elf file as Dwarf 4. It does not support the new dwarf ops in Dwarf 5. [all …]
|
D | Global.cpp | 82 Elf* elf = map_zero->GetElf(memory_, arch()); in FindAndReadVariable() local 84 if (elf->GetGlobalVariableOffset(variable, &ptr) && ptr != 0) { in FindAndReadVariable()
|
/system/core/libunwindstack/benchmarks/ |
D | ElfBenchmark.cpp | 48 unwindstack::Elf elf(file_memory.release()); in BenchmarkElfCreate() local 49 if (!elf.Init() || !elf.valid()) { in BenchmarkElfCreate() 107 unwindstack::Elf* elf = build_id_map_info->GetElf(std::shared_ptr<unwindstack::Memory>(), in BM_elf_get_build_id_from_object() local 109 if (!elf->valid()) { in BM_elf_get_build_id_from_object()
|
D | SymbolBenchmark.cpp | 40 unwindstack::Elf elf(unwindstack::Memory::CreateFileMemory(elf_file, 0).release()); in BenchmarkSymbolLookup() local 41 if (!elf.Init() || !elf.valid()) { in BenchmarkSymbolLookup() 56 bool found = elf.GetFunctionName(pc, &name, &offset); in BenchmarkSymbolLookup()
|
/system/core/libunwindstack/tests/fuzz/ |
D | UnwinderComponentCreator.cpp | 59 const char* name, Elf* elf = nullptr) { in ElfAddMapInfo() argument 62 if (elf != nullptr) { in ElfAddMapInfo() 64 map_info->elf.reset(elf); in ElfAddMapInfo() 68 void ElfPushFakeFunctionData(FuzzedDataProvider* data_provider, ElfInterfaceFake* elf) { in ElfPushFakeFunctionData() argument 74 elf->FakeSetGlobalVariable(func_name, data_provider->ConsumeIntegral<uint64_t>()); in ElfPushFakeFunctionData() 92 ElfFake* elf = new ElfFake(new MemoryFake); in PopulateElfFake() local 101 elf->FakeSetArch(GetArch(data_provider)); in PopulateElfFake() 102 elf->FakeSetLoadBias(data_provider->ConsumeIntegral<uint64_t>()); in PopulateElfFake() 107 elf->FakeSetInterface(interface_fake); in PopulateElfFake() 109 return elf; in PopulateElfFake()
|
/system/core/libbacktrace/ |
D | UnwindStackMap.cpp | 120 unwindstack::Elf* elf = map_info->GetElf(process_memory(), arch_); in GetFunctionName() local 124 if (!elf->GetFunctionName(elf->GetRelPc(pc, map_info), &name, &func_offset)) { in GetFunctionName()
|