Home
last modified time | relevance | path

Searched refs:elf (Results 1 – 25 of 42) sorted by relevance

12

/system/core/libunwindstack/tests/
DElfTest.cpp111 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 …]
DMapInfoGetElfTest.cpp74 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 …]
DElfInterfaceTest.cpp153 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 …]
DJitDebugTest.cpp40 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 …]
DMapInfoTest.cpp40 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()
DUnwinderTest.cpp48 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 …]
DMapInfoGetLoadBiasTest.cpp72 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/
Dunwind_info.cpp40 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 …]
Dunwind_symbols.cpp68 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()
Dunwind_reg_info.cpp175 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/
Dread_elf.cpp145 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 …]
Dread_apk.cpp45 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()
Ddso.cpp480 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/
DMapInfo.cpp197 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 …]
DJitDebug.cpp78 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 …]
DLocalUnwinder.cpp104 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()
DUnwinder.cpp93 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 …]
DRegsArm.cpp54 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()
DGlobal.cpp57 Elf* elf = info->GetElf(memory_, arch()); in GetVariableOffset() local
60 if (elf->GetGlobalVariable(variable, &ptr) && ptr != 0) { in GetVariableOffset()
/system/core/libunwindstack/include/unwindstack/
DRegsMips.h39 uint64_t GetPcAdjustment(uint64_t rel_pc, Elf* elf) override;
43 bool StepIfSignalHandler(uint64_t rel_pc, Elf* elf, Memory* process_memory) override;
DRegsArm64.h39 uint64_t GetPcAdjustment(uint64_t rel_pc, Elf* elf) override;
43 bool StepIfSignalHandler(uint64_t rel_pc, Elf* elf, Memory* process_memory) override;
DRegsArm.h39 uint64_t GetPcAdjustment(uint64_t rel_pc, Elf* elf) override;
43 bool StepIfSignalHandler(uint64_t rel_pc, Elf* elf, Memory* process_memory) override;
DRegsMips64.h39 uint64_t GetPcAdjustment(uint64_t rel_pc, Elf* elf) override;
43 bool StepIfSignalHandler(uint64_t rel_pc, Elf* elf, Memory* process_memory) override;
DRegsX86_64.h40 uint64_t GetPcAdjustment(uint64_t rel_pc, Elf* elf) override;
44 bool StepIfSignalHandler(uint64_t rel_pc, Elf* elf, Memory* process_memory) override;
DRegsX86.h40 uint64_t GetPcAdjustment(uint64_t rel_pc, Elf* elf) override;
44 bool StepIfSignalHandler(uint64_t rel_pc, Elf* elf, Memory* process_memory) override;

12