Changeset 80615 in vbox for trunk/src/VBox/Devices/VirtIO
- Timestamp:
- Sep 6, 2019 4:24:53 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/VirtIO/Virtio_1_0.cpp
r80596 r80615 1463 1463 1464 1464 /** 1465 * Do a hex dump of a buffer .1465 * Do a hex dump of a buffer 1466 1466 * 1467 1467 * @param pv Pointer to array to dump … … 1475 1475 if (pszTitle) 1476 1476 Log(("%s [%d bytes]:\n", pszTitle, cb)); 1477 for (uint32_t row = 0; row < RT_MAX(1, (cb / 16) + 1) ; row++)1477 for (uint32_t row = 0; row < RT_MAX(1, (cb / 16) + 1) && row * 16 < cb; row++) 1478 1478 { 1479 uint32_t uAddr = row * 16 + uBase; 1480 Log(("%x%x%x%x: ", (uAddr >> 12) & 0xf, (uAddr >> 8) & 0xf, (uAddr >> 4) & 0xf, uAddr & 0xf)); 1481 for (int col = 0; col < 16; col++) 1479 Log(("%04x: ", row * 16 + uBase)); /* line address */ 1480 for (uint8_t col = 0; col < 16; col++) 1482 1481 { 1483 1482 uint32_t idx = row * 16 + col; 1484 uint8_t u8 = pv[idx];1485 1483 if (idx >= cb) 1486 1484 Log(("-- %s", (col + 1) % 8 ? "" : " ")); 1487 1485 else 1488 Log(("% x%x %s", u8 >> 4 & 0xf, u8 & 0xf, (col + 1) % 8 ? "" : " "));1486 Log(("%02x %s", pv[idx], (col + 1) % 8 ? "" : " ")); 1489 1487 } 1490 for (int col = 0; col < 16; col++) 1491 { 1492 uint32_t idx = row * 16 + col; 1493 uint8_t u8 = pv[idx]; 1494 if (idx >= cb) 1495 Log((" ")); 1496 else 1497 Log(("%c", u8 >= 0x20 && u8 <= 0x7e ? u8 : '.')); 1498 } 1488 for (uint32_t idx = row * 16; idx < row * 16 + 16; idx++) 1489 Log(("%c", (idx >= cb) ? ' ' : (pv[idx] >= 0x20 && pv[idx] <= 0x7e ? pv[idx] : '.'))); 1499 1490 Log(("\n")); 1500 1491 }
Note:
See TracChangeset
for help on using the changeset viewer.