Home
last modified time | relevance | path

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

12

/system/core/libunwindstack/tests/
DDwarfEhFrameWithHdrTest.cpp60 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 …]
DMemoryBufferTest.cpp30 memory_.reset(new MemoryBuffer); in SetUp()
32 std::unique_ptr<MemoryBuffer> memory_; member in unwindstack::MemoryBufferTest
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_->Resize(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 …]
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 …]
DJitDebugTest.cpp83 memory_ = new MemoryFake; in SetUp()
84 process_memory_.reset(memory_); in SetUp()
102 memory_->SetMemory(offset, &ehdr, sizeof(ehdr)); in CreateElf()
107 memory_->SetMemory(offset + sh_offset, &shdr, sizeof(shdr)); in CreateElf()
115 memory_->SetMemory(offset + sh_offset, &shdr, sizeof(shdr)); in CreateElf()
116 memory_->SetMemory(offset + 0x500, ".debug_frame"); in CreateElf()
125 memory_->SetMemory(offset + sh_offset, &shdr, sizeof(shdr)); in CreateElf()
131 memory_->SetData32(dwarf_offset, 0xfc); in CreateElf()
132 memory_->SetData32(dwarf_offset + 0x4, 0xffffffff); in CreateElf()
133 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.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 …]
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()
155 MemoryFake memory_; member in unwindstack::ElfInterfaceTest
168 memory_.SetMemory(offset, &sym, sizeof(sym)); in InitSym()
169 memory_.SetMemory(sym_offset + name_offset, name, strlen(name) + 1); in InitSym()
174 std::unique_ptr<ElfInterface> elf(new ElfInterfaceType(&memory_)); in SinglePtLoad()
180 memory_.SetMemory(0, &ehdr, sizeof(ehdr)); in SinglePtLoad()
188 memory_.SetMemory(0x100, &phdr, sizeof(phdr)); in SinglePtLoad()
212 std::unique_ptr<ElfInterface> elf(new ElfInterfaceType(&memory_)); in MultipleExecutablePtLoads()
218 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()
109 MemoryFake* memory_; member in unwindstack::ElfTest
113 Elf elf(memory_); in TEST_F()
120 Elf elf(memory_); in TEST_F()
125 memory_->SetData32(0, 0x7f000000); in TEST_F()
[all …]
DDwarfCfaLogTest.cpp44 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 …]
DDwarfSectionImplTest.cpp62 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, &regs, &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, &regs, &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, &regs, &finished)); in TYPED_TEST_P()
157 this->memory_.SetMemory(0x5000, std::vector<uint8_t>{0x0c, 0x00, 0x00, 0x00, 0x80}); in TYPED_TEST_P()
[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 …]
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 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 …]
DDwarfCfaTest.cpp44 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 …]
DMapInfoGetLoadBiasTest.cpp49 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()
DDexFilesTest.cpp96 memory_ = new MemoryFake; in SetUp()
97 process_memory_.reset(memory_); in SetUp()
118 MemoryFake* memory_; member in unwindstack::DexFilesTest
125 memory_->SetData32(addr + 12, head); in WriteDescriptor32()
130 memory_->SetData64(addr + 16, head); in WriteDescriptor64()
137 memory_->SetData32(entry_addr, next); in WriteEntry32()
139 memory_->SetData32(entry_addr + 4, prev); in WriteEntry32()
141 memory_->SetData32(entry_addr + 8, dex_file); in WriteEntry32()
148 memory_->SetData64(entry_addr, next); in WriteEntry64()
150 memory_->SetData64(entry_addr + 8, prev); in WriteEntry64()
[all …]
/system/core/libunwindstack/
DDwarfSection.cpp38 DwarfSection::DwarfSection(Memory* memory) : memory_(memory) {} in DwarfSection()
73 memory_.set_data_offset(entries_offset_); in GetCieFromOffset()
74 memory_.set_cur_offset(offset); in GetCieFromOffset()
87 if (!memory_.ReadBytes(&length32, sizeof(length32))) { in FillInCieHeader()
89 last_error_.address = memory_.cur_offset(); in FillInCieHeader()
95 if (!memory_.ReadBytes(&length64, sizeof(length64))) { in FillInCieHeader()
97 last_error_.address = memory_.cur_offset(); in FillInCieHeader()
101 cie->cfa_instructions_end = memory_.cur_offset() + length64; in FillInCieHeader()
105 if (!memory_.ReadBytes(&cie_id, sizeof(cie_id))) { in FillInCieHeader()
107 last_error_.address = memory_.cur_offset(); in FillInCieHeader()
[all …]
DDwarfEhFrameWithHdr.cpp42 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 …]
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 …]
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()
DDwarfEhFrameWithHdr.h36 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()
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 …]

12