VirtualBox

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


Ignore:
Timestamp:
Oct 15, 2013 1:46:24 PM (11 years ago)
Author:
vboxsync
Message:

kext plugins.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/tools/RTDbgSymCache.cpp

    r49080 r49118  
    143143
    144144
     145/*******************************************************************************
     146*   Internal Functions                                                         *
     147*******************************************************************************/
     148static int rtDbgSymCacheAddDirWorker(char *pszPath, size_t cchPath, PRTDIRENTRYEX pDirEntry, PCRTDBGSYMCACHEADDCFG pCfg);
     149
     150
    145151
    146152/**
     
    717723 * @param   cchPath             The length of the path up to the bundle name.
    718724 * @param   cchName             The length of the bundle name.
     725 * @param   pDirEntry           The directory entry buffer, for handling bundle
     726 *                              within bundle recursion.
    719727 * @param   pCfg                The configuration.
    720728 */
    721 static int rtDbgSymCacheAddImageBundle(char *pszPath, size_t cchPath, size_t cchName, PCRTDBGSYMCACHEADDCFG pCfg)
    722 {
    723     /* Assuming these are kexts or simple applications, we only add the image
    724        file itself to the cache. No Info.plist or other files. */
     729static int rtDbgSymCacheAddImageBundle(char *pszPath, size_t cchPath, size_t cchName,
     730                                       PRTDIRENTRYEX pDirEntry, PCRTDBGSYMCACHEADDCFG pCfg)
     731{
     732    /*
     733     * Assuming these are kexts or simple applications, we only add the image
     734     * file itself to the cache.  No Info.plist or other files.
     735     */
    725736    /** @todo consider looking for Frameworks and handling framework bundles. */
    726737    int rc = rtDbgSymCacheConstructBundlePath(pszPath, cchPath, cchName, "Contents/MacOS/", g_apszBundleSuffixes);
    727738    if (RT_SUCCESS(rc))
    728739        rc = rtDbgSymCacheAddImageFile(pszPath, NULL, RTDBG_CACHE_UUID_MAP_DIR_IMAGES, pCfg);
     740
     741    /*
     742     * Look for plugins and other sub-bundles.
     743     */
     744    if (pCfg->fRecursive)
     745    {
     746        static char const * const s_apszSubBundleDirs[] =
     747        {
     748            "Contents/Plugins",
     749            /** @todo Frameworks ++ */
     750        };
     751        for (uint32_t i = 0; i < RT_ELEMENTS(s_apszSubBundleDirs); i++)
     752        {
     753            pszPath[cchPath + cchName] = '\0';
     754            int rc2 = RTPathAppend(pszPath, RTPATH_MAX, s_apszSubBundleDirs[i]);
     755            if (RT_SUCCESS(rc2))
     756                rc2 = rtDbgSymCacheAddDirWorker(pszPath, strlen(pszPath), pDirEntry, pCfg);
     757            else
     758            {
     759                pszPath[cchPath + cchName] = '\0';
     760                RTMsgError("Error constructing bundle subdir path for '%s' + '%s': %Rrc", pszPath, s_apszSubBundleDirs[i], rc);
     761            }
     762            if (RT_FAILURE(rc2) && RT_SUCCESS(rc))
     763                rc = rc2;
     764        }
     765    }
     766
    729767    return rc;
    730768}
     
    9771015
    9781016            case RTDBGSYMCACHEFILETYPE_IMAGE_BUNDLE:
    979                 rc2 = rtDbgSymCacheAddImageBundle(pszPath, cchPath, pDirEntry->cbName, pCfg);
     1017                rc2 = rtDbgSymCacheAddImageBundle(pszPath, cchPath, pDirEntry->cbName, pDirEntry, pCfg);
    9801018                break;
    9811019
     
    10951133                    rc = rtDbgSymCacheAddDebugBundle(szPathBuf, cchPath - cchFilename, cchFilename, &Cfg);
    10961134                else
    1097                     rc = rtDbgSymCacheAddImageBundle(szPathBuf, cchPath - cchFilename, cchFilename, &Cfg);
     1135                {
     1136                    RTDIRENTRYEX DirEntry;
     1137                    rc = rtDbgSymCacheAddImageBundle(szPathBuf, cchPath - cchFilename, cchFilename, &DirEntry, &Cfg);
     1138                }
    10981139            }
    10991140            else
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