/system/core/libunwindstack/tests/ |
D | DwarfDebugFrameTest.cpp | 57 memory_.Clear(); in SetUp() 58 debug_frame_ = new MockDwarfDebugFrame<TypeParam>(&memory_); in SetUp() 64 MemoryFake memory_; member in unwindstack::DwarfDebugFrameTest 73 this->memory_.SetData32(0x5000, 0xfc); in TYPED_TEST_P() 74 this->memory_.SetData32(0x5004, 0xffffffff); in TYPED_TEST_P() 75 this->memory_.SetData8(0x5008, 1); in TYPED_TEST_P() 76 this->memory_.SetData8(0x5009, '\0'); in TYPED_TEST_P() 79 this->memory_.SetData32(0x5100, 0xfc); in TYPED_TEST_P() 80 this->memory_.SetData32(0x5104, 0); in TYPED_TEST_P() 81 this->memory_.SetData32(0x5108, 0x1500); in TYPED_TEST_P() [all …]
|
D | DwarfEhFrameTest.cpp | 57 memory_.Clear(); in SetUp() 58 eh_frame_ = new MockDwarfEhFrame<TypeParam>(&memory_); in SetUp() 64 MemoryFake memory_; member in unwindstack::DwarfEhFrameTest 73 this->memory_.SetData32(0x5000, 0xfc); in TYPED_TEST_P() 74 this->memory_.SetData32(0x5004, 0); in TYPED_TEST_P() 75 this->memory_.SetData8(0x5008, 1); in TYPED_TEST_P() 76 this->memory_.SetData8(0x5009, '\0'); in TYPED_TEST_P() 79 this->memory_.SetData32(0x5100, 0xfc); in TYPED_TEST_P() 80 this->memory_.SetData32(0x5104, 0x104); in TYPED_TEST_P() 81 this->memory_.SetData32(0x5108, 0x1500); in TYPED_TEST_P() [all …]
|
D | MemoryBufferTest.cpp | 31 memory_.reset(new MemoryBuffer); in SetUp() 33 std::unique_ptr<MemoryBuffer> memory_; member in unwindstack::MemoryBufferTest 37 ASSERT_EQ(0U, memory_->Size()); in TEST_F() 39 ASSERT_FALSE(memory_->ReadFully(0, buffer.data(), 1)); in TEST_F() 40 ASSERT_EQ(nullptr, memory_->GetPtr(0)); in TEST_F() 41 ASSERT_EQ(nullptr, memory_->GetPtr(1)); in TEST_F() 45 memory_->Resize(256); in TEST_F() 46 ASSERT_EQ(256U, memory_->Size()); in TEST_F() 47 ASSERT_TRUE(memory_->GetPtr(0) != nullptr); in TEST_F() 48 ASSERT_TRUE(memory_->GetPtr(1) != nullptr); in TEST_F() [all …]
|
D | ElfInterfaceArmTest.cpp | 36 memory_.Clear(); in SetUp() 40 MemoryFake memory_; member in unwindstack::ElfInterfaceArmTest 45 ElfInterfaceArmFake interface(&memory_); in TEST_F() 46 memory_.SetData32(0x1000, 0x230000); in TEST_F() 52 memory_.SetData32(0x1000, 0x80001000); in TEST_F() 56 memory_.SetData32(0x1000, 0x70001000); in TEST_F() 62 ElfInterfaceArmFake interface(&memory_); in TEST_F() 71 ElfInterfaceArmFake interface(&memory_); in TEST_F() 80 ElfInterfaceArmFake interface(&memory_); in TEST_F() 89 ElfInterfaceArmFake interface(&memory_); in TEST_F() [all …]
|
D | SymbolsTest.cpp | 45 void SetUp() override { memory_.Clear(); } in SetUp() 56 MemoryFake memory_; member in unwindstack::SymbolsTest 66 this->memory_.SetMemory(offset, &sym, sizeof(sym)); in TYPED_TEST_P() 69 this->memory_.SetMemory(0x2040, fake_name.c_str(), fake_name.size() + 1); in TYPED_TEST_P() 73 ASSERT_TRUE(symbols.GetName<TypeParam>(0x5000, 0, &this->memory_, &name, &func_offset)); in TYPED_TEST_P() 78 ASSERT_TRUE(symbols.GetName<TypeParam>(0x500f, 0, &this->memory_, &name, &func_offset)); in TYPED_TEST_P() 83 ASSERT_FALSE(symbols.GetName<TypeParam>(0x4fff, 0, &this->memory_, &name, &func_offset)); in TYPED_TEST_P() 84 ASSERT_FALSE(symbols.GetName<TypeParam>(0x5010, 0, &this->memory_, &name, &func_offset)); in TYPED_TEST_P() 93 this->memory_.SetMemory(offset, &sym, sizeof(sym)); in TYPED_TEST_P() 96 this->memory_.SetMemory(0x2040, fake_name.c_str(), fake_name.size() + 1); in TYPED_TEST_P() [all …]
|
D | JitDebugTest.cpp | 39 memory_ = new MemoryFake; in SetUp() 40 process_memory_.reset(memory_); in SetUp() 101 memory_->SetMemory(offset, &ehdr, sizeof(ehdr)); in CreateElf() 106 memory_->SetMemory(offset + sh_offset, &shdr, sizeof(shdr)); in CreateElf() 114 memory_->SetMemory(offset + sh_offset, &shdr, sizeof(shdr)); in CreateElf() 115 memory_->SetMemory(offset + 0x500, ".debug_frame"); in CreateElf() 124 memory_->SetMemory(offset + sh_offset, &shdr, sizeof(shdr)); in CreateElf() 130 memory_->SetData32(dwarf_offset, 0xfc); in CreateElf() 131 memory_->SetData32(dwarf_offset + 0x4, 0xffffffff); in CreateElf() 132 memory_->SetData8(dwarf_offset + 0x8, 1); in CreateElf() [all …]
|
D | DwarfEhFrameWithHdrTest.cpp | 66 memory_.Clear(); in SetUp() 67 eh_frame_ = new MockDwarfEhFrameWithHdr<TypeParam>(&memory_); in SetUp() 73 MemoryFake memory_; member in unwindstack::DwarfEhFrameWithHdrTest 81 this->memory_.SetMemory( in TYPED_TEST_P() 83 this->memory_.SetData16(0x1004, 0x500); in TYPED_TEST_P() 84 this->memory_.SetData32(0x1006, 126); in TYPED_TEST_P() 99 this->memory_.SetData32(0x1006, 0); in TYPED_TEST_P() 104 this->memory_.SetData32(0x1006, 126); in TYPED_TEST_P() 105 this->memory_.SetData8(0x1000, 0); in TYPED_TEST_P() 108 this->memory_.SetData8(0x1000, 2); in TYPED_TEST_P() [all …]
|
D | DwarfSectionImplTest.cpp | 77 memory_.Clear(); in SetUp() 78 section_ = new MockDwarfSectionImpl<TypeParam>(&memory_); in SetUp() 86 MemoryFake memory_; member in unwindstack::DwarfSectionImplTest 104 ASSERT_FALSE(this->section_->Eval(&cie, &this->memory_, loc_regs, ®s, &finished)); in TYPED_TEST_P() 118 this->memory_.SetMemory(0x5000, std::vector<uint8_t>{0x96, 0x96, 0x96}); in TYPED_TEST_P() 121 ASSERT_FALSE(this->section_->Eval(&cie, &this->memory_, loc_regs, ®s, &finished)); in TYPED_TEST_P() 134 this->memory_.SetMemory(0x5000, std::vector<uint8_t>{0x0c, 0x00, 0x00, 0x00, 0x80}); in TYPED_TEST_P() 136 this->memory_.SetMemory(0x80000000, &cfa_value, sizeof(cfa_value)); in TYPED_TEST_P() 139 ASSERT_FALSE(this->section_->Eval(&cie, &this->memory_, loc_regs, ®s, &finished)); in TYPED_TEST_P() 152 this->memory_.SetMemory(0x5000, std::vector<uint8_t>{0x0c, 0x00, 0x00, 0x00, 0x80}); in TYPED_TEST_P() [all …]
|
D | ElfInterfaceTest.cpp | 44 memory_.Clear(); in SetUp() 48 memory_.SetMemory(offset, string, strlen(string) + 1); in SetStringMemory() 113 MemoryFake memory_; member in unwindstack::ElfInterfaceTest 127 memory_.SetMemory(offset, &sym, sizeof(sym)); in InitSym() 128 memory_.SetMemory(sym_offset + name_offset, name, strlen(name) + 1); in InitSym() 133 std::unique_ptr<ElfInterface> elf(new ElfInterfaceType(&memory_)); in SinglePtLoad() 140 memory_.SetMemory(0, &ehdr, sizeof(ehdr)); in SinglePtLoad() 149 memory_.SetMemory(0x100, &phdr, sizeof(phdr)); in SinglePtLoad() 173 std::unique_ptr<ElfInterface> elf(new ElfInterfaceType(&memory_)); in MultipleExecutablePtLoads() 180 memory_.SetMemory(0, &ehdr, sizeof(ehdr)); in MultipleExecutablePtLoads() [all …]
|
D | MemoryOfflineBufferTest.cpp | 31 memory_.reset(new MemoryOfflineBuffer(buffer_.data(), kStart, kEnd)); in SetUp() 41 std::unique_ptr<MemoryOfflineBuffer> memory_; member in unwindstack::MemoryOfflineBufferTest 59 ASSERT_FALSE(memory_->ReadFully(0, buffer.data(), 1)); in TEST_F() 60 ASSERT_FALSE(memory_->ReadFully(0xfff, buffer.data(), 1)); in TEST_F() 61 ASSERT_FALSE(memory_->ReadFully(0xfff, buffer.data(), 2)); in TEST_F() 62 ASSERT_FALSE(memory_->ReadFully(0x3000, buffer.data(), 1)); in TEST_F() 63 ASSERT_FALSE(memory_->ReadFully(0x3001, buffer.data(), 1)); in TEST_F() 68 ASSERT_TRUE(memory_->ReadFully(kStart, buffer.data(), 10)); in TEST_F() 71 ASSERT_TRUE(memory_->ReadFully(kStart + 555, buffer.data(), 40)); in TEST_F() 74 ASSERT_TRUE(memory_->ReadFully(kStart + kLength - 105, buffer.data(), 105)); in TEST_F() [all …]
|
D | MemoryFileTest.cpp | 42 MemoryFileAtOffset memory_; member in unwindstack::MemoryFileTest 50 ASSERT_TRUE(memory_.Init(tf_->path, 0)); in TEST_F() 52 ASSERT_TRUE(memory_.ReadFully(0, buffer.data(), 10)); in TEST_F() 60 ASSERT_TRUE(memory_.Init(tf_->path, 10)); in TEST_F() 62 ASSERT_TRUE(memory_.ReadFully(0, buffer.data(), 10)); in TEST_F() 76 ASSERT_TRUE(memory_.Init(tf_->path, pagesize + 15)); in TEST_F() 78 ASSERT_TRUE(memory_.ReadFully(0, buffer.data(), 8)); in TEST_F() 92 ASSERT_TRUE(memory_.Init(tf_->path, 2 * pagesize)); in TEST_F() 94 ASSERT_TRUE(memory_.ReadFully(0, buffer.data(), 10)); in TEST_F() 113 ASSERT_TRUE(memory_.Init(tf_->path, 2 * pagesize + 10)); in TEST_F() [all …]
|
D | ElfTest.cpp | 44 memory_ = new MemoryFake; in SetUp() 60 memory_->SetMemory(0, &ehdr, sizeof(ehdr)); in InitElf32() 69 memory_->SetMemory(0x100, &phdr, sizeof(phdr)); in InitElf32() 81 memory_->SetMemory(0x100 + sizeof(phdr), &phdr, sizeof(phdr)); in InitElf32() 95 memory_->SetMemory(0, &ehdr, sizeof(ehdr)); in InitElf64() 104 memory_->SetMemory(0x100, &phdr, sizeof(phdr)); in InitElf64() 107 MemoryFake* memory_; member in unwindstack::ElfTest 111 Elf elf(memory_); in TEST_F() 118 Elf elf(memory_); in TEST_F() 123 memory_->SetData32(0, 0x7f000000); in TEST_F() [all …]
|
D | DwarfCfaLogTest.cpp | 43 memory_.Clear(); in SetUp() 45 dmem_.reset(new DwarfMemory(&memory_)); in SetUp() 63 MemoryFake memory_; member in unwindstack::DwarfCfaLogTest 79 this->memory_.SetMemory(0x2000, std::vector<uint8_t>{i}); in TYPED_TEST_P() 91 this->memory_.SetMemory(0x2000, std::vector<uint8_t>{0x00}); in TYPED_TEST_P() 102 this->memory_.SetMemory(0x2000, std::vector<uint8_t>{0x83, 0x04}); in TYPED_TEST_P() 112 this->memory_.SetMemory(0x2100, std::vector<uint8_t>{0x83, 0x84, 0x01}); in TYPED_TEST_P() 123 this->memory_.SetMemory(0x500, std::vector<uint8_t>{0x05, 0x03, 0x02}); in TYPED_TEST_P() 133 this->memory_.SetMemory(0x1500, std::vector<uint8_t>{0x05, 0x81, 0x01, 0x82, 0x12}); in TYPED_TEST_P() 144 this->memory_.SetMemory(0x500, std::vector<uint8_t>{0x11, 0x05, 0x10}); in TYPED_TEST_P() [all …]
|
D | DwarfMemoryTest.cpp | 33 memory_.Clear(); in SetUp() 34 dwarf_mem_.reset(new DwarfMemory(&memory_)); in SetUp() 58 MemoryFake memory_; member in unwindstack::DwarfMemoryTest 63 memory_.SetMemory(0, std::vector<uint8_t>{0x10, 0x18, 0xff, 0xfe}); in TEST_F() 86 memory_.SetData8(0, static_cast<uint8_t>(-10)); in TEST_F() 87 memory_.SetData8(1, 200); in TEST_F() 94 memory_.SetData16(0x10, static_cast<uint16_t>(-1000)); in TEST_F() 95 memory_.SetData16(0x12, 50100); in TEST_F() 103 memory_.SetData32(0x100, static_cast<uint32_t>(-1000000000)); in TEST_F() 104 memory_.SetData32(0x104, 3000000000); in TEST_F() [all …]
|
D | ElfCacheTest.cpp | 35 static void SetUpTestCase() { memory_.reset(new MemoryFake); } in SetUpTestCase() 65 static std::shared_ptr<Memory> memory_; member in unwindstack::ElfCacheTest 68 std::shared_ptr<Memory> ElfCacheTest::memory_; member in unwindstack::ElfCacheTest 85 Elf* elf1 = info1.GetElf(memory_, true); in VerifySameMap() 87 Elf* elf2 = info2.GetElf(memory_, true); in VerifySameMap() 135 Elf* elf0_1 = info0_1.GetElf(memory_, true); in VerifyWithinSameMap() 138 Elf* elf0_2 = info0_2.GetElf(memory_, true); in VerifyWithinSameMap() 149 Elf* elf100_1 = info100_1.GetElf(memory_, true); in VerifyWithinSameMap() 152 Elf* elf100_2 = info100_2.GetElf(memory_, true); in VerifyWithinSameMap() 163 Elf* elf200_1 = info200_1.GetElf(memory_, true); in VerifyWithinSameMap() [all …]
|
D | DwarfCfaTest.cpp | 42 memory_.Clear(); in SetUp() 44 dmem_.reset(new DwarfMemory(&memory_)); in SetUp() 61 MemoryFake memory_; member in unwindstack::DwarfCfaTest 77 this->memory_.SetMemory(0x2000, std::vector<uint8_t>{i}); in TYPED_TEST_P() 90 this->memory_.SetMemory(0x2000, std::vector<uint8_t>{0x00}); in TYPED_TEST_P() 103 this->memory_.SetMemory(0x2000, std::vector<uint8_t>{0x83, 0x04}); in TYPED_TEST_P() 118 this->memory_.SetMemory(0x2100, std::vector<uint8_t>{0x83, 0x84, 0x01}); in TYPED_TEST_P() 134 this->memory_.SetMemory(0x500, std::vector<uint8_t>{0x05, 0x03, 0x02}); in TYPED_TEST_P() 150 this->memory_.SetMemory(0x1500, std::vector<uint8_t>{0x05, 0x81, 0x01, 0x82, 0x12}); in TYPED_TEST_P() 165 this->memory_.SetMemory(0x500, std::vector<uint8_t>{0x11, 0x05, 0x10}); in TYPED_TEST_P() [all …]
|
D | DexFilesTest.cpp | 40 memory_ = new MemoryFake; in SetUp() 41 process_memory_.reset(memory_); in SetUp() 105 MemoryFake* memory_; member in unwindstack::DexFilesTest 112 memory_->SetData32(addr + 12, head); in WriteDescriptor32() 117 memory_->SetData64(addr + 16, head); in WriteDescriptor64() 124 memory_->SetData32(entry_addr, next); in WriteEntry32() 126 memory_->SetData32(entry_addr + 4, prev); in WriteEntry32() 128 memory_->SetData32(entry_addr + 8, dex_file); in WriteEntry32() 135 memory_->SetData64(entry_addr, next); in WriteEntry64() 137 memory_->SetData64(entry_addr + 8, prev); in WriteEntry64() [all …]
|
/system/core/libunwindstack/ |
D | DwarfSection.cpp | 37 DwarfSection::DwarfSection(Memory* memory) : memory_(memory) {} in DwarfSection() 88 DwarfOp<AddressType> op(&memory_, regular_memory); in EvalExpression() 269 memory_.set_cur_offset(offset); in GetCie() 281 if (!memory_.ReadBytes(&length32, sizeof(length32))) { in FillInCie() 283 last_error_.address = memory_.cur_offset(); in FillInCie() 292 if (!memory_.ReadBytes(&length64, sizeof(length64))) { in FillInCie() 294 last_error_.address = memory_.cur_offset(); in FillInCie() 298 cie->cfa_instructions_end = memory_.cur_offset() + length64; in FillInCie() 302 if (!memory_.ReadBytes(&cie_id, sizeof(cie_id))) { in FillInCie() 304 last_error_.address = memory_.cur_offset(); in FillInCie() [all …]
|
D | DwarfEhFrameWithHdr.cpp | 32 memory_.clear_func_offset(); in Init() 33 memory_.clear_text_offset(); in Init() 34 memory_.set_data_offset(offset); in Init() 35 memory_.set_cur_offset(offset); in Init() 38 if (!memory_.ReadBytes(data, 4)) { in Init() 40 last_error_.address = memory_.cur_offset(); in Init() 54 table_entry_size_ = memory_.template GetEncodedSize<AddressType>(table_encoding_); in Init() 56 memory_.set_pc_offset(memory_.cur_offset()); in Init() 57 if (!memory_.template ReadEncodedValue<AddressType>(ptr_encoding_, &ptr_offset_)) { in Init() 59 last_error_.address = memory_.cur_offset(); in Init() [all …]
|
D | DwarfOp.cpp | 42 memory_->set_cur_offset(start); in Eval() 50 if (memory_->cur_offset() < end) { in Eval() 63 if (memory_->cur_offset() < end) { in Eval() 76 while (memory_->cur_offset() < end) { in Eval() 93 if (!memory_->ReadBytes(&cur_op_, 1)) { in Decode() 95 last_error_.address = memory_->cur_offset(); in Decode() 115 if (!memory_->ReadEncodedValue<AddressType>(op->operands[i], &value)) { in Decode() 117 last_error_.address = memory_->cur_offset(); in Decode() 128 memory_->set_cur_offset(start); in GetLogInfo() 129 while (memory_->cur_offset() < end) { in GetLogInfo() [all …]
|
D | DwarfCfa.cpp | 50 memory_->set_cur_offset(start_offset); in GetLocationInfo() 59 if ((cfa_offset = memory_->cur_offset()) >= end_offset) { in GetLocationInfo() 67 if (!memory_->ReadBytes(&cfa_value, 1)) { in GetLocationInfo() 69 last_error_.address = memory_->cur_offset(); in GetLocationInfo() 80 if (!memory_->ReadULEB128(&offset)) { in GetLocationInfo() 82 last_error_.address = memory_->cur_offset(); in GetLocationInfo() 117 if (!memory_->ReadULEB128(&block_length)) { in GetLocationInfo() 119 last_error_.address = memory_->cur_offset(); in GetLocationInfo() 123 memory_->set_cur_offset(memory_->cur_offset() + block_length); in GetLocationInfo() 127 if (!memory_->ReadEncodedValue<AddressType>(cfa->operands[i], &value)) { in GetLocationInfo() [all …]
|
D | JitDebug.cpp | 72 JitDebug::JitDebug(std::shared_ptr<Memory>& memory) : memory_(memory) {} in JitDebug() 75 : memory_(memory), search_libs_(search_libs) {} in JitDebug() 85 if (!memory_->ReadFully(addr, &desc, sizeof(desc))) { in ReadDescriptor32() 99 if (!memory_->ReadFully(addr, &desc, sizeof(desc))) { in ReadDescriptor64() 113 if (!memory_->ReadFully(entry_addr_, &code, sizeof(code))) { in ReadEntry32Pack() 124 if (!memory_->ReadFully(entry_addr_, &code, sizeof(code))) { in ReadEntry32Pad() 135 if (!memory_->ReadFully(entry_addr_, &code, sizeof(code))) { in ReadEntry64() 195 Elf* elf = info->GetElf(memory_, true); in Init() 228 Elf* elf = new Elf(new MemoryRange(memory_, start, size, 0)); in GetElf()
|
D | DexFile.cpp | 147 memory_.resize(sizeof(art::DexFile::Header)); in Open() 148 if (!memory->ReadFully(dex_file_offset_in_memory, memory_.data(), memory_.size())) { in Open() 152 art::DexFile::Header* header = reinterpret_cast<art::DexFile::Header*>(memory_.data()); in Open() 170 memory_.resize(file_size); in Open() 171 if (!memory->ReadFully(dex_file_offset_in_memory, memory_.data(), memory_.size())) { in Open() 175 header = reinterpret_cast<art::DexFile::Header*>(memory_.data()); in Open() 180 loader.Open(memory_.data(), header->file_size_, "", 0, nullptr, false, false, &error_msg); in Open()
|
D | ElfInterface.cpp | 82 if (!memory_->ReadFully(gnu_debugdata_offset_, src.data(), gnu_debugdata_size_)) { in CreateGnuDebugdataMemory() 129 eh_frame_.reset(new DwarfEhFrameWithHdr<AddressType>(memory_)); in InitHeadersWithTemplate() 138 eh_frame_.reset(new DwarfEhFrame<AddressType>(memory_)); in InitHeadersWithTemplate() 152 debug_frame_.reset(new DwarfDebugFrame<AddressType>(memory_)); in InitHeadersWithTemplate() 164 if (!memory_->ReadFully(0, &ehdr, sizeof(ehdr))) { in ReadAllHeaders() 207 if (!memory_->ReadField(offset, &phdr, &phdr.p_type, sizeof(phdr.p_type))) { in ReadProgramHeaders() 222 if (!memory_->ReadField(offset, &phdr, &phdr.p_flags, sizeof(phdr.p_flags))) { in ReadProgramHeaders() 232 if (!memory_->ReadField(offset, &phdr, &phdr.p_vaddr, sizeof(phdr.p_vaddr))) { in ReadProgramHeaders() 238 if (!memory_->ReadField(offset, &phdr, &phdr.p_offset, sizeof(phdr.p_offset))) { in ReadProgramHeaders() 244 if (!memory_->ReadField(offset, &phdr, &phdr.p_memsz, sizeof(phdr.p_memsz))) { in ReadProgramHeaders() [all …]
|
D | DexFiles.cpp | 46 DexFiles::DexFiles(std::shared_ptr<Memory>& memory) : memory_(memory) {} in DexFiles() 49 : memory_(memory), search_libs_(search_libs) {} in DexFiles() 81 if (!memory_->ReadFully(addr + field_offset, &entry, sizeof(entry))) { in ReadEntryPtr32() 90 if (!memory_->ReadFully(addr + field_offset, &entry, sizeof(entry))) { in ReadEntryPtr64() 98 if (!memory_->ReadFully(entry_addr_, &entry, sizeof(entry)) || entry.dex_file == 0) { in ReadEntry32() 110 if (!memory_->ReadFully(entry_addr_, &entry, sizeof(entry)) || entry.dex_file == 0) { in ReadEntry64() 147 Elf* elf = info->GetElf(memory_, true); in Init() 164 dex_file = DexFile::Create(dex_file_offset, memory_.get(), info); in GetDexFile()
|