diff --git a/core/linux/context.cpp b/core/linux/context.cpp index 2d5bd6230..74136a177 100644 --- a/core/linux/context.cpp +++ b/core/linux/context.cpp @@ -65,6 +65,15 @@ static void context_segfault(host_context_t* hostctx, void* segfault_ctx) #if defined(__APPLE__) bicopy(hostctx->pc, MCTX(->__ss.__pc)); bicopy(hostctx->x0, MCTX(->__ss.__x[0])); + #elif defined(__FreeBSD__) + bicopy(hostctx->pc, MCTX(.mc_gpregs.gp_elr)); + bicopy(hostctx->x0, MCTX(.mc_gpregs.gp_x[0])); + #elif defined(__NetBSD__) + bicopy(hostctx->pc, MCTX(.__gregs[_REG_ELR])); + bicopy(hostctx->x0, MCTX(.__gregs[_REG_X0])); + #elif defined(__OpenBSD__) + bicopy(hostctx->pc, MCTX(->sc_elr)); + bicopy(hostctx->x0, MCTX(->sc_x[0])); #else bicopy(hostctx->pc, MCTX(.pc)); bicopy(hostctx->x0, MCTX(.regs[0]));