static VOID reRaiseException(THREADID tid)
{
    if (exceptionCount == 0)
    {
        fprintf (out, "Trying to replaying the first exception, but we haven't seen one!\n");
        return;
    }
    fprintf (out, "Replaying the first exception\n");
    fflush(out);
    PIN_ReplayContextChange(tid, &savedFromContext, &savedToContext, CONTEXT_CHANGE_REASON_EXCEPTION, savedReason);
}
static VOID ReplayFatal(THREADID tid, CONTEXT *here)
{
    if (RecordedSignal == 0)
    {
        std::cout << "Did not record signal yet in ReplayFatal()" << std::endl;
        std::exit(1);
    }

    std::cout << "Replaying fatal signal" << std::endl;
    PIN_ReplayContextChange(tid, here, 0, CONTEXT_CHANGE_REASON_FATALSIGNAL, RecordedSignal);
    /* does not return */
}