/system/unwinding/libunwindstack/tests/ |
D | MemoryBufferTest.cpp | 32 memory_.reset(new MemoryBuffer); in SetUp() 34 std::unique_ptr<MemoryBuffer> memory_; member in unwindstack::MemoryBufferTest 38 ASSERT_EQ(0U, memory_->Size()); in TEST_F() 40 ASSERT_FALSE(memory_->ReadFully(0, buffer.data(), 1)); in TEST_F() 41 ASSERT_EQ(nullptr, memory_->GetPtr(0)); in TEST_F() 42 ASSERT_EQ(nullptr, memory_->GetPtr(1)); in TEST_F() 46 ASSERT_TRUE(memory_->Resize(256)); in TEST_F() 47 ASSERT_EQ(256U, memory_->Size()); in TEST_F() 48 ASSERT_TRUE(memory_->GetPtr(0) != nullptr); in TEST_F() 49 ASSERT_TRUE(memory_->GetPtr(1) != nullptr); in TEST_F() [all …]
|
D | DwarfEhFrameWithHdrTest.cpp | 60 memory_.Clear(); in SetUp() 61 eh_frame_ = new TestDwarfEhFrameWithHdr<TypeParam>(&memory_); in SetUp() 67 MemoryFake memory_; member in unwindstack::DwarfEhFrameWithHdrTest 75 this->memory_.SetMemory( in TYPED_TEST_P() 77 this->memory_.SetData16(0x1004, 0x500); in TYPED_TEST_P() 78 this->memory_.SetData32(0x1006, 126); in TYPED_TEST_P() 89 this->memory_.SetData8(0x1003, 0x1); in TYPED_TEST_P() 93 this->memory_.SetData8(0x1003, DW_EH_PE_sdata4); in TYPED_TEST_P() 96 this->memory_.SetData32(0x1006, 0); in TYPED_TEST_P() 101 this->memory_.SetData32(0x1006, 126); in TYPED_TEST_P() [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, &this->memory_, &name, &func_offset)); in TYPED_TEST_P() 78 ASSERT_TRUE(symbols.GetName<TypeParam>(0x500f, &this->memory_, &name, &func_offset)); in TYPED_TEST_P() 83 ASSERT_FALSE(symbols.GetName<TypeParam>(0x4fff, &this->memory_, &name, &func_offset)); in TYPED_TEST_P() 84 ASSERT_FALSE(symbols.GetName<TypeParam>(0x5010, &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 | 82 memory_ = new MemoryFake; in SetUp() 83 process_memory_.reset(memory_); in SetUp() 92 memory_->SetMemoryBlock(offset, 0x1000, 0); in CreateElf() 104 memory_->SetMemory(offset, &ehdr, sizeof(ehdr)); in CreateElf() 109 memory_->SetMemory(offset + sh_offset, &shdr, sizeof(shdr)); in CreateElf() 117 memory_->SetMemory(offset + sh_offset, &shdr, sizeof(shdr)); in CreateElf() 118 memory_->SetMemory(offset + 0x500, ".debug_frame"); in CreateElf() 119 memory_->SetMemory(offset + 0x550, ".text"); in CreateElf() 128 memory_->SetMemory(offset + sh_offset, &shdr, sizeof(shdr)); in CreateElf() 137 memory_->SetMemory(offset + sh_offset, &shdr, sizeof(shdr)); in CreateElf() [all …]
|
D | DwarfEhFrameTest.cpp | 35 memory_.Clear(); in SetUp() 36 eh_frame_ = new DwarfEhFrame<TypeParam>(&memory_); in SetUp() 42 MemoryFake memory_; member in unwindstack::DwarfEhFrameTest 54 this->memory_.SetData32(0x5000, 0xfc); in TYPED_TEST_P() 56 this->memory_.SetData32(0x5004, 0); in TYPED_TEST_P() 57 this->memory_.SetMemory(0x5008, std::vector<uint8_t>{1, '\0', 16, 32, 1}); in TYPED_TEST_P() 60 this->memory_.SetData32(0x5100, 0xfc); in TYPED_TEST_P() 61 this->memory_.SetData32(0x5104, 0x104); in TYPED_TEST_P() 62 this->memory_.SetData32(0x5108, 0x1500); in TYPED_TEST_P() 63 this->memory_.SetData32(0x510c, 0x200); in TYPED_TEST_P() [all …]
|
D | MemoryOfflineBufferTest.cpp | 30 memory_.reset(new MemoryOfflineBuffer(buffer_.data(), kStart, kEnd)); in SetUp() 40 std::unique_ptr<MemoryOfflineBuffer> memory_; member in unwindstack::MemoryOfflineBufferTest 58 ASSERT_FALSE(memory_->ReadFully(0, buffer.data(), 1)); in TEST_F() 59 ASSERT_FALSE(memory_->ReadFully(0xfff, buffer.data(), 1)); in TEST_F() 60 ASSERT_FALSE(memory_->ReadFully(0xfff, buffer.data(), 2)); in TEST_F() 61 ASSERT_FALSE(memory_->ReadFully(0x3000, buffer.data(), 1)); in TEST_F() 62 ASSERT_FALSE(memory_->ReadFully(0x3001, buffer.data(), 1)); in TEST_F() 67 ASSERT_TRUE(memory_->ReadFully(kStart, buffer.data(), 10)); in TEST_F() 70 ASSERT_TRUE(memory_->ReadFully(kStart + 555, buffer.data(), 40)); in TEST_F() 73 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 | ElfInterfaceTest.cpp | 52 memory_.Clear(); in SetUp() 56 memory_.SetMemory(offset, string, strlen(string) + 1); in SetStringMemory() 163 MemoryFake memory_; member in unwindstack::ElfInterfaceTest 176 memory_.SetMemory(offset, &sym, sizeof(sym)); in InitSym() 177 memory_.SetMemory(sym_offset + name_offset, name, strlen(name) + 1); in InitSym() 182 std::unique_ptr<ElfInterface> elf(new ElfInterfaceType(&memory_)); in SinglePtLoad() 188 memory_.SetMemory(0, &ehdr, sizeof(ehdr)); in SinglePtLoad() 196 memory_.SetMemory(0x100, &phdr, sizeof(phdr)); in SinglePtLoad() 220 std::unique_ptr<ElfInterface> elf(new ElfInterfaceType(&memory_)); in MultipleExecutablePtLoads() 226 memory_.SetMemory(0, &ehdr, sizeof(ehdr)); in MultipleExecutablePtLoads() [all …]
|
D | ElfTest.cpp | 45 memory_ = new MemoryFake; in SetUp() 61 memory_->SetMemory(0, &ehdr, sizeof(ehdr)); in InitElf32() 70 memory_->SetMemory(0x100, &phdr, sizeof(phdr)); in InitElf32() 82 memory_->SetMemory(0x100 + sizeof(phdr), &phdr, sizeof(phdr)); in InitElf32() 96 memory_->SetMemory(0, &ehdr, sizeof(ehdr)); in InitElf64() 105 memory_->SetMemory(0x100, &phdr, sizeof(phdr)); in InitElf64() 110 MemoryFake* memory_; member in unwindstack::ElfTest 114 Elf elf(memory_); in TEST_F() 121 Elf elf(memory_); in TEST_F() 126 memory_->SetData32(0, 0x7f000000); in TEST_F() [all …]
|
D | DwarfCfaLogTest.cpp | 44 memory_.Clear(); in SetUp() 46 dmem_.reset(new DwarfMemory(&memory_)); in SetUp() 64 MemoryFake memory_; member in unwindstack::DwarfCfaLogTest 80 this->memory_.SetMemory(0x2000, std::vector<uint8_t>{i}); in TYPED_TEST_P() 92 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() 113 this->memory_.SetMemory(0x2100, std::vector<uint8_t>{0x83, 0x84, 0x01}); in TYPED_TEST_P() 124 this->memory_.SetMemory(0x500, std::vector<uint8_t>{0x05, 0x03, 0x02}); in TYPED_TEST_P() 134 this->memory_.SetMemory(0x1500, std::vector<uint8_t>{0x05, 0x81, 0x01, 0x82, 0x12}); in TYPED_TEST_P() 145 this->memory_.SetMemory(0x500, std::vector<uint8_t>{0x11, 0x05, 0x10}); in TYPED_TEST_P() [all …]
|
D | MemoryCacheTest.cpp | 31 memory_ = new MemoryFake; in SetUp() 32 memory_cache_.reset(new MemoryCache(memory_)); in SetUp() 34 memory_->SetMemoryBlock(0x8000, 4096, 0xab); in SetUp() 35 memory_->SetMemoryBlock(0x9000, 4096, 0xde); in SetUp() 36 memory_->SetMemoryBlock(0xa000, 3000, 0x50); in SetUp() 39 MemoryFake* memory_; member in unwindstack::MemoryCacheTest 54 memory_->SetMemoryBlock(0x8000, 4096, 0xff); in TEST_F() 73 memory_->SetMemoryBlock(0x8000, 4096, 0xff); in TEST_F() 91 memory_->SetMemoryBlock(0x8000, 4096, 0xff); in TEST_F() 92 memory_->SetMemoryBlock(0x9000, 4096, 0xff); in TEST_F() [all …]
|
D | DwarfSectionImplTest.cpp | 62 memory_.Clear(); in SetUp() 63 section_ = new TestDwarfSectionImpl<TypeParam>(&memory_); in SetUp() 69 MemoryFake memory_; member in unwindstack::DwarfSectionImplTest 109 ASSERT_FALSE(this->section_->Eval(&cie, &this->memory_, loc_regs, ®s, &finished)); in TYPED_TEST_P() 123 this->memory_.SetMemory(0x5000, std::vector<uint8_t>{0x96, 0x96, 0x96}); in TYPED_TEST_P() 126 ASSERT_FALSE(this->section_->Eval(&cie, &this->memory_, loc_regs, ®s, &finished)); in TYPED_TEST_P() 139 this->memory_.SetMemory(0x5000, std::vector<uint8_t>{0x0c, 0x00, 0x00, 0x00, 0x80}); in TYPED_TEST_P() 141 this->memory_.SetMemory(0x80000000, &cfa_value, sizeof(cfa_value)); in TYPED_TEST_P() 144 ASSERT_FALSE(this->section_->Eval(&cie, &this->memory_, loc_regs, ®s, &finished)); in TYPED_TEST_P() 157 this->memory_.SetMemory(0x5000, std::vector<uint8_t>{0x0c, 0x00, 0x00, 0x00, 0x80}); in TYPED_TEST_P() [all …]
|
D | DexFilesTest.cpp | 96 memory_ = new MemoryFake; in SetUp() 97 process_memory_.reset(memory_); in SetUp() 120 MemoryFake* memory_; member in unwindstack::DexFilesTest 127 memory_->SetData32(addr, 1); in WriteDescriptor32() 129 memory_->SetData32(addr + 4, 0); in WriteDescriptor32() 131 memory_->SetData32(addr + 8, 0); in WriteDescriptor32() 133 memory_->SetData32(addr + 12, entry); in WriteDescriptor32() 138 memory_->SetData32(addr, 1); in WriteDescriptor64() 140 memory_->SetData32(addr + 4, 0); in WriteDescriptor64() 142 memory_->SetData64(addr + 8, 0); in WriteDescriptor64() [all …]
|
D | DwarfDebugFrameTest.cpp | 37 memory_.Clear(); in SetUp() 38 debug_frame_ = new DwarfDebugFrame<TypeParam>(&memory_); in SetUp() 44 MemoryFake memory_; member in unwindstack::DwarfDebugFrameTest 123 SetFourFdes32(&this->memory_); in TYPED_TEST_P() 165 SetFourFdes32(&this->memory_); in TYPED_TEST_P() 189 SetFourFdes32(&this->memory_); in TYPED_TEST_P() 199 SetFourFdes32(&this->memory_); in TYPED_TEST_P() 223 SetFourFdes32(&this->memory_); in TYPED_TEST_P() 247 SetFourFdes32(&this->memory_); in TYPED_TEST_P() 271 SetFourFdes64(&this->memory_); in TYPED_TEST_P() [all …]
|
D | MemoryThreadCacheTest.cpp | 32 memory_ = new MemoryFake; in SetUp() 33 memory_cache_.reset(new MemoryThreadCache(memory_)); in SetUp() 35 memory_->SetMemoryBlock(0x8000, 4096, 0xab); in SetUp() 36 memory_->SetMemoryBlock(0x9000, 4096, 0xde); in SetUp() 37 memory_->SetMemoryBlock(0xa000, 3000, 0x50); in SetUp() 40 MemoryFake* memory_; member in unwindstack::MemoryThreadCacheTest 55 memory_->SetMemoryBlock(0x8000, 4096, 0xff); in TEST_F() 74 memory_->SetMemoryBlock(0x8000, 4096, 0xff); in TEST_F() 92 memory_->SetMemoryBlock(0x8000, 4096, 0xff); in TEST_F() 93 memory_->SetMemoryBlock(0x9000, 4096, 0xff); in TEST_F() [all …]
|
D | DwarfMemoryTest.cpp | 33 memory_.Clear(); in SetUp() 34 dwarf_mem_.reset(new DwarfMemory(&memory_)); in SetUp() 60 MemoryFake memory_; member in unwindstack::DwarfMemoryTest 65 memory_.SetMemory(0, std::vector<uint8_t>{0x10, 0x18, 0xff, 0xfe}); in TEST_F() 88 memory_.SetData8(0, static_cast<uint8_t>(-10)); in TEST_F() 89 memory_.SetData8(1, 200); in TEST_F() 96 memory_.SetData16(0x10, static_cast<uint16_t>(-1000)); in TEST_F() 97 memory_.SetData16(0x12, 50100); in TEST_F() 105 memory_.SetData32(0x100, static_cast<uint32_t>(-1000000000)); in TEST_F() 106 memory_.SetData32(0x104, 3000000000); in TEST_F() [all …]
|
D | ElfCacheTest.cpp | 34 static void SetUpTestSuite() { memory_.reset(new MemoryFake); } in SetUpTestSuite() 64 static std::shared_ptr<Memory> memory_; member in unwindstack::ElfCacheTest 67 std::shared_ptr<Memory> ElfCacheTest::memory_; member in unwindstack::ElfCacheTest 84 Elf* elf1 = info1.GetElf(memory_, ARCH_ARM); in VerifySameMap() 86 Elf* elf2 = info2.GetElf(memory_, ARCH_ARM); in VerifySameMap() 134 Elf* elf0_1 = info0_1.GetElf(memory_, ARCH_ARM); in VerifyWithinSameMap() 137 Elf* elf0_2 = info0_2.GetElf(memory_, ARCH_ARM); in VerifyWithinSameMap() 148 Elf* elf100_1 = info100_1.GetElf(memory_, ARCH_X86); in VerifyWithinSameMap() 151 Elf* elf100_2 = info100_2.GetElf(memory_, ARCH_X86); in VerifyWithinSameMap() 162 Elf* elf200_1 = info200_1.GetElf(memory_, ARCH_X86_64); in VerifyWithinSameMap() [all …]
|
D | DwarfCfaTest.cpp | 44 memory_.Clear(); in SetUp() 46 dmem_.reset(new DwarfMemory(&memory_)); in SetUp() 63 MemoryFake memory_; member in unwindstack::DwarfCfaTest 79 this->memory_.SetMemory(0x2000, std::vector<uint8_t>{i}); in TYPED_TEST_P() 92 this->memory_.SetMemory(0x2000, std::vector<uint8_t>{0x00}); in TYPED_TEST_P() 105 this->memory_.SetMemory(0x2000, std::vector<uint8_t>{0x83, 0x04}); in TYPED_TEST_P() 120 this->memory_.SetMemory(0x2100, std::vector<uint8_t>{0x83, 0x84, 0x01}); in TYPED_TEST_P() 136 this->memory_.SetMemory(0x500, std::vector<uint8_t>{0x05, 0x03, 0x02}); in TYPED_TEST_P() 152 this->memory_.SetMemory(0x1500, std::vector<uint8_t>{0x05, 0x81, 0x01, 0x82, 0x12}); in TYPED_TEST_P() 167 this->memory_.SetMemory(0x500, std::vector<uint8_t>{0x11, 0x05, 0x10}); in TYPED_TEST_P() [all …]
|
D | MapInfoGetLoadBiasTest.cpp | 49 memory_ = new MemoryFake; in SetUp() 50 process_memory_.reset(memory_); in SetUp() 59 MemoryFake* memory_; member in unwindstack::MapInfoGetLoadBiasTest 151 InitElfData(memory_, map_info_->start()); in TEST_F() 157 InitElfData(memory_, map_info_->start()); in TEST_F() 161 memory_->Clear(); in TEST_F() 166 InitElfData(memory_, map_info_->start()); in TEST_F()
|
/system/unwinding/libunwindstack/ |
D | DwarfSection.cpp | 38 DwarfSection::DwarfSection(Memory* memory) : memory_(memory) {} in DwarfSection() 76 memory_.set_data_offset(entries_offset_); in GetCieFromOffset() 77 memory_.set_cur_offset(offset); in GetCieFromOffset() 90 if (!memory_.ReadBytes(&length32, sizeof(length32))) { in FillInCieHeader() 92 last_error_.address = memory_.cur_offset(); in FillInCieHeader() 98 if (!memory_.ReadBytes(&length64, sizeof(length64))) { in FillInCieHeader() 100 last_error_.address = memory_.cur_offset(); in FillInCieHeader() 104 cie->cfa_instructions_end = memory_.cur_offset() + length64; in FillInCieHeader() 108 if (!memory_.ReadBytes(&cie_id, sizeof(cie_id))) { in FillInCieHeader() 110 last_error_.address = memory_.cur_offset(); in FillInCieHeader() [all …]
|
D | DwarfEhFrameWithHdr.cpp | 42 memory_.clear_func_offset(); in Init() 43 memory_.clear_text_offset(); in Init() 44 memory_.set_data_offset(offset); in Init() 45 memory_.set_cur_offset(offset); in Init() 51 if (!memory_.ReadBytes(data, 4)) { in Init() 53 last_error_.address = memory_.cur_offset(); in Init() 67 table_entry_size_ = memory_.template GetEncodedSize<AddressType>(table_encoding_); in Init() 77 memory_.set_pc_offset(memory_.cur_offset()); in Init() 79 if (!memory_.template ReadEncodedValue<AddressType>(ptr_encoding, &ptr_offset)) { in Init() 81 last_error_.address = memory_.cur_offset(); in Init() [all …]
|
D | DwarfCfa.cpp | 53 memory_->set_cur_offset(start_offset); in GetLocationInfo() 62 if ((cfa_offset = memory_->cur_offset()) >= end_offset) { in GetLocationInfo() 70 if (!memory_->ReadBytes(&cfa_value, 1)) { in GetLocationInfo() 72 last_error_.address = memory_->cur_offset(); in GetLocationInfo() 83 if (!memory_->ReadULEB128(&offset)) { in GetLocationInfo() 85 last_error_.address = memory_->cur_offset(); in GetLocationInfo() 120 if (!memory_->ReadULEB128(&block_length)) { in GetLocationInfo() 122 last_error_.address = memory_->cur_offset(); in GetLocationInfo() 126 memory_->set_cur_offset(memory_->cur_offset() + block_length); in GetLocationInfo() 130 if (!memory_->ReadEncodedValue<AddressType>(cfa->operands[i], &value)) { in GetLocationInfo() [all …]
|
D | DwarfEhFrame.h | 34 return this->memory_.cur_offset() - pointer - 4; in GetCieOffsetFromFde32() 38 return this->memory_.cur_offset() - pointer - 8; in GetCieOffsetFromFde64() 43 return pc + this->memory_.cur_offset() - 4; in AdjustPcFromFde()
|
D | DwarfEhFrameWithHdr.h | 36 using DwarfSectionImpl<AddressType>::memory_; 48 return memory_.cur_offset() - pointer - 4; in GetCieOffsetFromFde32() 52 return memory_.cur_offset() - pointer - 8; in GetCieOffsetFromFde64() 57 return pc + memory_.cur_offset() - 4; in AdjustPcFromFde()
|