コード例 #1
0
ファイル: pdregist.cpp プロジェクト: ABratovic/open-watcom-v2
static int isWatcomHandler      // FIGURE OUT IF WATCOM HANDLER
    ( __EXC_INFO* info )        // - exception info
{
    int retn;
    if( info->in_func
     && 0 != info->dctx.pdata ) {
        unsigned* hand = (unsigned*)info->dctx.pdata->exc;
        if( 0 != hand
         && hand[1] == 0x2B544157           // "WAT+"
         && hand[2] == 0x4D4F432B ) {       // "+COM"
#if 1
            if( procSetsFP( info->dctx.pdata ) ) {
                info->dctx.fp_actual = GetCtxReg( &info->ctx, Fp );
            } else {
                info->dctx.fp_actual = GetCtxReg( &info->ctx, Sp );
            }
#else
            info->dctx.sp_actual = GetCtxReg( &info->ctx, Sp );
            info->dctx.fp_actual = GetCtxReg( &info->ctx, Fp );
#endif
            info->dctx.fp_alternate = info->dctx.fp_actual;
            getProcInfo( info, &info->dctx );
            retn = 1;
        } else {
            retn = 0;
        }
    } else {
        retn = 0;
    }
    return retn;
}
コード例 #2
0
static bool isWatcomHandler     // FIGURE OUT IF WATCOM HANDLER
    ( __EXC_INFO* info )        // - exception info
{
    bool retn;

    retn = false;
    if( info->in_func && 0 != info->dctx.pdata ) {
        unsigned* handler = (unsigned*)info->dctx.pdata->ExceptionHandler;
        if( NULL != handler
         && handler[1] == 0x2B544157           // "WAT+"
         && handler[2] == 0x4D4F432B ) {       // "+COM"
#if 1
            if( procSetsFP( info->dctx.pdata ) ) {
                info->dctx.fp_actual = GetCtxReg( &info->ctx, Fp );
            } else {
                info->dctx.fp_actual = GetCtxReg( &info->ctx, Sp );
            }
#else
            info->dctx.sp_actual = GetCtxReg( &info->ctx, Sp );
            info->dctx.fp_actual = GetCtxReg( &info->ctx, Fp );
#endif
            info->dctx.fp_alternate = info->dctx.fp_actual;
            getProcInfo( info, &info->dctx );
            retn = true;
        }
    }
    return( retn );
}
コード例 #3
0
ファイル: pdregist.cpp プロジェクト: ABratovic/open-watcom-v2
static void initExcInfo         // INITIALIZE __EXC_INFO
    ( __EXC_INFO* info )        // - exception info
{
#ifndef NDEBUG
    memset( info, 0xdd, sizeof( *info ) );
#endif
    info->dctx.ctx = &info->ctx;
    RtlCaptureContext( info->dctx.ctx );
    info->dctx.pc = GetCtxReg( &info->ctx, Ra );
    info->in_func = 1;
    info = setPdata( info );
    nextExcInfo( info );
}