Lines Matching refs:dso
152 TEST(dso, dex_file_dso) { in TEST() argument
155 std::unique_ptr<Dso> dso = Dso::CreateDso(dso_type, GetTestData("base.vdex")); in TEST() local
156 ASSERT_TRUE(dso); in TEST()
157 dso->AddDexFileOffset(0x28); in TEST()
158 ASSERT_EQ(DSO_DEX_FILE, dso->type()); in TEST()
159 const Symbol* symbol = dso->FindSymbol(0x6c77e); in TEST()
167 dso->GetMinExecutableVaddr(&min_vaddr, &file_offset_of_min_vaddr); in TEST()
172 dso = Dso::CreateDso(dso_type, GetTestData("base.zip!/not_exist_entry")); in TEST()
173 ASSERT_TRUE(dso); in TEST()
174 ASSERT_EQ(nullptr, dso->FindSymbol(0)); in TEST()
181 TEST(dso, dex_file_offsets) { in TEST() argument
182 std::unique_ptr<Dso> dso = Dso::CreateDso(DSO_DEX_FILE, ""); in TEST() local
183 ASSERT_TRUE(dso); in TEST()
185 dso->AddDexFileOffset(offset); in TEST()
187 ASSERT_EQ(*dso->DexFileOffsets(), std::vector<uint64_t>({0x1, 0x2, 0x3, 0x4, 0x5})); in TEST()
190 TEST(dso, embedded_elf) { in TEST() argument
192 std::unique_ptr<Dso> dso = Dso::CreateDso(DSO_ELF_FILE, file_path); in TEST() local
193 ASSERT_TRUE(dso); in TEST()
194 ASSERT_EQ(dso->Path(), file_path); in TEST()
195 ASSERT_EQ(dso->GetDebugFilePath(), file_path); in TEST()
198 dso->GetMinExecutableVaddr(&min_vaddr, &file_offset_of_min_vaddr); in TEST()
201 const Symbol* symbol = dso->FindSymbol(0x9a4); in TEST()
209 TEST(dso, IpToVaddrInFile) { in TEST() argument
210 std::unique_ptr<Dso> dso = Dso::CreateDso(DSO_ELF_FILE, GetTestData("libc.so")); in TEST() local
211 ASSERT_TRUE(dso); in TEST()
212 ASSERT_EQ(0xa5140, dso->IpToVaddrInFile(0xe9201140, 0xe9201000, 0xa5000)); in TEST()
215 TEST(dso, kernel_address_randomization) { in TEST() argument
219 std::unique_ptr<Dso> dso = Dso::CreateDso(DSO_KERNEL, DEFAULT_KERNEL_MMAP_NAME); in TEST() local
220 ASSERT_TRUE(dso); in TEST()
221 ASSERT_EQ(dso->GetDebugFilePath(), vmlinux_path); in TEST()
223 ASSERT_EQ(dso->IpToVaddrInFile(0x800500, 0, 0), 0x800500); in TEST()
224 ASSERT_FALSE(dso->IpToFileOffset(0x800500, 0, 0)); in TEST()
225 ASSERT_TRUE(dso->FindSymbol(0x400510) == nullptr); in TEST()
227 dso = Dso::CreateDso(DSO_KERNEL, DEFAULT_KERNEL_MMAP_NAME); in TEST()
228 ASSERT_TRUE(dso); in TEST()
229 ASSERT_EQ(dso->GetDebugFilePath(), vmlinux_path); in TEST()
231 ASSERT_EQ(dso->IpToVaddrInFile(0x800500, 0x800400, 0), 0x400500); in TEST()
232 ASSERT_EQ(dso->IpToFileOffset(0x800500, 0x800400, 0).value(), 0x500); in TEST()
233 const Symbol* symbol = dso->FindSymbol(0x400510); in TEST()
238 TEST(dso, find_vmlinux_in_symdirs) { in TEST() argument
250 std::unique_ptr<Dso> dso = Dso::CreateDso(DSO_KERNEL, DEFAULT_KERNEL_MMAP_NAME); in TEST() local
251 ASSERT_TRUE(dso); in TEST()
252 ASSERT_EQ(dso->GetDebugFilePath(), vmlinux_path); in TEST()
255 TEST(dso, kernel_module) { in TEST() argument
263 std::unique_ptr<Dso> dso = Dso::CreateKernelModuleDso(ELF_FILE, 0, 0, kernel_dso.get()); in TEST() local
264 ASSERT_EQ(dso->GetDebugFilePath(), GetTestData(ELF_FILE)); in TEST()
267 TEST(dso, kernel_module_CalculateMinVaddr) { in TEST() argument
297 TEST(dso, symbol_map_file) { in TEST() argument
298 auto dso = Dso::CreateDso(DSO_SYMBOL_MAP_FILE, "perf-123.map"); in TEST() local
299 ASSERT_TRUE(dso); in TEST()
300 ASSERT_EQ(DSO_SYMBOL_MAP_FILE, dso->type()); in TEST()
301 ASSERT_EQ(0x12345678, dso->IpToVaddrInFile(0x12345678, 0x0, 0x0)); in TEST()
302 ASSERT_EQ(0x12345678, dso->IpToVaddrInFile(0x12345678, 0xe9201000, 0xa5000)); in TEST()