VirtualBox

Changeset 49054 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Oct 11, 2013 2:31:27 PM (11 years ago)
Author:
vboxsync
Message:

Resolve the uuid mapping link, in case the caller doesn't know the filename.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/dbg/dbgcfg.cpp

    r49053 r49054  
    795795    }
    796796
    797     size_t cchPath = strlen(pszPath);
    798 
    799797    /*
    800798     * If we got a UUID mapping option, try it first as we can hopefully
     
    807805            && RTFileExists(pszPath))
    808806        {
     807            /* Try resolve the path before presenting it to the client, a
     808               12 digit filename is of little worth. */
     809            char szBackup[RTPATH_MAX];
     810            strcpy(szBackup, pszPath);
     811            rc = RTPathAbs(szBackup, pszPath, RTPATH_MAX);
     812            if (RT_FAILURE(rc))
     813                strcpy(pszPath, szBackup);
     814
     815            /* Do the callback thing. */
    809816            rtDbgCfgLog1(pThis, "Trying '%s'...\n", pszPath);
    810817            int rc2 = pfnCallback(pThis, pszPath, pvUser1, pvUser2);
    811818            if (rc2 == VINF_CALLBACK_RETURN)
    812                 rtDbgCfgLog1(pThis, "Found '%s'.\n", pszPath);
     819                rtDbgCfgLog1(pThis, "Found '%s' via uuid mapping.\n", pszPath);
    813820            else if (rc2 == VERR_CALLBACK_RETURN)
    814821                rtDbgCfgLog1(pThis, "Error opening '%s'.\n", pszPath);
     
    817824            if (rc2 == VINF_CALLBACK_RETURN || rc2 == VERR_CALLBACK_RETURN)
    818825                return rc2;
     826
     827            /* Failed, restore the cache path. */
     828            memcpy(pszPath, szBackup, cchCachePath);
    819829        }
    820830        pszPath[cchCachePath] = '\0';
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