/* Regvars handler for the IA32 architecture on SYSV */ void e2dbg_get_regvars_ia32_sysv() { PROFILER_IN(__FILE__, __FUNCTION__, __LINE__); #if defined(__i386__) && (defined(__linux__) || defined(sun)) E2DBG_GETREG(E2DBG_EAX_VAR, e2dbgworld.curthread->context->uc_mcontext.gregs[REG_EAX]); E2DBG_GETREG(E2DBG_EBX_VAR, e2dbgworld.curthread->context->uc_mcontext.gregs[REG_EBX]); E2DBG_GETREG(E2DBG_ECX_VAR, e2dbgworld.curthread->context->uc_mcontext.gregs[REG_ECX]); E2DBG_GETREG(E2DBG_EDX_VAR, e2dbgworld.curthread->context->uc_mcontext.gregs[REG_EDX]); E2DBG_GETREG(E2DBG_ESI_VAR, e2dbgworld.curthread->context->uc_mcontext.gregs[REG_ESI]); E2DBG_GETREG(E2DBG_EDI_VAR, e2dbgworld.curthread->context->uc_mcontext.gregs[REG_EDI]); E2DBG_GETREG(E2DBG_SP_VAR , e2dbgworld.curthread->context->uc_mcontext.gregs[REG_ESP]); E2DBG_GETREG(E2DBG_SSP_VAR, e2dbgworld.curthread->context->uc_mcontext.gregs[REG_UESP]); E2DBG_GETREG(E2DBG_FP_VAR , e2dbgworld.curthread->context->uc_mcontext.gregs[REG_EBP]); E2DBG_GETREG(E2DBG_PC_VAR , e2dbgworld.curthread->context->uc_mcontext.gregs[REG_EIP]); #endif PROFILER_OUT(__FILE__, __FUNCTION__, __LINE__); }
/* Regvars handler for the IA32 architecture on SYSV */ void e2dbg_get_regvars_sparc32_sysv() { PROFILER_IN(__FILE__, __FUNCTION__, __LINE__); #if defined(SPARC) && (defined(__linux__) || defined(sun)) E2DBG_GETREG(E2DBG_PC_VAR , e2dbgworld.curthread->context->uc_mcontext.gregs[REG_PC]); E2DBG_GETREG(E2DBG_NPC_VAR, e2dbgworld.curthread->context->uc_mcontext.gregs[REG_nPC]); E2DBG_GETREG(E2DBG_Y_VAR , e2dbgworld.curthread->context->uc_mcontext.gregs[REG_Y]); E2DBG_GETREG(E2DBG_G1_VAR , e2dbgworld.curthread->context->uc_mcontext.gregs[REG_G1]); E2DBG_GETREG(E2DBG_G2_VAR , e2dbgworld.curthread->context->uc_mcontext.gregs[REG_G2]); E2DBG_GETREG(E2DBG_G3_VAR , e2dbgworld.curthread->context->uc_mcontext.gregs[REG_G3]); E2DBG_GETREG(E2DBG_G4_VAR , e2dbgworld.curthread->context->uc_mcontext.gregs[REG_G4]); E2DBG_GETREG(E2DBG_G5_VAR , e2dbgworld.curthread->context->uc_mcontext.gregs[REG_G5]); E2DBG_GETREG(E2DBG_G5_VAR , e2dbgworld.curthread->context->uc_mcontext.gregs[REG_G6]); E2DBG_GETREG(E2DBG_G7_VAR , e2dbgworld.curthread->context->uc_mcontext.gregs[REG_G7]); E2DBG_GETREG(E2DBG_O0_VAR , e2dbgworld.curthread->context->uc_mcontext.gregs[REG_O0]); E2DBG_GETREG(E2DBG_O1_VAR , e2dbgworld.curthread->context->uc_mcontext.gregs[REG_O1]); E2DBG_GETREG(E2DBG_O2_VAR , e2dbgworld.curthread->context->uc_mcontext.gregs[REG_O2]); E2DBG_GETREG(E2DBG_O3_VAR , e2dbgworld.curthread->context->uc_mcontext.gregs[REG_O3]); E2DBG_GETREG(E2DBG_O4_VAR , e2dbgworld.curthread->context->uc_mcontext.gregs[REG_O4]); E2DBG_GETREG(E2DBG_O5_VAR , e2dbgworld.curthread->context->uc_mcontext.gregs[REG_O5]); E2DBG_GETREG(E2DBG_O6_VAR , e2dbgworld.curthread->context->uc_mcontext.gregs[REG_O6]); E2DBG_GETREG(E2DBG_O7_VAR , e2dbgworld.curthread->context->uc_mcontext.gregs[REG_O7]); #endif PROFILER_OUT(__FILE__, __FUNCTION__, __LINE__); }
/* Regvars handler for the AMD64 architecture on SYSV */ void e2dbg_get_regvars_amd64_sysv() { PROFILER_IN(__FILE__, __FUNCTION__, __LINE__); #if defined(__amd64__) && defined(__linux__) E2DBG_GETREG(E2DBG_R8_VAR, e2dbgworld.curthread->context->uc_mcontext.gregs[REG_R8]); E2DBG_GETREG(E2DBG_R9_VAR, e2dbgworld.curthread->context->uc_mcontext.gregs[REG_R9]); E2DBG_GETREG(E2DBG_R10_VAR, e2dbgworld.curthread->context->uc_mcontext.gregs[REG_R10]); E2DBG_GETREG(E2DBG_R11_VAR, e2dbgworld.curthread->context->uc_mcontext.gregs[REG_R11]); E2DBG_GETREG(E2DBG_R12_VAR, e2dbgworld.curthread->context->uc_mcontext.gregs[REG_R12]); E2DBG_GETREG(E2DBG_R13_VAR, e2dbgworld.curthread->context->uc_mcontext.gregs[REG_R13]); E2DBG_GETREG(E2DBG_R14_VAR, e2dbgworld.curthread->context->uc_mcontext.gregs[REG_R14]); E2DBG_GETREG(E2DBG_R15_VAR, e2dbgworld.curthread->context->uc_mcontext.gregs[REG_R15]); E2DBG_GETREG(E2DBG_RDI_VAR, e2dbgworld.curthread->context->uc_mcontext.gregs[REG_RDI]); E2DBG_GETREG(E2DBG_RSI_VAR, e2dbgworld.curthread->context->uc_mcontext.gregs[REG_RSI]); E2DBG_GETREG(E2DBG_RBP_VAR, e2dbgworld.curthread->context->uc_mcontext.gregs[REG_RBP]); E2DBG_GETREG(E2DBG_RBX_VAR, e2dbgworld.curthread->context->uc_mcontext.gregs[REG_RBX]); E2DBG_GETREG(E2DBG_RDX_VAR, e2dbgworld.curthread->context->uc_mcontext.gregs[REG_RDX]); E2DBG_GETREG(E2DBG_RAX_VAR, e2dbgworld.curthread->context->uc_mcontext.gregs[REG_RAX]); E2DBG_GETREG(E2DBG_RCX_VAR, e2dbgworld.curthread->context->uc_mcontext.gregs[REG_RCX]); E2DBG_GETREG(E2DBG_RSP_VAR, e2dbgworld.curthread->context->uc_mcontext.gregs[REG_RSP]); E2DBG_GETREG(E2DBG_RIP_VAR, e2dbgworld.curthread->context->uc_mcontext.gregs[REG_RIP]); E2DBG_GETREG(E2DBG_EFLAGS_VAR, e2dbgworld.curthread->context->uc_mcontext.gregs[REG_EFL]); E2DBG_GETREG(E2DBG_CS_VAR, ((e2dbgworld.curthread->context->uc_mcontext.gregs[REG_CSGSFS] >> 48) & 0xFFFF)); E2DBG_GETREG(E2DBG_GS_VAR, ((e2dbgworld.curthread->context->uc_mcontext.gregs[REG_CSGSFS] >> 32) & 0xFFFF)); E2DBG_GETREG(E2DBG_FS_VAR, ((e2dbgworld.curthread->context->uc_mcontext.gregs[REG_CSGSFS] >> 16) & 0xFFFF)); E2DBG_GETREG(E2DBG_CR2_VAR, e2dbgworld.curthread->context->uc_mcontext.gregs[REG_CR2]); #endif PROFILER_OUT(__FILE__, __FUNCTION__, __LINE__); }
/* Regvars handler for the AMD64 architecture on BSD */ void e2dbg_get_regvars_amd64_bsd() { PROFILER_IN(__FILE__, __FUNCTION__, __LINE__); #if !defined(sun) && !defined(__amd64__) && defined(__FreeBSD__) //|| defined (__OpenBSD__) E2DBG_GETREG(E2DBG_EAX_VAR, e2dbgworld.curthread->context->uc_mcontext.mc_eax); E2DBG_GETREG(E2DBG_EBX_VAR, e2dbgworld.curthread->context->uc_mcontext.mc_ebx); E2DBG_GETREG(E2DBG_ECX_VAR, e2dbgworld.curthread->context->uc_mcontext.mc_ecx); E2DBG_GETREG(E2DBG_EDX_VAR, e2dbgworld.curthread->context->uc_mcontext.mc_edx); E2DBG_GETREG(E2DBG_ESI_VAR, e2dbgworld.curthread->context->uc_mcontext.mc_esi); E2DBG_GETREG(E2DBG_EDI_VAR, e2dbgworld.curthread->context->uc_mcontext.mc_edi); E2DBG_GETREG(E2DBG_SP_VAR , e2dbgworld.curthread->context->uc_mcontext.mc_esp); //E2DBG_GETREG(E2DBG_SSPVAR, e2dbgworld.curthread->context->uc_mcontext.mc_ssp); /* XXX */ E2DBG_GETREG(E2DBG_FP_VAR , e2dbgworld.curthread->context->uc_mcontext.mc_ebp); E2DBG_GETREG(E2DBG_PC_VAR , e2dbgworld.curthread->context->uc_mcontext.mc_eip); #elif defined(__NetBSD__) E2DBG_GETREG(E2DBG_EAX_VAR, e2dbgworld.curthread->context->uc_mcontext.__gregs[_REG_EAX]); E2DBG_GETREG(E2DBG_EBX_VAR, e2dbgworld.curthread->context->uc_mcontext.__gregs[_REG_EBX]); E2DBG_GETREG(E2DBG_ECX_VAR, e2dbgworld.curthread->context->uc_mcontext.__gregs[_REG_ECX]); E2DBG_GETREG(E2DBG_EDX_VAR, e2dbgworld.curthread->context->uc_mcontext.__gregs[_REG_EDX]); E2DBG_GETREG(E2DBG_ESI_VAR, e2dbgworld.curthread->context->uc_mcontext.__gregs[_REG_ESI]); E2DBG_GETREG(E2DBG_EDI_VAR, e2dbgworld.curthread->context->uc_mcontext.__gregs[_REG_EDI]); E2DBG_GETREG(E2DBG_SP_VAR , e2dbgworld.curthread->context->uc_mcontext.__gregs[_REG_ESP]); //E2DBG_GETREG(E2DBG_SSP_VAR, e2dbgworld.curthread->context->uc_mcontext.mc_ssp); /* XXX */ E2DBG_GETREG(E2DBG_FP_VAR , e2dbgworld.curthread->context->uc_mcontext.__gregs[_REG_EBP]); E2DBG_GETREG(E2DBG_PC_VAR , e2dbgworld.curthread->context->uc_mcontext.__gregs[_REG_EIP]); #endif PROFILER_OUT(__FILE__, __FUNCTION__, __LINE__); }