Home
last modified time | relevance | path

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

12

/system/unwinding/libunwindstack/tests/
DMemoryBufferTest.cpp31 std::unique_ptr<MemoryBuffer> memory_; member in unwindstack::MemoryBufferTest
35 memory_.reset(new MemoryBuffer(0)); in TEST_F()
36 ASSERT_EQ(0U, memory_->Size()); in TEST_F()
38 ASSERT_FALSE(memory_->ReadFully(0, buffer.data(), 1)); in TEST_F()
39 ASSERT_EQ(nullptr, memory_->GetPtr(0)); in TEST_F()
40 ASSERT_EQ(nullptr, memory_->GetPtr(1)); in TEST_F()
44 memory_.reset(new MemoryBuffer(256)); in TEST_F()
45 ASSERT_EQ(256U, memory_->Size()); in TEST_F()
46 ASSERT_TRUE(memory_->GetPtr(0) != nullptr); in TEST_F()
47 ASSERT_TRUE(memory_->GetPtr(1) != nullptr); 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 …]
DJitDebugTest.cpp82 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 …]
DElfCacheTest.cpp41 static void SetUpTestSuite() { memory_.reset(new MemoryFake); } in SetUpTestSuite()
131 static std::shared_ptr<Memory> memory_; member in unwindstack::ElfCacheTest
134 std::shared_ptr<Memory> ElfCacheTest::memory_; member in unwindstack::ElfCacheTest
137 Elf* elf_one = maps_->Find(0x1000)->GetElf(memory_, ARCH_ARM); in TEST_F()
139 Elf* elf_two = maps_->Find(0x2000)->GetElf(memory_, ARCH_ARM); in TEST_F()
141 Elf* elf_three = maps_->Find(0x4000)->GetElf(memory_, ARCH_ARM); in TEST_F()
145 EXPECT_EQ(maps_->Find(0x5000)->GetElf(memory_, ARCH_ARM), elf_three); in TEST_F()
150 EXPECT_EQ(maps_->Find(0x10000)->GetElf(memory_, ARCH_ARM), elf_two); in TEST_F()
155 EXPECT_EQ(maps_->Find(0x11000)->GetElf(memory_, ARCH_ARM), elf_one); in TEST_F()
160 EXPECT_EQ(maps_->Find(0x12000)->GetElf(memory_, ARCH_ARM), elf_three); 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 …]
DMemoryOfflineBufferTest.cpp30 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 …]
DMemoryCacheTest.cpp31 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 …]
DDexFilesTest.cpp96 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 …]
DMemoryThreadCacheTest.cpp32 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 …]
DElfInterfaceArmTest.cpp38 memory_.reset(fake_memory_); in SetUp()
42 std::shared_ptr<Memory> memory_; member in unwindstack::ElfInterfaceArmTest
48 ElfInterfaceArmFake interface(memory_); in TEST_F()
65 ElfInterfaceArmFake interface(memory_); in TEST_F()
74 ElfInterfaceArmFake interface(memory_); in TEST_F()
83 ElfInterfaceArmFake interface(memory_); in TEST_F()
92 ElfInterfaceArmFake interface(memory_); in TEST_F()
102 ElfInterfaceArmFake interface(memory_); in TEST_F()
113 ElfInterfaceArmFake interface(memory_); in TEST_F()
125 ElfInterfaceArmFake interface(memory_); in TEST_F()
[all …]
DMapInfoGetLoadBiasTest.cpp49 memory_ = new MemoryFake; in SetUp()
50 process_memory_.reset(memory_); in SetUp()
60 MemoryFake* memory_; member in unwindstack::MapInfoGetLoadBiasTest
152 InitElfData(memory_, map_info_->start()); in TEST_F()
158 InitElfData(memory_, map_info_->start()); in TEST_F()
162 memory_->Clear(); in TEST_F()
167 InitElfData(memory_, map_info_->start()); in TEST_F()
DMapInfoCreateMemoryTest.cpp76 memory_ = new MemoryFake; in SetUp()
77 process_memory_.reset(memory_); in SetUp()
80 MemoryFake* memory_; member in unwindstack::MapInfoCreateMemoryTest
265 memory_->SetMemory(info->start(), buffer.data(), buffer.size()); in TEST_F()
290 memory_->SetMemory(0x1000, &ehdr, sizeof(ehdr)); in TEST_F()
291 memory_->SetMemoryBlock(0x1000 + sizeof(ehdr), 0x1600 - sizeof(ehdr), 0xab); in TEST_F()
294 memory_->SetMemoryBlock(0x3000, 0x2000, 0x5d); in TEST_F()
334 memory_->SetMemory(0x1000, &ehdr, sizeof(ehdr)); in TEST_F()
335 memory_->SetMemoryBlock(0x1000 + sizeof(ehdr), 0x2000 - sizeof(ehdr), 0x12); in TEST_F()
336 memory_->SetMemoryBlock(0x2000, 0x1000, 0x23); in TEST_F()
[all …]
DMapInfoGetElfTest.cpp47 memory_ = new MemoryFake; in SetUp()
48 process_memory_.reset(memory_); in SetUp()
67 MemoryFake* memory_; member in unwindstack::MapInfoGetElfTest
84 memory_->SetMemory(0x3000, &ehdr, sizeof(ehdr)); in TEST_F()
103 memory_->SetMemory(0x8000, &ehdr, sizeof(ehdr)); in TEST_F()
116 memory_->SetMemory(0x3000, &ehdr, sizeof(ehdr)); in TEST_F()
127 memory_->SetMemory(0x2000 + offset, ptr, size); in TEST_F()
142 memory_->SetMemory(0x5000 + offset, ptr, size); in TEST_F()
333 memory_->SetMemory(0x7000, &ehdr, sizeof(ehdr)); in TEST_F()
362 memory_->SetMemory(0x7000, &ehdr, sizeof(ehdr)); in TEST_F()
[all …]
DElfInterfaceTest.cpp52 memory_.reset(fake_memory_); in SetUp()
164 std::shared_ptr<Memory> memory_; member in unwindstack::ElfInterfaceTest
183 std::unique_ptr<ElfInterface> elf(new ElfInterfaceType(memory_)); in SinglePtLoad()
221 std::unique_ptr<ElfInterface> elf(new ElfInterfaceType(memory_)); in MultipleExecutablePtLoads()
288 std::unique_ptr<ElfInterface> elf(new ElfInterfaceType(memory_)); in MultipleExecutablePtLoadsIncrementsNotSizeOfPhdr()
357 std::unique_ptr<ElfInterface> elf(new ElfInterfaceType(memory_)); in NonExecutablePtLoads()
414 std::unique_ptr<ElfInterface> elf(new ElfInterfaceType(memory_)); in ManyPhdrs()
484 ElfInterfaceArm elf_arm(memory_); in TEST_F()
581 std::unique_ptr<ElfInterface> elf(new ElfInterfaceType(memory_)); in Soname()
602 std::unique_ptr<ElfInterface> elf(new ElfInterfaceType(memory_)); in SonameAfterDtNull()
[all …]
/system/unwinding/libunwindstack/
DDwarfSection.cpp44 DwarfSection::DwarfSection(std::shared_ptr<Memory>& memory) : memory_(memory) {} in DwarfSection()
82 memory_.set_data_offset(entries_offset_); in GetCieFromOffset()
83 memory_.set_cur_offset(offset); in GetCieFromOffset()
96 if (!memory_.ReadBytes(&length32, sizeof(length32))) { in FillInCieHeader()
98 last_error_.address = memory_.cur_offset(); in FillInCieHeader()
104 if (!memory_.ReadBytes(&length64, sizeof(length64))) { in FillInCieHeader()
106 last_error_.address = memory_.cur_offset(); in FillInCieHeader()
110 cie->cfa_instructions_end = memory_.cur_offset() + length64; in FillInCieHeader()
115 if (!memory_.ReadBytes(&cie_id, sizeof(cie_id))) { in FillInCieHeader()
117 last_error_.address = memory_.cur_offset(); in FillInCieHeader()
[all …]
DDwarfEhFrameWithHdr.cpp47 memory_.clear_func_offset(); in Init()
48 memory_.clear_text_offset(); in Init()
49 memory_.set_data_offset(info.offset); in Init()
50 memory_.set_cur_offset(info.offset); in Init()
56 if (!memory_.ReadBytes(data, 4)) { in Init()
58 last_error_.address = memory_.cur_offset(); in Init()
72 table_entry_size_ = memory_.template GetEncodedSize<AddressType>(table_encoding_); in Init()
82 memory_.set_pc_offset(memory_.cur_offset()); in Init()
84 if (!memory_.template ReadEncodedValue<AddressType>(ptr_encoding, &ptr_offset)) { in Init()
86 last_error_.address = memory_.cur_offset(); in Init()
[all …]
DDwarfCfa.cpp53 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 …]
DDwarfEhFrameWithHdr.h38 using DwarfSectionImpl<AddressType>::memory_;
50 return memory_.cur_offset() - pointer - 4; in GetCieOffsetFromFde32()
54 return memory_.cur_offset() - pointer - 8; in GetCieOffsetFromFde64()
59 return pc + memory_.cur_offset() - 4; in AdjustPcFromFde()
DDwarfEhFrame.h35 return this->memory_.cur_offset() - pointer - 4; in GetCieOffsetFromFde32()
39 return this->memory_.cur_offset() - pointer - 8; in GetCieOffsetFromFde64()
44 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 …]
DElfInterface.cpp87 auto decompressed = std::make_shared<MemoryXz>(memory_.get(), gnu_debugdata_offset_, in CreateGnuDebugdataMemory()
162 DwarfEhFrameWithHdr<AddressType>* eh_frame_hdr = new DwarfEhFrameWithHdr<AddressType>(memory_); in InitHeaders()
173 eh_frame_.reset(new DwarfEhFrame<AddressType>(memory_)); in InitHeaders()
181 std::shared_ptr<Memory> debug_memory = memory_; in InitHeaders()
183 debug_memory = CreateMemoryFromCompressedSection<ChdrType>(debug_frame_info_, memory_); in InitHeaders()
196 if (!memory_->ReadFully(0, &ehdr, sizeof(ehdr))) { in ReadAllHeaders()
237 if (!memory_->ReadFully(offset, &phdr, sizeof(phdr))) { in ReadProgramHeaders()
298 if (!memory_->ReadFully(gnu_build_id_offset_ + offset, &hdr, sizeof(hdr))) { in ReadBuildID()
308 if (!memory_->ReadFully(gnu_build_id_offset_ + offset, &(name[0]), hdr.n_namesz)) { in ReadBuildID()
324 if (memory_->ReadFully(gnu_build_id_offset_ + offset, &build_id[0], hdr.n_descsz)) { in ReadBuildID()
[all …]
DGlobal.cpp33 Global::Global(std::shared_ptr<Memory>& memory) : memory_(memory) {} in Global()
35 : memory_(memory), search_libs_(search_libs) {} in Global()
84 Elf* elf = map_zero->GetElf(memory_, arch()); in FindAndReadVariable()
DGlobalDebugImpl.h100 if (!this->memory_->ReadFully(addr, &desc, kSizeOfDescriptorV2)) { in ReadDescriptor()
103 if (!this->memory_->ReadFully(addr, &desc, kSizeOfDescriptorV1)) { in ReadDescriptor()
250 if (!memory_->ReadFully(uid.address, &data, jit_entry_size_)) { in ReadNewEntries()
267 bool ok = this->Load(maps, memory_, data.symfile_addr, data.symfile_size.value, symfile); in ReadNewEntries()
309 if (!(memory_->ReadFully(next_field_addr, &address[i], sizeof(address[i])))) { in ReadNextField()
320 if (!memory_->ReadFully(address[i] + seqlock_offset_, &seqlock[i], sizeof(seqlock[i]))) { in ReadNextField()
346 if (!memory_->Read32(uid.address + seqlock_offset_, &seen_seqlock)) {
/system/unwinding/libunwindstack/include/unwindstack/
DElf.h40 Elf(std::shared_ptr<Memory>& memory) : memory_(memory) {} in Elf()
86 std::shared_ptr<Memory> memory() { return memory_; } in memory()
119 std::shared_ptr<Memory> memory_; variable
DDwarfMemory.h30 DwarfMemory(std::shared_ptr<Memory>& memory) : memory_(memory) {} in DwarfMemory()
66 std::shared_ptr<Memory> memory_;

12