static plcrash_greg_t plcrash_async_thread_state_get_reg_32()

in Source/PLCrashAsyncThread_x86.c [278:338]


static plcrash_greg_t plcrash_async_thread_state_get_reg_32 (const plcrash_async_thread_state_t *thread_state, plcrash_regnum_t regnum) {
    const plcrash_async_thread_state_t *ts = thread_state;

    /* All word-sized registers */
    switch (regnum) {
        case PLCRASH_X86_EAX:
            RETGEN(eax, thread.uts.ts32, ts);
            
        case PLCRASH_X86_EDX:
            RETGEN(edx, thread.uts.ts32, ts);
            
        case PLCRASH_X86_ECX:
            RETGEN(ecx, thread.uts.ts32, ts);
            
        case PLCRASH_X86_EBX:
            RETGEN(ebx, thread.uts.ts32, ts);
            
        case PLCRASH_X86_EBP:
            RETGEN(ebp, thread.uts.ts32, ts);
            
        case PLCRASH_X86_ESI:
            RETGEN(esi, thread.uts.ts32, ts);
            
        case PLCRASH_X86_EDI:
            RETGEN(edi, thread.uts.ts32, ts);
            
        case PLCRASH_X86_ESP:
            RETGEN(esp, thread.uts.ts32, ts);
            
        case PLCRASH_X86_EIP:
            RETGEN(eip, thread.uts.ts32, ts);
            
        case PLCRASH_X86_EFLAGS:
            RETGEN(eflags, thread.uts.ts32, ts);
            
        case PLCRASH_X86_TRAPNO:
            RETGEN(trapno, exception.ues.es32, ts);
            
        case PLCRASH_X86_CS:
            RETGEN(cs, thread.uts.ts32, ts);
            
        case PLCRASH_X86_DS:
            RETGEN(ds, thread.uts.ts32, ts);
            
        case PLCRASH_X86_ES:
            RETGEN(es, thread.uts.ts32, ts);
            
        case PLCRASH_X86_FS:
            RETGEN(fs, thread.uts.ts32, ts);
            
        case PLCRASH_X86_GS:
            RETGEN(gs, thread.uts.ts32, ts);
            
        default:
            // Unsupported register
            __builtin_trap();
    }
    
    /* Shouldn't be reachable */
    return 0;
}