Exemplo n.º 1
0
bool UnixNativeCodeManager::UnwindStackFrame(MethodInfo *    pMethodInfo,
                                             REGDISPLAY *    pRegisterSet,                 // in/out
                                             PTR_VOID *      ppPreviousTransitionFrame)    // out
{
    if (!VirtualUnwind(pRegisterSet))
    {
        return false;
    }

    // @TODO: CORERT: PInvoke transitions
    *ppPreviousTransitionFrame = NULL;

    return true;
}
Exemplo n.º 2
0
bool UnixNativeCodeManager::UnwindStackFrame(MethodInfo *    pMethodInfo,
                                             REGDISPLAY *    pRegisterSet,                 // in/out
                                             PTR_VOID *      ppPreviousTransitionFrame)    // out
{
    UnixNativeMethodInfo * pNativeMethodInfo = (UnixNativeMethodInfo *)pMethodInfo;

    PTR_UInt8 p = pNativeMethodInfo->pMainLSDA;

    uint8_t unwindBlockFlags = *p++;

    if ((unwindBlockFlags & UBF_FUNC_REVERSE_PINVOKE) != 0)
    {
        // Reverse PInvoke transition should on the main function body only
        assert(pNativeMethodInfo->pMainLSDA == pNativeMethodInfo->pLSDA);

        if ((unwindBlockFlags & UBF_FUNC_HAS_EHINFO) != 0)
            p += sizeof(int32_t);

        GcInfoDecoder decoder(GCInfoToken(p), DECODE_REVERSE_PINVOKE_VAR);

        // @TODO: CORERT: Encode reverse PInvoke frame slot in GCInfo: https://github.com/dotnet/corert/issues/2115
        // INT32 slot = decoder.GetReversePInvokeFrameStackSlot();
        // assert(slot != NO_REVERSE_PINVOKE_FRAME);

        *ppPreviousTransitionFrame = (PTR_VOID)-1;
        return true;
    }

    *ppPreviousTransitionFrame = NULL;

    if (!VirtualUnwind(pRegisterSet))
    {
        return false;
    }

    return true;
}