Home
last modified time | relevance | path

Searched refs:memory_ (Results 1 – 25 of 51) sorted by relevance

123

/system/core/libunwindstack/tests/
DMemoryBufferTest.cpp31 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 …]
DElfInterfaceArmTest.cpp36 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 …]
DSymbolsTest.cpp45 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 …]
DDwarfEhFrameWithHdrTest.cpp66 memory_.Clear(); in SetUp()
67 eh_frame_ = new TestDwarfEhFrameWithHdr<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_.SetData8(0x1003, 0x1); in TYPED_TEST_P()
103 this->memory_.SetData8(0x1003, DW_EH_PE_sdata4); in TYPED_TEST_P()
106 this->memory_.SetData32(0x1006, 0); in TYPED_TEST_P()
111 this->memory_.SetData32(0x1006, 126); in TYPED_TEST_P()
[all …]
DJitDebugTest.cpp79 memory_ = new MemoryFake; in SetUp()
80 process_memory_.reset(memory_); in SetUp()
98 memory_->SetMemory(offset, &ehdr, sizeof(ehdr)); in CreateElf()
103 memory_->SetMemory(offset + sh_offset, &shdr, sizeof(shdr)); in CreateElf()
111 memory_->SetMemory(offset + sh_offset, &shdr, sizeof(shdr)); in CreateElf()
112 memory_->SetMemory(offset + 0x500, ".debug_frame"); in CreateElf()
121 memory_->SetMemory(offset + sh_offset, &shdr, sizeof(shdr)); in CreateElf()
127 memory_->SetData32(dwarf_offset, 0xfc); in CreateElf()
128 memory_->SetData32(dwarf_offset + 0x4, 0xffffffff); in CreateElf()
129 memory_->SetData8(dwarf_offset + 0x8, 1); in CreateElf()
[all …]
DDwarfEhFrameTest.cpp35 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 …]
DMemoryOfflineBufferTest.cpp31 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 …]
DMemoryFileTest.cpp42 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 …]
DElfInterfaceTest.cpp44 memory_.Clear(); in SetUp()
48 memory_.SetMemory(offset, string, strlen(string) + 1); in SetStringMemory()
134 MemoryFake memory_; member in unwindstack::ElfInterfaceTest
147 memory_.SetMemory(offset, &sym, sizeof(sym)); in InitSym()
148 memory_.SetMemory(sym_offset + name_offset, name, strlen(name) + 1); in InitSym()
153 std::unique_ptr<ElfInterface> elf(new ElfInterfaceType(&memory_)); in SinglePtLoad()
159 memory_.SetMemory(0, &ehdr, sizeof(ehdr)); in SinglePtLoad()
167 memory_.SetMemory(0x100, &phdr, sizeof(phdr)); in SinglePtLoad()
191 std::unique_ptr<ElfInterface> elf(new ElfInterfaceType(&memory_)); in MultipleExecutablePtLoads()
197 memory_.SetMemory(0, &ehdr, sizeof(ehdr)); in MultipleExecutablePtLoads()
[all …]
DElfTest.cpp44 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 …]
DDwarfCfaLogTest.cpp43 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 …]
DDwarfSectionImplTest.cpp61 memory_.Clear(); in SetUp()
62 section_ = new TestDwarfSectionImpl<TypeParam>(&memory_); in SetUp()
68 MemoryFake memory_; member in unwindstack::DwarfSectionImplTest
108 ASSERT_FALSE(this->section_->Eval(&cie, &this->memory_, loc_regs, &regs, &finished)); in TYPED_TEST_P()
122 this->memory_.SetMemory(0x5000, std::vector<uint8_t>{0x96, 0x96, 0x96}); in TYPED_TEST_P()
125 ASSERT_FALSE(this->section_->Eval(&cie, &this->memory_, loc_regs, &regs, &finished)); in TYPED_TEST_P()
138 this->memory_.SetMemory(0x5000, std::vector<uint8_t>{0x0c, 0x00, 0x00, 0x00, 0x80}); in TYPED_TEST_P()
140 this->memory_.SetMemory(0x80000000, &cfa_value, sizeof(cfa_value)); in TYPED_TEST_P()
143 ASSERT_FALSE(this->section_->Eval(&cie, &this->memory_, loc_regs, &regs, &finished)); in TYPED_TEST_P()
156 this->memory_.SetMemory(0x5000, std::vector<uint8_t>{0x0c, 0x00, 0x00, 0x00, 0x80}); in TYPED_TEST_P()
[all …]
DMemoryCacheTest.cpp32 memory_ = new MemoryFake; in SetUp()
33 memory_cache_.reset(new MemoryCache(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::MemoryCacheTest
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 …]
DDwarfDebugFrameTest.cpp37 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 …]
DDwarfMemoryTest.cpp33 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 …]
DElfCacheTest.cpp34 static void SetUpTestCase() { memory_.reset(new MemoryFake); } in SetUpTestCase()
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 …]
DDwarfCfaTest.cpp42 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 …]
DDexFilesTest.cpp83 memory_ = new MemoryFake; in SetUp()
84 process_memory_.reset(memory_); in SetUp()
103 MemoryFake* memory_; member in unwindstack::DexFilesTest
110 memory_->SetData32(addr + 12, head); in WriteDescriptor32()
115 memory_->SetData64(addr + 16, head); in WriteDescriptor64()
122 memory_->SetData32(entry_addr, next); in WriteEntry32()
124 memory_->SetData32(entry_addr + 4, prev); in WriteEntry32()
126 memory_->SetData32(entry_addr + 8, dex_file); in WriteEntry32()
133 memory_->SetData64(entry_addr, next); in WriteEntry64()
135 memory_->SetData64(entry_addr + 8, prev); in WriteEntry64()
[all …]
DMapInfoGetLoadBiasTest.cpp49 memory_ = new MemoryFake; in SetUp()
50 process_memory_.reset(memory_); in SetUp()
59 MemoryFake* memory_; member in unwindstack::MapInfoGetLoadBiasTest
150 InitElfData(memory_, map_info_->start); in TEST_F()
156 InitElfData(memory_, map_info_->start); in TEST_F()
160 memory_->Clear(); in TEST_F()
165 InitElfData(memory_, map_info_->start); in TEST_F()
/system/core/libunwindstack/
DDwarfSection.cpp37 DwarfSection::DwarfSection(Memory* memory) : memory_(memory) {} in DwarfSection()
72 memory_.set_cur_offset(offset); in GetCieFromOffset()
85 if (!memory_.ReadBytes(&length32, sizeof(length32))) { in FillInCieHeader()
87 last_error_.address = memory_.cur_offset(); in FillInCieHeader()
93 if (!memory_.ReadBytes(&length64, sizeof(length64))) { in FillInCieHeader()
95 last_error_.address = memory_.cur_offset(); in FillInCieHeader()
99 cie->cfa_instructions_end = memory_.cur_offset() + length64; in FillInCieHeader()
103 if (!memory_.ReadBytes(&cie_id, sizeof(cie_id))) { in FillInCieHeader()
105 last_error_.address = memory_.cur_offset(); in FillInCieHeader()
115 cie->cfa_instructions_end = memory_.cur_offset() + length32; in FillInCieHeader()
[all …]
DDwarfEhFrameWithHdr.cpp38 memory_.clear_func_offset(); in Init()
39 memory_.clear_text_offset(); in Init()
40 memory_.set_data_offset(offset); in Init()
41 memory_.set_cur_offset(offset); in Init()
46 if (!memory_.ReadBytes(data, 4)) { in Init()
48 last_error_.address = memory_.cur_offset(); in Init()
62 table_entry_size_ = memory_.template GetEncodedSize<AddressType>(table_encoding_); in Init()
72 memory_.set_pc_offset(memory_.cur_offset()); in Init()
73 if (!memory_.template ReadEncodedValue<AddressType>(ptr_encoding_, &ptr_offset_)) { in Init()
75 last_error_.address = memory_.cur_offset(); in Init()
[all …]
DDwarfCfa.cpp51 memory_->set_cur_offset(start_offset); in GetLocationInfo()
60 if ((cfa_offset = memory_->cur_offset()) >= end_offset) { in GetLocationInfo()
68 if (!memory_->ReadBytes(&cfa_value, 1)) { in GetLocationInfo()
70 last_error_.address = memory_->cur_offset(); in GetLocationInfo()
81 if (!memory_->ReadULEB128(&offset)) { in GetLocationInfo()
83 last_error_.address = memory_->cur_offset(); in GetLocationInfo()
118 if (!memory_->ReadULEB128(&block_length)) { in GetLocationInfo()
120 last_error_.address = memory_->cur_offset(); in GetLocationInfo()
124 memory_->set_cur_offset(memory_->cur_offset() + block_length); in GetLocationInfo()
128 if (!memory_->ReadEncodedValue<AddressType>(cfa->operands[i], &value)) { in GetLocationInfo()
[all …]
DDwarfEhFrame.h34 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()
DDwarfOp.cpp1485 memory_->set_cur_offset(start); in Eval()
1493 if (memory_->cur_offset() < end) { in Eval()
1506 if (memory_->cur_offset() < end) { in Eval()
1519 while (memory_->cur_offset() < end) { in Eval()
1536 if (!memory_->ReadBytes(&cur_op_, 1)) { in Decode()
1538 last_error_.address = memory_->cur_offset(); in Decode()
1559 if (!memory_->ReadEncodedValue<AddressType>(op->operands[i], &value)) { in Decode()
1561 last_error_.address = memory_->cur_offset(); in Decode()
1572 memory_->set_cur_offset(start); in GetLogInfo()
1573 while (memory_->cur_offset() < end) { in GetLogInfo()
[all …]
DDwarfEhFrameWithHdr.h36 using DwarfSectionImpl<AddressType>::memory_;
52 return this->memory_.cur_offset() - pointer - 4; in GetCieOffsetFromFde32()
56 return this->memory_.cur_offset() - pointer - 8; in GetCieOffsetFromFde64()
61 return pc + this->memory_.cur_offset() - 4; in AdjustPcFromFde()

123