VirtualBox

Changeset 42335 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jul 23, 2012 8:45:03 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
79410
Message:

SSM.cpp: offUnitUser - debug aid.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/SSM.cpp

    r41965 r42335  
    465465    /** Number of compressed bytes left in the current data unit (V1). */
    466466    uint64_t                cbUnitLeftV1;
    467     /** The current uncompressed offset into the data unit. */
     467    /** The current compressed? offset into the data unit. */
    468468    uint64_t                offUnit;
     469    /** The current user data offset into the unit (debug purposes). */
     470    uint64_t                offUnitUser;
    469471    /** Indicates that this is a live save or restore operation. */
    470472    bool                    fLiveSave;
     
    30683070    if (RT_SUCCESS(rc))
    30693071    {
    3070         pSSM->offUnit = UINT64_MAX;
     3072        pSSM->offUnit     = UINT64_MAX;
     3073        pSSM->offUnitUser = UINT64_MAX;
    30713074        return VINF_SUCCESS;
    30723075    }
     
    30883091static void ssmR3DataWriteBegin(PSSMHANDLE pSSM)
    30893092{
    3090     pSSM->offUnit = 0;
     3093    pSSM->offUnit     = 0;
     3094    pSSM->offUnitUser = 0;
    30913095}
    30923096
     
    32393243    if (RT_SUCCESS(rc))
    32403244    {
     3245        pSSM->offUnitUser += cbBuf;
     3246
    32413247        /*
    32423248         * Split it up into compression blocks.
     
    33473353        memcpy(&pSSM->u.Write.abDataBuffer[0], pvBuf, cbBuf);
    33483354        pSSM->u.Write.offDataBuffer = (uint32_t)cbBuf;
     3355        pSSM->offUnitUser += cbBuf;
    33493356    }
    33503357    return rc;
     
    33763383    memcpy(&pSSM->u.Write.abDataBuffer[off], pvBuf, cbBuf);
    33773384    pSSM->u.Write.offDataBuffer = off + (uint32_t)cbBuf;
     3385    pSSM->offUnitUser += cbBuf;
    33783386    return VINF_SUCCESS;
    33793387}
     
    48684876    pSSM->cbUnitLeftV1              = 0;
    48694877    pSSM->offUnit                   = UINT64_MAX;
     4878    pSSM->offUnitUser               = UINT64_MAX;
    48704879    pSSM->fLiveSave                 = false;
    48714880    pSSM->pfnProgress               = pfnProgress;
     
    55995608    {
    56005609        Log2(("ssmR3DataRead: pvBuf=%p cbBuf=%#x offUnit=%#llx %.*Rhxs%s\n", pvBuf, cbBuf, pSSM->offUnit, RT_MIN(cbBuf, SSM_LOG_BYTES), pvBuf, cbBuf > SSM_LOG_BYTES ? "..." : ""));
    5601         pSSM->offUnit += cbBuf;
     5610        pSSM->offUnit     += cbBuf;
     5611        pSSM->offUnitUser += cbBuf;
    56025612        return VINF_SUCCESS;
    56035613    }
     
    56195629    Assert(!pSSM->u.Read.cbRecLeft);
    56205630
    5621     pSSM->offUnit = 0;
     5631    pSSM->offUnit     = 0;
     5632    pSSM->offUnitUser = 0;
    56225633    pSSM->u.Read.cbRecLeft      = 0;
    56235634    pSSM->u.Read.cbDataBuffer   = 0;
     
    56485659        if (   pSSM->u.Read.cbDataBuffer != pSSM->u.Read.offDataBuffer
    56495660            && pSSM->u.Read.cbDataBuffer > 0)
     5661        {
     5662            LogRel(("SSM: At least %#x bytes left to read\n", pSSM->u.Read.cbDataBuffer - pSSM->u.Read.offDataBuffer));
    56505663            rc = VERR_SSM_LOADED_TOO_LITTLE;
     5664        }
    56515665        else
    56525666        {
     
    56555669                &&  !pSSM->u.Read.fEndOfData)
    56565670            {
     5671                LogRel(("SSM: At least %#x bytes left to read\n", pSSM->u.Read.cbDataBuffer));
    56575672                rc = VERR_SSM_LOADED_TOO_LITTLE;
    56585673                AssertFailed();
     
    56675682
    56685683/**
    5669  * Read reader that keep works the progress indicator and unit offset.
     5684 * Read raw record bytes, work the progress indicator and unit offset.
    56705685 *
    56715686 * @returns VBox status code. Does NOT set pSSM->rc.
     
    60786093        }
    60796094
     6095        pSSM->offUnitUser += cbToRead;
    60806096        cbBuf -= cbToRead;
    60816097        pvBuf = (uint8_t *)pvBuf + cbToRead;
     
    61156131        pvBuf  = (uint8_t *)pvBuf + cbToCopy;
    61166132        cbBuf -= cbToCopy;
     6133        pSSM->offUnitUser += cbToCopy;
    61176134        pSSM->u.Read.cbDataBuffer  = 0;
    61186135        pSSM->u.Read.offDataBuffer = 0;
     
    61876204        cbBuf -= cbToCopy;
    61886205        pvBuf = (uint8_t *)pvBuf + cbToCopy;
     6206        pSSM->offUnitUser       += cbToCopy;
    61896207        pSSM->u.Read.offDataBuffer = cbToCopy;
    61906208    } while (cbBuf > 0);
     
    62286246    memcpy(pvBuf, &pSSM->u.Read.abDataBuffer[off], cbBuf);
    62296247    pSSM->u.Read.offDataBuffer = off + (uint32_t)cbBuf;
     6248    pSSM->offUnitUser += cbBuf;
    62306249    Log4((cbBuf
    62316250          ? "ssmR3DataRead: %08llx|%08llx/%08x/%08x: cbBuf=%#x %.*Rhxs%s\n"
     
    76807699    pSSM->cbUnitLeftV1          = 0;
    76817700    pSSM->offUnit               = UINT64_MAX;
     7701    pSSM->offUnitUser           = UINT64_MAX;
    76827702    pSSM->fLiveSave             = false;
    76837703    pSSM->pfnProgress           = NULL;
     
    78787898                         */
    78797899                        pSSM->cbUnitLeftV1 = UnitHdr.cbUnit - RT_OFFSETOF(SSMFILEUNITHDRV1, szName[UnitHdr.cchName]);
    7880                         pSSM->offUnit = 0;
     7900                        pSSM->offUnit      = 0;
     7901                        pSSM->offUnitUser  = 0;
    78817902                        pSSM->u.Read.uCurUnitVer  = UnitHdr.u32Version;
    78827903                        pSSM->u.Read.uCurUnitPass = SSM_PASS_FINAL;
     
    79407961                            }
    79417962
    7942                             pSSM->offUnit = UINT64_MAX;
     7963                            pSSM->offUnit     = UINT64_MAX;
     7964                            pSSM->offUnitUser = UINT64_MAX;
    79437965                        }
    79447966                        else
     
    81738195            rc = ssmR3DataReadFinishV2(pSSM);
    81748196            if (RT_SUCCESS(rc))
    8175                 pSSM->offUnit = UINT64_MAX;
     8197            {
     8198                pSSM->offUnit     = UINT64_MAX;
     8199                pSSM->offUnitUser = UINT64_MAX;
     8200            }
    81768201            else
    81778202            {
     
    87088733                    rc = ssmR3StrmSeek(&pSSM->Strm, off + RT_OFFSETOF(SSMFILEUNITHDRV1, szName) + cbUnitNm, RTFILE_SEEK_BEGIN, 0);
    87098734                    pSSM->cbUnitLeftV1 = UnitHdr.cbUnit - RT_OFFSETOF(SSMFILEUNITHDRV1, szName[cbUnitNm]);
    8710                     pSSM->offUnit = 0;
     8735                    pSSM->offUnit      = 0;
     8736                    pSSM->offUnitUser  = 0;
    87118737                    if (piVersion)
    87128738                        *piVersion = UnitHdr.u32Version;
     
    88918917    pSSM->cbUnitLeftV1  = 0;
    88928918    pSSM->offUnit       = UINT64_MAX;
     8919    pSSM->offUnitUser   = UINT64_MAX;
    88938920
    88948921    /*
Note: See TracChangeset for help on using the changeset viewer.

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