core/x86/arch.c
/* Use THREAD_GET instead of THREAD so log messages go to calling thread */
Use THREAD_GET instead of THREAD so log messages go to calling thread
Use THREAD_GET instead of THREAD so log messages go to calling thread
recreate_success_t
recreate_app_state(dcontext_t *tdcontext, dr_mcontext_t *mcontext,
                   bool restore_memory)
{
    recreate_success_t res;
    KSTART(recreate_app_state_unknown);
#ifdef DEBUG
    if (stats->loglevel >= 2 && (stats->logmask & LOG_SYNCH) != 0) {
        LOG(THREAD_GET, LOG_SYNCH, 2,
            "recreate_app_state -- translating from:\n");
        dump_mcontext(mcontext, THREAD_GET, DUMP_NOT_XML);
    }
#endif
    res = recreate_app_state_internal(tdcontext, mcontext, false, NULL, restore_memory);
#ifdef DEBUG
    if (res) {
        if (stats->loglevel >= 2 && (stats->logmask & LOG_SYNCH) != 0) {
            LOG(THREAD_GET, LOG_SYNCH, 2,
                "recreate_app_state -- translation is:\n");
            dump_mcontext(mcontext, THREAD_GET, DUMP_NOT_XML);
        }
    } else {
        LOG(THREAD_GET, LOG_SYNCH, 2,
            "recreate_app_state -- unable to translate\n");
    }
#endif
    switch (res) {
    case RECREATE_FAILURE:
        KSWITCH_STOP(recreate_app_state_failure);
        break;
    case RECREATE_SUCCESS_STATE:
        KSWITCH_STOP(recreate_app_state_success_state);
        break;
    case RECREATE_SUCCESS_PC:
        KSWITCH_STOP(recreate_app_state_success_pc);
        break;
    case RECREATE_DELAY_UNTIL_DISPATCH:
        KSWITCH_STOP(recreate_app_state_delay_dispatch);
        break;
    case RECREATE_DELAY_UNTIL_PC:
        KSWITCH_STOP(recreate_app_state_delay_pc);
        break;
    }
    return res;
}
recreate_success_t recreate_app_state ( dcontext_t * tdcontext , dr_mcontext_t * mcontext , bool restore_memory ) { recreate_success_t res ; KSTART ( recreate_app_state_unknown ) ; #ifdef DEBUG if ( stats -> loglevel >= 2 && ( stats -> logmask & LOG_SYNCH ) != 0 ) { LOG ( THREAD_GET , LOG_SYNCH , 2 , " \n " ) ; dump_mcontext ( mcontext , THREAD_GET , DUMP_NOT_XML ) ; } #endif res = recreate_app_state_internal ( tdcontext , mcontext , false , NULL , restore_memory ) ; #ifdef DEBUG if ( res ) { if ( stats -> loglevel >= 2 && ( stats -> logmask & LOG_SYNCH ) != 0 ) { LOG ( THREAD_GET , LOG_SYNCH , 2 , " \n " ) ; dump_mcontext ( mcontext , THREAD_GET , DUMP_NOT_XML ) ; } } else { LOG ( THREAD_GET , LOG_SYNCH , 2 , " \n " ) ; } #endif switch ( res ) { case RECREATE_FAILURE : KSWITCH_STOP ( recreate_app_state_failure ) ; break ; case RECREATE_SUCCESS_STATE : KSWITCH_STOP ( recreate_app_state_success_state ) ; break ; case RECREATE_SUCCESS_PC : KSWITCH_STOP ( recreate_app_state_success_pc ) ; break ; case RECREATE_DELAY_UNTIL_DISPATCH : KSWITCH_STOP ( recreate_app_state_delay_dispatch ) ; break ; case RECREATE_DELAY_UNTIL_PC : KSWITCH_STOP ( recreate_app_state_delay_pc ) ; break ; } return res ; }
Use THREAD_GET instead of THREAD so log messages go to calling thread
Use THREAD_GET instead of THREAD so log messages go to calling thread