VirtualBox

Changeset 83174 in vbox


Ignore:
Timestamp:
Feb 27, 2020 5:09:14 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
136296
Message:

fix burns

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/VirtIO/Virtio_1_0.cpp

    r83165 r83174  
    425425}
    426426
     427/**
     428 * Do a hex dump of memory in guest physical context
     429 *
     430 * @param   gcPhys      pointer to buffer to dump contents of
     431 * @param   cb          count of characters to dump from buffer
     432 * @param   uBase       base address of per-row address prefixing of hex output
     433 * @param   pszTitle    Optional title. If present displays title that lists
     434 *                      provided text with value of cb to indicate size next to it.
     435 */
     436void virtioCoreGcPhysHexDump(PPDMDEVINS pDevIns, RTGCPHYS gcPhys, uint32_t cb, uint32_t uBase, const char *pszTitle)
     437{
     438    if (pszTitle)
     439        Log(("%s [%d bytes]:\n", pszTitle, cb));
     440    for (uint32_t row = 0; row < RT_MAX(1, (cb / 16) + 1) && row * 16 < cb; row++)
     441    {
     442        uint8_t c;
     443        Log(("%04x: ", row * 16 + uBase)); /* line address */
     444        for (uint8_t col = 0; col < 16; col++)
     445        {
     446           uint32_t idx = row * 16 + col;
     447           PDMDevHlpPCIPhysRead(pDevIns, gcPhys + idx, &c, 1);
     448           if (idx >= cb)
     449               Log(("-- %s", (col + 1) % 8 ? "" : "  "));
     450           else
     451               Log(("%02x %s", c, (col + 1) % 8 ? "" : "  "));
     452        }
     453        for (uint32_t idx = row * 16; idx < row * 16 + 16; idx++)
     454        {
     455           PDMDevHlpPCIPhysRead(pDevIns, gcPhys + idx, &c, 1);
     456           Log(("%c", (idx >= cb) ? ' ' : (c >= 0x20 && c <= 0x7e ? c : '.')));
     457        }
     458        Log(("\n"));
     459    }
     460    Log(("\n"));
     461    RT_NOREF(uBase);
     462}
    427463#endif /* LOG_ENABLED */
    428464
     
    876912     * is handled by client */
    877913
    878     size_t cbCopy = 0, cbTotal, cbRemain;
     914    size_t cbCopy = 0, cbTotal = 0, cbRemain = 0;
    879915
    880916    if (pSgVirtReturn)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette