Logo Search packages:      
Sourcecode: virtualbox-ose version File versions  Download package

static int kDbgModPeQueryLine ( PKDBGMOD  pMod,
int32_t  iSegment,
KDBGADDR  off,
PKDBGLINE  pLine 
) [static]

Gets a line number entry by segment:offset. This will be approximated to the nearest line number there is no exact match.

Returns:
0 on success. KLDR_ERR_* on failure.
Parameters:
pMod The module.
iSegment The segment this offset is relative to. The -1 segment is special, it means that the addres is relative to the image base. The image base is where the first bit of the image is mapped during load.
off The offset into the segment.
pLine Where to store the line number details.

Definition at line 128 of file kDbgModPE.cpp.

References KDBGLINE::cchFile, DWORD, DWORD64(), KDBGLINE::iLine, KDBGLINE::iSegment, kDbgModPeRVAToSegOff(), kDbgModPeSegOffToRVA(), KERR_NOT_IMPLEMENTED, KDBGLINE::offSegment, KDBGLINE::RVA, strlen(), and KDBGLINE::szFile.

{
    PKDBGMODPE pModPe = (PKDBGMODPE)pMod;

    /*
     * Translate the address to an RVA.
     */
    uint32_t uRVA;
    int rc = kDbgModPeSegOffToRVA(pModPe, iSegment, off, &uRVA);
    if (!rc)
    {
#if 0
        DWORD64 off;
        IMAGEHLP_LINE64 Line;
        Line.SizeOfStruct = sizeof(Line);
        if (g_pfnSymGetLineFromAddr64(pModPe->hSymInst, pModPe->ImageBase + uRVA, &off, &Line))
        {
            pLine->RVA = (KDBGADDR)(Line.Address - pModPe->ImageBase);
            rc = kDbgModPeRVAToSegOff(pModPe, pLine->RVA, &pLine->iSegment, &pLine->offSegment);
            pLine->iLine = Line.LineNumber;
            pLine->cchFile = strlen(Line.FileName);
            if (pLine->cchFile >= sizeof(pLine->szFile))
                pLine->cchFile = sizeof(pLine->szFile) - 1;
            memcpy(pLine->szFile, Line.FileName, pLine->cchFile + 1);
        }
        else
        {
            DWORD Err = GetLastError();
            rc = kDbgModPeConvWinError(Err);
        }
#endif
        rc = KERR_NOT_IMPLEMENTED;
    }
    return rc;
}


Generated by  Doxygen 1.6.0   Back to index