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