Lines Matching refs:section
42 using google_breakpad::test_assembler::Section;
723 Section s;
727 Section s(kBigEndian);
730 // A fixture class for TestAssembler::Section tests.
733 Section section;
766 section.Append(data, sizeof(data));
767 ASSERT_TRUE(section.GetContents(&contents));
773 section.Append(data, sizeof(data));
774 section.Append(data, sizeof(data));
775 ASSERT_TRUE(section.GetContents(&contents));
785 section.Append(s1);
786 section.Append(s2);
787 ASSERT_TRUE(section.GetContents(&contents));
792 section.AppendCString("howdy");
793 section.AppendCString("");
794 section.AppendCString("there");
795 ASSERT_TRUE(section.GetContents(&contents));
800 section.AppendCString("howdy", 3);
801 section.AppendCString("there", 5);
802 section.AppendCString("fred", 6);
803 section.AppendCString("natalie", 0);
804 section.AppendCString("", 10);
805 ASSERT_TRUE(section.GetContents(&contents));
810 section.Append((size_t) 10, '*');
811 ASSERT_TRUE(section.GetContents(&contents));
816 section.Append(kLittleEndian, 1, 42);
817 ASSERT_TRUE(section.GetContents(&contents));
822 section.Append(kLittleEndian, 2, 0x15a1);
823 ASSERT_TRUE(section.GetContents(&contents));
828 section.Append(kLittleEndian, 3, 0x59ae8d);
829 ASSERT_TRUE(section.GetContents(&contents));
834 section.Append(kLittleEndian, 4, 0x51603c56);
835 ASSERT_TRUE(section.GetContents(&contents));
840 section.Append(kLittleEndian, 5, 0x385e2803b4ULL);
841 ASSERT_TRUE(section.GetContents(&contents));
846 section.Append(kLittleEndian, 6, 0xc7db9534dd1fULL);
847 ASSERT_TRUE(section.GetContents(&contents));
852 section.Append(kLittleEndian, 7, 0x1445c9f1b843e6ULL);
853 ASSERT_TRUE(section.GetContents(&contents));
858 section.Append(kLittleEndian, 8, 0xaf48019dfe5c01e5ULL);
859 ASSERT_TRUE(section.GetContents(&contents));
864 section.Append(kBigEndian, 1, 0xd0ULL);
865 ASSERT_TRUE(section.GetContents(&contents));
870 section.Append(kBigEndian, 2, 0x2e7eULL);
871 ASSERT_TRUE(section.GetContents(&contents));
876 section.Append(kBigEndian, 3, 0x37dad6ULL);
877 ASSERT_TRUE(section.GetContents(&contents));
882 section.Append(kBigEndian, 4, 0x715935c7ULL);
883 ASSERT_TRUE(section.GetContents(&contents));
888 section.Append(kBigEndian, 5, 0x42baeb02b7ULL);
889 ASSERT_TRUE(section.GetContents(&contents));
894 section.Append(kBigEndian, 6, 0xf1cdf10e7b18ULL);
895 ASSERT_TRUE(section.GetContents(&contents));
900 section.Append(kBigEndian, 7, 0xf50a724f0b0d20ULL);
901 ASSERT_TRUE(section.GetContents(&contents));
906 section.Append(kBigEndian, 8, 0xa6b2cb5e98dc9c16ULL);
907 ASSERT_TRUE(section.GetContents(&contents));
913 section.Append(kLittleEndian, 1, l);
915 ASSERT_TRUE(section.GetContents(&contents));
921 section.Append(kLittleEndian, 2, l);
923 ASSERT_TRUE(section.GetContents(&contents));
929 section.Append(kLittleEndian, 3, l);
931 ASSERT_TRUE(section.GetContents(&contents));
937 section.Append(kLittleEndian, 4, l);
939 ASSERT_TRUE(section.GetContents(&contents));
945 section.Append(kLittleEndian, 5, l);
947 ASSERT_TRUE(section.GetContents(&contents));
953 section.Append(kLittleEndian, 6, l);
955 ASSERT_TRUE(section.GetContents(&contents));
961 section.Append(kLittleEndian, 7, l);
963 ASSERT_TRUE(section.GetContents(&contents));
969 section.Append(kLittleEndian, 8, l);
971 ASSERT_TRUE(section.GetContents(&contents));
977 section.Append(kBigEndian, 1, l);
979 ASSERT_TRUE(section.GetContents(&contents));
985 section.Append(kBigEndian, 2, l);
987 ASSERT_TRUE(section.GetContents(&contents));
993 section.Append(kBigEndian, 3, l);
995 ASSERT_TRUE(section.GetContents(&contents));
1001 section.Append(kBigEndian, 4, l);
1003 ASSERT_TRUE(section.GetContents(&contents));
1009 section.Append(kBigEndian, 5, l);
1011 ASSERT_TRUE(section.GetContents(&contents));
1017 section.Append(kBigEndian, 6, l);
1019 ASSERT_TRUE(section.GetContents(&contents));
1025 section.Append(kBigEndian, 7, l);
1027 ASSERT_TRUE(section.GetContents(&contents));
1033 section.Append(kBigEndian, 8, l);
1035 ASSERT_TRUE(section.GetContents(&contents));
1040 section.Append(1, 0x2a);
1041 section.B8(0xd3U);
1042 ASSERT_TRUE(section.GetContents(&contents));
1048 section.Append(1, 0x2a);
1049 section.B8(l);
1051 ASSERT_TRUE(section.GetContents(&contents));
1056 section.Append(1, 0x2a);
1057 section.B16(0x472aU);
1058 ASSERT_TRUE(section.GetContents(&contents));
1064 section.Append(1, 0x2a);
1065 section.B16(l);
1067 ASSERT_TRUE(section.GetContents(&contents));
1072 section.Append(1, 0x2a);
1073 section.B32(0xbd412cbcU);
1074 ASSERT_TRUE(section.GetContents(&contents));
1080 section.Append(1, 0x2a);
1081 section.B32(l);
1083 ASSERT_TRUE(section.GetContents(&contents));
1088 section.Append(1, 0x2a);
1089 section.B64(0x3402a013111e68adULL);
1090 ASSERT_TRUE(section.GetContents(&contents));
1097 section.Append(1, 0x2a);
1098 section.B64(l);
1100 ASSERT_TRUE(section.GetContents(&contents));
1106 section.Append(1, 0x2a);
1107 section.L8(0x26U);
1108 ASSERT_TRUE(section.GetContents(&contents));
1114 section.Append(1, 0x2a);
1115 section.L8(l);
1117 ASSERT_TRUE(section.GetContents(&contents));
1122 section.Append(1, 0x2a);
1123 section.L16(0xca6dU);
1124 ASSERT_TRUE(section.GetContents(&contents));
1130 section.Append(1, 0x2a);
1131 section.L16(l);
1133 ASSERT_TRUE(section.GetContents(&contents));
1138 section.Append(1, 0x2a);
1139 section.L32(0x558f6181U);
1140 ASSERT_TRUE(section.GetContents(&contents));
1146 section.Append(1, 0x2a);
1147 section.L32(l);
1149 ASSERT_TRUE(section.GetContents(&contents));
1154 section.Append(1, 0x2a);
1155 section.L64(0x564384f7579515bfULL);
1156 ASSERT_TRUE(section.GetContents(&contents));
1163 section.Append(1, 0x2a);
1164 section.L64(l);
1166 ASSERT_TRUE(section.GetContents(&contents));
1172 section.set_endianness(kBigEndian);
1173 section.Append(1, 0x2a);
1174 section.D8(0xe6U);
1175 ASSERT_TRUE(section.GetContents(&contents));
1181 section.set_endianness(kBigEndian);
1182 section.Append(1, 0x2a);
1183 section.D8(l);
1185 ASSERT_TRUE(section.GetContents(&contents));
1190 section.set_endianness(kBigEndian);
1191 section.Append(1, 0x2a);
1192 section.D16(0x83b1U);
1193 ASSERT_TRUE(section.GetContents(&contents));
1199 section.set_endianness(kBigEndian);
1200 section.Append(1, 0x2a);
1201 section.D16(l);
1203 ASSERT_TRUE(section.GetContents(&contents));
1208 section.set_endianness(kBigEndian);
1209 section.Append(1, 0x2a);
1210 section.D32(0xd0b0e431U);
1211 section.GetContents(&contents));
1217 section.set_endianness(kBigEndian);
1218 section.Append(1, 0x2a);
1219 section.D32(l);
1221 ASSERT_TRUE(section.GetContents(&contents));
1226 section.set_endianness(kBigEndian);
1227 section.Append(1, 0x2a);
1228 section.D64(0xb109843500dbcb16ULL);
1229 ASSERT_TRUE(section.GetContents(&contents));
1236 section.set_endianness(kBigEndian);
1237 section.Append(1, 0x2a);
1238 section.D64(l);
1240 ASSERT_TRUE(section.GetContents(&contents));
1246 section.set_endianness(kLittleEndian);
1247 section.Append(1, 0x2a);
1248 section.D8(0x42U);
1249 ASSERT_TRUE(section.GetContents(&contents));
1255 section.set_endianness(kLittleEndian);
1256 section.Append(1, 0x2a);
1257 section.D8(l);
1259 ASSERT_TRUE(section.GetContents(&contents));
1264 section.set_endianness(kLittleEndian);
1265 section.Append(1, 0x2a);
1266 section.D16(0xc5c5U);
1267 ASSERT_TRUE(section.GetContents(&contents));
1273 section.set_endianness(kLittleEndian);
1274 section.Append(1, 0x2a);
1275 section.D16(l);
1277 ASSERT_TRUE(section.GetContents(&contents));
1282 section.set_endianness(kLittleEndian);
1283 section.Append(1, 0x2a);
1284 section.D32(0x1a87d0feU);
1285 ASSERT_TRUE(section.GetContents(&contents));
1291 section.set_endianness(kLittleEndian);
1292 section.Append(1, 0x2a);
1293 section.D32(l);
1295 ASSERT_TRUE(section.GetContents(&contents));
1300 section.set_endianness(kLittleEndian);
1301 section.Append(1, 0x2a);
1302 section.D64(0x42de75c61375a1deULL);
1303 ASSERT_TRUE(section.GetContents(&contents));
1310 section.set_endianness(kLittleEndian);
1311 section.Append(1, 0x2a);
1312 section.D64(l);
1314 ASSERT_TRUE(section.GetContents(&contents));
1321 section.Append(kBigEndian, 1, a)
1361 ASSERT_EQ(8 * 18U, section.Size());
1362 ASSERT_TRUE(section.GetContents(&contents));
1386 TEST_F(Append, Section) {
1387 section.Append("murder");
1389 Section middle;
1391 section.Append(middle);
1393 section.Append(" wrote");
1394 EXPECT_EQ(16U, section.Size());
1395 EXPECT_TRUE(section.GetContents(&contents));
1400 section.Append("sugar ");
1403 Section middle;
1406 section.Append(middle);
1409 section.Append(" jazz");
1410 EXPECT_EQ(15U, section.Size());
1411 EXPECT_TRUE(section.GetContents(&contents));
1416 section.LEB128(0);
1417 EXPECT_TRUE(section.GetContents(&contents));
1422 section.LEB128(0x3f);
1423 EXPECT_TRUE(section.GetContents(&contents));
1428 section.LEB128(0x40);
1429 EXPECT_TRUE(section.GetContents(&contents));
1434 section.LEB128(0x7f);
1435 EXPECT_TRUE(section.GetContents(&contents));
1440 section.LEB128(0x80);
1441 EXPECT_TRUE(section.GetContents(&contents));
1446 section.LEB128(0xff);
1447 EXPECT_TRUE(section.GetContents(&contents));
1452 section.LEB128(0x1fff);
1453 EXPECT_TRUE(section.GetContents(&contents));
1458 section.LEB128(0x2000);
1459 EXPECT_TRUE(section.GetContents(&contents));
1464 section.LEB128(-1);
1465 EXPECT_TRUE(section.GetContents(&contents));
1470 section.LEB128(-0x40);
1471 EXPECT_TRUE(section.GetContents(&contents));
1476 section.LEB128(-0x41);
1477 EXPECT_TRUE(section.GetContents(&contents));
1482 section.LEB128(-0x7f);
1483 EXPECT_TRUE(section.GetContents(&contents));
1488 section.LEB128(-0x80);
1489 EXPECT_TRUE(section.GetContents(&contents));
1494 section.LEB128(-0x2000);
1495 EXPECT_TRUE(section.GetContents(&contents));
1500 section.LEB128(-0x2001);
1501 EXPECT_TRUE(section.GetContents(&contents));
1506 section.ULEB128(0);
1507 EXPECT_TRUE(section.GetContents(&contents));
1512 section.ULEB128(1);
1513 EXPECT_TRUE(section.GetContents(&contents));
1518 section.ULEB128(0x3f);
1519 EXPECT_TRUE(section.GetContents(&contents));
1524 section.ULEB128(0x40);
1525 EXPECT_TRUE(section.GetContents(&contents));
1530 section.ULEB128(0x7f);
1531 EXPECT_TRUE(section.GetContents(&contents));
1536 section.ULEB128(0x80);
1537 EXPECT_TRUE(section.GetContents(&contents));
1542 section.ULEB128(0xff);
1543 EXPECT_TRUE(section.GetContents(&contents));
1548 section.ULEB128(0x100);
1549 EXPECT_TRUE(section.GetContents(&contents));
1554 section.ULEB128(0x1fff);
1555 EXPECT_TRUE(section.GetContents(&contents));
1560 section.ULEB128(0x2000);
1561 EXPECT_TRUE(section.GetContents(&contents));
1566 section.ULEB128(0x3fff);
1567 EXPECT_TRUE(section.GetContents(&contents));
1572 section.ULEB128(0x4000);
1573 EXPECT_TRUE(section.GetContents(&contents));
1578 section.ULEB128(12857);
1579 EXPECT_TRUE(section.GetContents(&contents));
1584 section.LEB128(-0x80).ULEB128(12857).Append("*");
1585 EXPECT_TRUE(section.GetContents(&contents));
1594 section.Append(kLittleEndian, 8, l);
1595 ASSERT_FALSE(section.GetContents(&contents));
1599 section.Append((size_t) 10, '*');
1600 EXPECT_EQ(10U, section.Size());
1601 EXPECT_TRUE(section.GetContents(&contents));
1602 EXPECT_EQ(0U, section.Size());
1607 section.Append(kBigEndian, 1, l);
1609 ASSERT_TRUE(section.GetContents(&contents));
1611 ASSERT_TRUE(section.GetContents(&contents)); // should not die
1617 section.Append("howdy");
1619 section.L32(l);
1620 EXPECT_EQ(9U, section.Size());
1621 section.Clear();
1622 EXPECT_EQ(0U, section.Size());
1624 ASSERT_TRUE(section.GetContents(&contents)); // should not die
1628 section.Append("*");
1629 EXPECT_EQ(1U, section.Size());
1630 section.Align(4).Append("*");
1631 EXPECT_EQ(5U, section.Size());
1632 section.Append("*").Align(2);
1633 EXPECT_EQ(6U, section.Size());
1637 section.Append("*");
1638 EXPECT_EQ(1U, section.Size());
1639 section.Align(4, ' ').Append("*");
1640 EXPECT_EQ(5U, section.Size());
1641 section.Append("*").Align(2, ' ');
1642 EXPECT_EQ(6U, section.Size());
1643 ASSERT_TRUE(section.GetContents(&contents));
1649 section.Append(42, ' ').Mark(&m).Append(13, '+');
1650 EXPECT_EQ(42U, m - section.start());
1651 EXPECT_EQ(42U + 13U, section.Here() - section.start());
1652 EXPECT_FALSE(section.start().IsKnownConstant());
1654 EXPECT_FALSE(section.Here().IsKnownConstant());
1658 section.set_endianness(kBigEndian);
1659 EXPECT_EQ(kBigEndian, section.endianness());
1660 section.set_endianness(kLittleEndian);
1661 EXPECT_EQ(kLittleEndian, section.endianness());