rem: struct iframe *frame = i386_get_current_iframe(); memcpy(cpuState, frame, sizeof(debug_cpu_state));
add: if (struct iframe *frame = i386_get_user_iframe()) { struct thread *thread = thread_get_current_thread();  i386_fsave(cpuState->extended_regs);    cpuState->gs = frame->gs; cpuState->fs = frame->fs; cpuState->es = frame->es; cpuState->ds = frame->ds; cpuState->edi = frame->edi; cpuState->esi = frame->esi; cpuState->ebp = frame->ebp; cpuState->esp = frame->esp; cpuState->ebx = frame->ebx; cpuState->edx = frame->orig_edx; cpuState->ecx = frame->ecx; cpuState->eax = frame->orig_eax; cpuState->vector = frame->vector; cpuState->error_code = frame->error_code; cpuState->eip = frame->eip; cpuState->cs = frame->cs; cpuState->eflags = frame->flags; cpuState->user_esp = frame->user_esp; cpuState->user_ss = frame->user_ss; }
context: arch_get_debug_cpu_state(struct debug_cpu_state *cpuState){	struct iframe *frame = i386_get_current_iframe();	memcpy(cpuState, frame, sizeof(debug_cpu_state));}