VirtualBox

Changeset 46109 in vbox


Ignore:
Timestamp:
May 15, 2013 7:54:06 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
85797
Message:

Made deferred loading work.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/dbg.h

    r46101 r46109  
    10011001
    10021002/**
     1003 * Checks if the loading of the debug info has been postponed.
     1004 *
     1005 * @returns true if postponed, false if not or invalid handle.
     1006 * @param   hDbgMod         The module handle.
     1007 */
     1008RTDECL(bool)        RTDbgModIsDeferred(RTDBGMOD hDbgMod);
     1009
     1010/**
     1011 * Checks if the debug info is exports only.
     1012 *
     1013 * @returns true if exports only, false if not or invalid handle.
     1014 * @param   hDbgMod         The module handle.
     1015 */
     1016RTDECL(bool)        RTDbgModIsExports(RTDBGMOD hDbgMod);
     1017
     1018/**
    10031019 * Converts an image relative address to a segment:offset address.
    10041020 *
  • trunk/include/iprt/mangling.h

    r46105 r46109  
    394394# define RTDbgModGetTag                                 RT_MANGLER(RTDbgModGetTag)
    395395# define RTDbgModImageSize                              RT_MANGLER(RTDbgModImageSize)
     396# define RTDbgModIsDeferred                             RT_MANGLER(RTDbgModIsDeferred)
     397# define RTDbgModIsExports                              RT_MANGLER(RTDbgModIsExports)
    396398# define RTDbgModLineAdd                                RT_MANGLER(RTDbgModLineAdd)
    397399# define RTDbgModLineByAddr                             RT_MANGLER(RTDbgModLineByAddr)
  • trunk/src/VBox/Debugger/DBGCEmulateCodeView.cpp

    r46101 r46109  
    39083908        if (hMod != NIL_RTDBGMOD)
    39093909        {
    3910             uint32_t const      cSegs            = RTDbgModSegmentCount(hMod);
    3911             const char * const  pszName          = RTDbgModName(hMod);
    3912             const char * const  pszImgFile       = RTDbgModImageFile(hMod);
    3913             const char * const  pszImgFileUsed   = RTDbgModImageFileUsed(hMod);
    3914             const char * const  pszDbgFile       = RTDbgModDebugFile(hMod);
     3910            bool const          fDeferred       = RTDbgModIsDeferred(hMod);
     3911            bool const          fExports        = RTDbgModIsExports(hMod);
     3912            uint32_t const      cSegs           = fDeferred ? 1 : RTDbgModSegmentCount(hMod);
     3913            const char * const  pszName         = RTDbgModName(hMod);
     3914            const char * const  pszImgFile      = RTDbgModImageFile(hMod);
     3915            const char * const  pszImgFileUsed  = RTDbgModImageFileUsed(hMod);
     3916            const char * const  pszDbgFile      = RTDbgModDebugFile(hMod);
    39153917            if (    cArgs == 0
    39163918                ||  dbgcCmdListModuleMatch(pszName, paArgs, cArgs))
     
    39333935                            uMin = aMappings[iMap].Address;
    39343936                    if (!fVerbose || !pszImgFile)
    3935                         DBGCCmdHlpPrintf(pCmdHlp, "%RGv %04x %s\n", (RTGCUINTPTR)uMin, cSegs, pszName);
     3937                        DBGCCmdHlpPrintf(pCmdHlp, "%RGv %04x %s%s\n", (RTGCUINTPTR)uMin, cSegs, pszName,
     3938                                         fExports ? " (exports)" : fDeferred ? " (deferred)" : "");
    39363939                    else
    3937                         DBGCCmdHlpPrintf(pCmdHlp, "%RGv %04x %-12s  %s\n", (RTGCUINTPTR)uMin, cSegs, pszName, pszImgFile);
     3940                        DBGCCmdHlpPrintf(pCmdHlp, "%RGv %04x %-12s  %s%s\n", (RTGCUINTPTR)uMin, cSegs, pszName, pszImgFile,
     3941                                         fExports ? "  (exports)" : fDeferred ? "  (deferred)" : "");
    39383942                    if (fVerbose && pszImgFileUsed)
    39393943                        DBGCCmdHlpPrintf(pCmdHlp, "    Local image: %s\n", pszImgFileUsed);
  • trunk/src/VBox/Runtime/common/dbg/dbgmod.cpp

    r46108 r46109  
    11451145
    11461146
     1147RTDECL(bool) RTDbgModIsDeferred(RTDBGMOD hDbgMod)
     1148{
     1149    PRTDBGMODINT pDbgMod = hDbgMod;
     1150    RTDBGMOD_VALID_RETURN_RC(pDbgMod, false);
     1151    return pDbgMod->fDeferred;
     1152}
     1153
     1154
     1155RTDECL(bool) RTDbgModIsExports(RTDBGMOD hDbgMod)
     1156{
     1157    PRTDBGMODINT pDbgMod = hDbgMod;
     1158    RTDBGMOD_VALID_RETURN_RC(pDbgMod, false);
     1159    return pDbgMod->fExports;
     1160}
     1161
     1162
    11471163RTDECL(RTDBGSEGIDX) RTDbgModRvaToSegOff(RTDBGMOD hDbgMod, RTUINTPTR uRva, PRTUINTPTR poffSeg)
    11481164{
  • trunk/src/VBox/Runtime/common/dbg/dbgmoddeferred.cpp

    r45997 r46109  
    108108
    109109            rtDbgModDeferredReleaseInstanceData(pThis);
     110            if (fImgVt && fDbgVt)
     111                rtDbgModDeferredReleaseInstanceData(pThis);
    110112        }
    111113        else
     
    116118            if (fDbgVt)
    117119            {
     120                Assert(!pMod->pDbgVt);
     121                pMod->pDbgVt    = &g_rtDbgModVtDbgDeferred;
    118122                pMod->pvDbgPriv = pThis;
    119                 pMod->pDbgVt    = &g_rtDbgModVtDbgDeferred;
    120123            }
    121124
    122125            if (fImgVt)
    123126            {
     127                Assert(!pMod->pImgVt);
     128                pMod->pImgVt    = &g_rtDbgModVtImgDeferred;
    124129                pMod->pvImgPriv = pThis;
    125                 pMod->pImgVt    = &g_rtDbgModVtImgDeferred;
    126130            }
    127131        }
     
    544548{
    545549    AssertReturn(!pDbgMod->pDbgVt, VERR_DBG_MOD_IPE);
    546     AssertReturn(!pDbgMod->pImgVt, VERR_DBG_MOD_IPE);
    547550
    548551    PRTDBGMODDEFERRED pDeferred = (PRTDBGMODDEFERRED)RTMemAllocZ(sizeof(*pDeferred));
     
    551554
    552555    pDeferred->cbImage     = cbImage;
    553     pDeferred->cRefs       = 2;
     556    pDeferred->cRefs       = 1 + (pDbgMod->pImgVt == NULL);
    554557    if (hDbgCfg != NIL_RTDBGCFG)
    555558        RTDbgCfgRetain(hDbgCfg);
     
    557560    pDeferred->pfnDeferred = pfnDeferred;
    558561
    559     pDbgMod->pImgVt              = &g_rtDbgModVtImgDeferred;
    560     pDbgMod->pvImgPriv           = pDeferred;
    561     pDbgMod->pDbgVt              = &g_rtDbgModVtDbgDeferred;
    562     pDbgMod->pvDbgPriv           = pDeferred;
    563     pDbgMod->fDeferred           = true;
    564     pDbgMod->fDeferredFailed     = false;
     562    pDbgMod->pDbgVt             = &g_rtDbgModVtDbgDeferred;
     563    pDbgMod->pvDbgPriv          = pDeferred;
     564    if (!pDbgMod->pImgVt)
     565    {
     566        pDbgMod->pImgVt         = &g_rtDbgModVtImgDeferred;
     567        pDbgMod->pvImgPriv      = pDeferred;
     568    }
     569    pDbgMod->fDeferred          = true;
     570    pDbgMod->fDeferredFailed    = false;
    565571
    566572    if (ppDeferred)
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