VirtualBox

Ignore:
Timestamp:
May 19, 2013 7:07:50 PM (12 years ago)
Author:
vboxsync
Message:

Made dSYM-bundle loading work as well as line numbers in the stack traces (when possible).

Location:
trunk/src/VBox/Runtime/common/dbg
Files:
3 edited

Legend:

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

    r46134 r46165  
    16961696
    16971697
    1698 /**
    1699  * Query a line number by address.
    1700  *
    1701  * @returns IPRT status code. See RTDbgModSymbolAddrA for more specific ones.
    1702  * @retval  VERR_INVALID_HANDLE if hDbgAs is invalid.
    1703  * @retval  VERR_NOT_FOUND if the address couldn't be mapped to a module.
    1704  *
    1705  * @param   hDbgAs          The address space handle.
    1706  * @param   Addr            The address which closest symbol is requested.
    1707  * @param   poffDisp        Where to return the distance between the line
    1708  *                          number and address.
    1709  * @param   pLine           Where to return the line number information.
    1710  */
    1711 RTDECL(int) RTDbgAsLineByAddr(RTDBGAS hDbgAs, RTUINTPTR Addr, PRTINTPTR poffDisp, PRTDBGLINE pLine)
     1698RTDECL(int) RTDbgAsLineByAddr(RTDBGAS hDbgAs, RTUINTPTR Addr, PRTINTPTR poffDisp, PRTDBGLINE pLine, PRTDBGMOD phMod)
    17121699{
    17131700    /*
     
    17291716    int rc = RTDbgModLineByAddr(hMod, iSeg, offSeg, poffDisp, pLine);
    17301717    if (RT_SUCCESS(rc))
     1718    {
    17311719        rtDbgAsAdjustLineAddress(pLine, hMod, MapAddr, iSeg);
    1732     RTDbgModRelease(hMod);
     1720        if (phMod)
     1721            *phMod = hMod;
     1722        else
     1723            RTDbgModRelease(hMod);
     1724    }
     1725    else
     1726        RTDbgModRelease(hMod);
    17331727    return rc;
    17341728}
     
    17361730
    17371731
    1738 /**
    1739  * Query a line number by address.
    1740  *
    1741  * @returns IPRT status code. See RTDbgModSymbolAddrA for more specific ones.
    1742  * @retval  VERR_INVALID_HANDLE if hDbgAs is invalid.
    1743  * @retval  VERR_NOT_FOUND if the address couldn't be mapped to a module.
    1744  *
    1745  * @param   hDbgAs          The address space handle.
    1746  * @param   Addr            The address which closest symbol is requested.
    1747  * @param   poffDisp        Where to return the distance between the line
    1748  *                          number and address.
    1749  * @param   ppLine          Where to return the pointer to the allocated line
    1750  *                          number info. Always set. Free with RTDbgLineFree.
    1751  */
    1752 RTDECL(int) RTDbgAsLineByAddrA(RTDBGAS hDbgAs, RTUINTPTR Addr, PRTINTPTR poffDisp, PRTDBGLINE *ppLine)
     1732RTDECL(int) RTDbgAsLineByAddrA(RTDBGAS hDbgAs, RTUINTPTR Addr, PRTINTPTR poffDisp, PRTDBGLINE *ppLine, PRTDBGMOD phMod)
    17531733{
    17541734    /*
     
    17701750    int rc = RTDbgModLineByAddrA(hMod, iSeg, offSeg, poffDisp, ppLine);
    17711751    if (RT_SUCCESS(rc))
     1752    {
    17721753        rtDbgAsAdjustLineAddress(*ppLine, hMod, MapAddr, iSeg);
    1773     RTDbgModRelease(hMod);
     1754        if (phMod)
     1755            *phMod = hMod;
     1756        else
     1757            RTDbgModRelease(hMod);
     1758    }
     1759    else
     1760        RTDbgModRelease(hMod);
    17741761    return rc;
    17751762}
  • trunk/src/VBox/Runtime/common/dbg/dbgmod.cpp

    r46164 r46165  
    486486                return VINF_SUCCESS;
    487487            }
    488             pDbgMod->pDbgVt    = NULL;
     488
     489            pDbgMod->pDbgVt = NULL;
    489490            Assert(pDbgMod->pvDbgPriv == NULL);
    490491        }
     
    530531                return VINF_CALLBACK_RETURN;
    531532            }
    532             pDbgMod->pDbgVt    = NULL;
     533
     534            pDbgMod->pDbgVt = NULL;
    533535            Assert(pDbgMod->pvDbgPriv == NULL);
    534536        }
     537        RTSemRWReleaseRead(g_hDbgModRWSem);
    535538    }
    536539
    537540    /* No joy. */
    538     RTSemRWReleaseRead(g_hDbgModRWSem);
    539541    RTStrCacheRelease(g_hDbgModStrCache, pDbgMod->pszDbgFile);
    540542    pDbgMod->pszDbgFile = NULL;
     
    843845                            if (RT_SUCCESS(rc))
    844846                            {
     847                                /*
     848                                 * We're done!
     849                                 */
     850                                ASMAtomicIncU32(&pImg->cUsers);
     851                                RTSemRWReleaseRead(g_hDbgModRWSem);
     852
    845853                                *phDbgMod = pDbgMod;
    846854                                return VINF_SUCCESS;
  • trunk/src/VBox/Runtime/common/dbg/dbgmoddwarf.cpp

    r46164 r46165  
    36963696                                                       pSubProgram->PcRange.uHighAddress - pSubProgram->PcRange.uLowAddress,
    36973697                                                       0 /*fFlags*/, NULL /*piOrdinal*/);
    3698                                 AssertRC(rc);
     3698                                AssertMsg(RT_SUCCESS(rc) || rc == VERR_DBG_DUPLICATE_SYMBOL, ("%Rrc\n", rc));
    36993699                            }
    37003700                            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