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

static KU32 KPRF_NAME() NewModSeg ( KPRF_TYPE(P, HDR)  pHdr,
KPRF_TYPE(, UPTR)  uPC,
KU32  off 
) [static]

Queries data for and inserts a new module segment.

Returns:
Offset to the module if existing or successfully added

0 if not found.

Parameters:
pHdr The profiler header.
uPC Address within the module.
off The offset into the modseg area which has been searched. (This is relative to the first moddule segment record (at pHdr->offModSegs).)

Definition at line 133 of file prfcoremodseg.cpp.h.

References InsertModSeg(), KPRF_NAME, and KPRF_TYPE.

Referenced by RecordModSeg().

{
    /*
     * Query the module name and object of the function.
     */
#pragma pack(1)
    struct
    {
        KPRF_TYPE(,MODSEG) ModSeg;
        char               szMorePath[260];
    } s;
#pragma pack()
    if (KPRF_GET_MODSEG(uPC + pHdr->uBasePtr, s.ModSeg.szPath, sizeof(s.ModSeg.szPath) + sizeof(s.szMorePath),
                        &s.ModSeg.iSegment, &s.ModSeg.uBasePtr, &s.ModSeg.cbSegmentMinusOne))
        return 0;
    s.ModSeg.uBasePtr -= pHdr->uBasePtr;
    s.ModSeg.fLoaded = 1;
    s.ModSeg.cchPath = 0;
    while (s.ModSeg.szPath[s.ModSeg.cchPath])
        s.ModSeg.cchPath++;

    return KPRF_NAME(InsertModSeg)(pHdr, &s.ModSeg, off);
}


Generated by  Doxygen 1.6.0   Back to index