VirtualBox

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


Ignore:
Timestamp:
Jul 25, 2018 6:50:19 PM (6 years ago)
Author:
vboxsync
Message:

IPRT/RTDbg: Added RTDBGSYMADDR_FLAGS_SKIP_ABS and RTDBGSYMADDR_FLAGS_SKIP_ABS_IN_DEFERRED to symbol lookup code. Made RTDbgModSymbolByAddr use segment number and names to return something if an address is within the module.

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

Legend:

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

    r73097 r73359  
    13721372         * Check for absolute symbols.  Requires iterating all modules.
    13731373         */
     1374        if (fFlags & RTDBGSYMADDR_FLAGS_SKIP_ABS)
     1375            return VERR_NOT_FOUND;
     1376
    13741377        uint32_t cModules;
    13751378        PRTDBGMOD pahModules = rtDbgAsSnapshotModuleTable(pDbgAs, &cModules);
  • trunk/src/VBox/Runtime/common/dbg/dbgmod.cpp

    r73150 r73359  
    18581858
    18591859
     1860/**
     1861 * Return a segment number/name as symbol if we couldn't find any
     1862 * valid symbols within the segment.
     1863 *
     1864 * @returns
     1865 * @param   pDbgMod             .
     1866 * @param   iSeg                .
     1867 * @param   off                 .
     1868 * @param   poffDisp            .
     1869 * @param   pSymInfo            .
     1870 */
     1871DECL_NO_INLINE(static, int)
     1872rtDbgModSymbolByAddrTrySegments(PRTDBGMODINT pDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR off,
     1873                                PRTINTPTR poffDisp, PRTDBGSYMBOL pSymInfo)
     1874{
     1875    Assert(iSeg <= RTDBGSEGIDX_LAST);
     1876    RTDBGSEGMENT SegInfo;
     1877    int rc = pDbgMod->pDbgVt->pfnSegmentByIndex(pDbgMod, iSeg, &SegInfo);
     1878    if (RT_SUCCESS(rc))
     1879    {
     1880        pSymInfo->Value  = 0;
     1881        pSymInfo->cb     = SegInfo.cb;
     1882        pSymInfo->offSeg = 0;
     1883        pSymInfo->iSeg   = iSeg;
     1884        pSymInfo->fFlags = 0;
     1885        if (SegInfo.szName[0])
     1886            RTStrPrintf(pSymInfo->szName, sizeof(pSymInfo->szName), "start_seg%u_%s", SegInfo.iSeg, SegInfo.szName);
     1887        else
     1888            RTStrPrintf(pSymInfo->szName, sizeof(pSymInfo->szName), "start_seg%u", SegInfo.iSeg);
     1889        if (poffDisp)
     1890            *poffDisp = off;
     1891        return VINF_SUCCESS;
     1892    }
     1893    return VERR_SYMBOL_NOT_FOUND;
     1894}
     1895
     1896
    18601897RTDECL(int) RTDbgModSymbolByAddr(RTDBGMOD hDbgMod, RTDBGSEGIDX iSeg, RTUINTPTR off, uint32_t fFlags,
    18611898                                 PRTINTPTR poffDisp, PRTDBGSYMBOL pSymInfo)
     
    18891926     */
    18901927    int rc = pDbgMod->pDbgVt->pfnSymbolByAddr(pDbgMod, iSeg, off, fFlags, poffDisp, pSymInfo);
     1928
     1929    /* If we failed to locate a symbol, try use the specified segment as a reference. */
     1930    if (   rc == VERR_SYMBOL_NOT_FOUND
     1931        && iSeg <= RTDBGSEGIDX_LAST
     1932        && !(fFlags & RTDBGSYMADDR_FLAGS_GREATER_OR_EQUAL))
     1933        rc = rtDbgModSymbolByAddrTrySegments(pDbgMod, iSeg, off, poffDisp, pSymInfo);
    18911934
    18921935    RTDBGMOD_UNLOCK(pDbgMod);
  • trunk/src/VBox/Runtime/common/dbg/dbgmoddeferred.cpp

    r69111 r73359  
    236236                                                          PRTINTPTR poffDisp, PRTDBGSYMBOL pSymInfo)
    237237{
     238    if (   (fFlags & RTDBGSYMADDR_FLAGS_SKIP_ABS_IN_DEFERRED)
     239        && iSeg == RTDBGSEGIDX_ABS)
     240        return VERR_SYMBOL_NOT_FOUND;
     241
    238242    int rc = rtDbgModDeferredDoIt(pMod, false /*fForceRetry*/);
    239243    if (RT_SUCCESS(rc))
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