Lines Matching refs:dwarf_mem_

34     dwarf_mem_.reset(new DwarfMemory(&memory_));  in SetUp()
61 std::unique_ptr<DwarfMemory> dwarf_mem_; member in unwindstack::DwarfMemoryTest
68 ASSERT_TRUE(dwarf_mem_->ReadBytes(&byte, 1)); in TEST_F()
70 ASSERT_TRUE(dwarf_mem_->ReadBytes(&byte, 1)); in TEST_F()
72 ASSERT_TRUE(dwarf_mem_->ReadBytes(&byte, 1)); in TEST_F()
74 ASSERT_TRUE(dwarf_mem_->ReadBytes(&byte, 1)); in TEST_F()
76 ASSERT_EQ(4U, dwarf_mem_->cur_offset()); in TEST_F()
78 dwarf_mem_->set_cur_offset(2); in TEST_F()
79 ASSERT_TRUE(dwarf_mem_->ReadBytes(&byte, 1)); in TEST_F()
81 ASSERT_EQ(3U, dwarf_mem_->cur_offset()); in TEST_F()
90 ASSERT_TRUE(dwarf_mem_->ReadSigned<int8_t>(&value)); in TEST_F()
92 ASSERT_TRUE(dwarf_mem_->ReadSigned<int8_t>(&value)); in TEST_F()
98 dwarf_mem_->set_cur_offset(0x10); in TEST_F()
99 ASSERT_TRUE(dwarf_mem_->ReadSigned<int16_t>(&value)); in TEST_F()
101 ASSERT_TRUE(dwarf_mem_->ReadSigned<int16_t>(&value)); in TEST_F()
107 dwarf_mem_->set_cur_offset(0x100); in TEST_F()
108 ASSERT_TRUE(dwarf_mem_->ReadSigned<int32_t>(&value)); in TEST_F()
110 ASSERT_TRUE(dwarf_mem_->ReadSigned<int32_t>(&value)); in TEST_F()
116 dwarf_mem_->set_cur_offset(0x200); in TEST_F()
117 ASSERT_TRUE(dwarf_mem_->ReadSigned<int64_t>(&value)); in TEST_F()
119 ASSERT_TRUE(dwarf_mem_->ReadSigned<int64_t>(&value)); in TEST_F()
127 ASSERT_TRUE(dwarf_mem_->ReadULEB128(&value)); in TEST_F()
128 ASSERT_EQ(1U, dwarf_mem_->cur_offset()); in TEST_F()
131 ASSERT_TRUE(dwarf_mem_->ReadULEB128(&value)); in TEST_F()
132 ASSERT_EQ(3U, dwarf_mem_->cur_offset()); in TEST_F()
135 ASSERT_TRUE(dwarf_mem_->ReadULEB128(&value)); in TEST_F()
136 ASSERT_EQ(7U, dwarf_mem_->cur_offset()); in TEST_F()
145 ASSERT_TRUE(dwarf_mem_->ReadSLEB128(&value)); in TEST_F()
146 ASSERT_EQ(1U, dwarf_mem_->cur_offset()); in TEST_F()
149 ASSERT_TRUE(dwarf_mem_->ReadSLEB128(&value)); in TEST_F()
150 ASSERT_EQ(2U, dwarf_mem_->cur_offset()); in TEST_F()
153 ASSERT_TRUE(dwarf_mem_->ReadSLEB128(&value)); in TEST_F()
154 ASSERT_EQ(4U, dwarf_mem_->cur_offset()); in TEST_F()
157 ASSERT_TRUE(dwarf_mem_->ReadSLEB128(&value)); in TEST_F()
158 ASSERT_EQ(6U, dwarf_mem_->cur_offset()); in TEST_F()
161 ASSERT_TRUE(dwarf_mem_->ReadSLEB128(&value)); in TEST_F()
162 ASSERT_EQ(10U, dwarf_mem_->cur_offset()); in TEST_F()
165 ASSERT_TRUE(dwarf_mem_->ReadSLEB128(&value)); in TEST_F()
166 ASSERT_EQ(14U, dwarf_mem_->cur_offset()); in TEST_F()
174 ASSERT_EQ(expected, dwarf_mem_->GetEncodedSize<AddressType>(encoding)) in GetEncodedSizeTest()
242 ASSERT_TRUE(dwarf_mem_->ReadEncodedValue<AddressType>(0xff, &value)); in ReadEncodedValue_omit()
256 ASSERT_FALSE(dwarf_mem_->ReadEncodedValue<uint32_t>(0x00, &value)); in TEST_F()
260 ASSERT_TRUE(dwarf_mem_->ReadEncodedValue<uint32_t>(0x00, &value)); in TEST_F()
261 ASSERT_EQ(4U, dwarf_mem_->cur_offset()); in TEST_F()
267 ASSERT_FALSE(dwarf_mem_->ReadEncodedValue<uint64_t>(0x00, &value)); in TEST_F()
271 ASSERT_TRUE(dwarf_mem_->ReadEncodedValue<uint64_t>(0x00, &value)); in TEST_F()
272 ASSERT_EQ(8U, dwarf_mem_->cur_offset()); in TEST_F()
278 dwarf_mem_->set_cur_offset(1); in TEST_F()
279 ASSERT_FALSE(dwarf_mem_->ReadEncodedValue<uint32_t>(0x50, &value)); in TEST_F()
283 ASSERT_TRUE(dwarf_mem_->ReadEncodedValue<uint32_t>(0x50, &value)); in TEST_F()
284 ASSERT_EQ(8U, dwarf_mem_->cur_offset()); in TEST_F()
290 dwarf_mem_->set_cur_offset(1); in TEST_F()
291 ASSERT_FALSE(dwarf_mem_->ReadEncodedValue<uint64_t>(0x50, &value)); in TEST_F()
295 ASSERT_TRUE(dwarf_mem_->ReadEncodedValue<uint64_t>(0x50, &value)); in TEST_F()
296 ASSERT_EQ(16U, dwarf_mem_->cur_offset()); in TEST_F()
306 ASSERT_TRUE(dwarf_mem_->ReadEncodedValue<AddressType>(0x01, &value)); in ReadEncodedValue_leb128()
309 dwarf_mem_->set_cur_offset(0); in ReadEncodedValue_leb128()
311 ASSERT_TRUE(dwarf_mem_->ReadEncodedValue<AddressType>(0x09, &value)); in ReadEncodedValue_leb128()
328 ASSERT_TRUE(dwarf_mem_->ReadEncodedValue<AddressType>(0x0d, &value)); in ReadEncodedValue_data1()
331 dwarf_mem_->set_cur_offset(0); in ReadEncodedValue_data1()
332 ASSERT_TRUE(dwarf_mem_->ReadEncodedValue<AddressType>(0x0e, &value)); in ReadEncodedValue_data1()
349 ASSERT_TRUE(dwarf_mem_->ReadEncodedValue<AddressType>(0x02, &value)); in ReadEncodedValue_data2()
352 dwarf_mem_->set_cur_offset(0); in ReadEncodedValue_data2()
353 ASSERT_TRUE(dwarf_mem_->ReadEncodedValue<AddressType>(0x0a, &value)); in ReadEncodedValue_data2()
370 ASSERT_TRUE(dwarf_mem_->ReadEncodedValue<AddressType>(0x03, &value)); in ReadEncodedValue_data4()
373 dwarf_mem_->set_cur_offset(0); in ReadEncodedValue_data4()
374 ASSERT_TRUE(dwarf_mem_->ReadEncodedValue<AddressType>(0x0b, &value)); in ReadEncodedValue_data4()
391 ASSERT_TRUE(dwarf_mem_->ReadEncodedValue<AddressType>(0x04, &value)); in ReadEncodedValue_data8()
394 dwarf_mem_->set_cur_offset(0); in ReadEncodedValue_data8()
395 ASSERT_TRUE(dwarf_mem_->ReadEncodedValue<AddressType>(0x0c, &value)); in ReadEncodedValue_data8()
412 dwarf_mem_->set_pc_offset(0x2000); in ReadEncodedValue_non_zero_adjust()
413 ASSERT_TRUE(dwarf_mem_->ReadEncodedValue<AddressType>(0x14, &value)); in ReadEncodedValue_non_zero_adjust()
430 dwarf_mem_->set_cur_offset(UINT64_MAX); in ReadEncodedValue_overflow()
431 ASSERT_FALSE(dwarf_mem_->ReadEncodedValue<AddressType>(0x50, &value)); in ReadEncodedValue_overflow()
446 ASSERT_FALSE(dwarf_mem_->ReadEncodedValue<AddressType>(0xc3, &value)); in ReadEncodedValue_high_bit_set()
448 dwarf_mem_->set_func_offset(0x60000); in ReadEncodedValue_high_bit_set()
449 dwarf_mem_->set_cur_offset(0); in ReadEncodedValue_high_bit_set()
450 ASSERT_TRUE(dwarf_mem_->ReadEncodedValue<AddressType>(0xc3, &value)); in ReadEncodedValue_high_bit_set()
485 ASSERT_TRUE(dwarf_mem_->AdjustEncodedValue(0x00, &value)); in TEST_F()
491 ASSERT_FALSE(dwarf_mem_->AdjustEncodedValue(0x10, &value)); in TEST_F()
493 dwarf_mem_->set_pc_offset(0x2000); in TEST_F()
494 ASSERT_TRUE(dwarf_mem_->AdjustEncodedValue(0x10, &value)); in TEST_F()
497 dwarf_mem_->set_pc_offset(static_cast<uint64_t>(-4)); in TEST_F()
499 ASSERT_TRUE(dwarf_mem_->AdjustEncodedValue(0x10, &value)); in TEST_F()
505 ASSERT_FALSE(dwarf_mem_->AdjustEncodedValue(0x20, &value)); in TEST_F()
507 dwarf_mem_->set_text_offset(0x1000); in TEST_F()
508 ASSERT_TRUE(dwarf_mem_->AdjustEncodedValue(0x20, &value)); in TEST_F()
511 dwarf_mem_->set_text_offset(static_cast<uint64_t>(-16)); in TEST_F()
513 ASSERT_TRUE(dwarf_mem_->AdjustEncodedValue(0x20, &value)); in TEST_F()
519 ASSERT_FALSE(dwarf_mem_->AdjustEncodedValue(0x30, &value)); in TEST_F()
521 dwarf_mem_->set_data_offset(0x1200); in TEST_F()
522 ASSERT_TRUE(dwarf_mem_->AdjustEncodedValue(0x30, &value)); in TEST_F()
525 dwarf_mem_->set_data_offset(static_cast<uint64_t>(-256)); in TEST_F()
527 ASSERT_TRUE(dwarf_mem_->AdjustEncodedValue(0x30, &value)); in TEST_F()
533 ASSERT_FALSE(dwarf_mem_->AdjustEncodedValue(0x40, &value)); in TEST_F()
535 dwarf_mem_->set_func_offset(0x60000); in TEST_F()
536 ASSERT_TRUE(dwarf_mem_->AdjustEncodedValue(0x40, &value)); in TEST_F()
539 dwarf_mem_->set_func_offset(static_cast<uint64_t>(-4096)); in TEST_F()
541 ASSERT_TRUE(dwarf_mem_->AdjustEncodedValue(0x40, &value)); in TEST_F()