From 9155ffab7e4147e5beaf33ba6fa3da3b18fec3e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Andr=C3=A9=20Vadla=20Ravn=C3=A5s?= Date: Fri, 31 Jan 2025 11:38:38 +0100 Subject: [PATCH] Fix debugger on non-x86 FreeBSD ##debug --- libr/debug/p/debug_native.c | 2 ++ libr/debug/p/native/bsd/bsd_debug.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/libr/debug/p/debug_native.c b/libr/debug/p/debug_native.c index 6d8d763960b78..398cf6a958fb1 100644 --- a/libr/debug/p/debug_native.c +++ b/libr/debug/p/debug_native.c @@ -667,12 +667,14 @@ static int bsd_reg_read(RDebug *dbg, int type, ut8* buf, int size) { case R_REG_TYPE_VEC128: // XMM case R_REG_TYPE_VEC256: // YMM case R_REG_TYPE_VEC512: // ZMM +#if __i386__ || __x86_64__ #if __KFBSD__ struct ptrace_xstate_info info; ret = ptrace (PT_GETXSTATE_INFO, pid, (caddr_t)&info, sizeof (info)); if (info.xsave_len != 0) { ret = ptrace (PT_GETXSTATE, pid, (caddr_t)buf, info.xsave_len); } +#endif #endif break; case R_REG_TYPE_SEG: diff --git a/libr/debug/p/native/bsd/bsd_debug.c b/libr/debug/p/native/bsd/bsd_debug.c index cb6180b1775e6..83bc9b9a1e221 100644 --- a/libr/debug/p/native/bsd/bsd_debug.c +++ b/libr/debug/p/native/bsd/bsd_debug.c @@ -124,12 +124,14 @@ bool bsd_reg_write(RDebug *dbg, int type, const ut8 *buf, int size) { case R_REG_TYPE_VEC128: // XMM case R_REG_TYPE_VEC256: // YMM case R_REG_TYPE_VEC512: // ZMM +#if __i386__ || __x86_64__ #if __KFBSD__ struct ptrace_xstate_info info; r = ptrace (PT_GETXSTATE_INFO, dbg->pid, (caddr_t)&info, sizeof (info)); if (info.xsave_len != 0) { r = ptrace (PT_SETXSTATE, dbg->pid, (caddr_t)buf, info.xsave_len); } +#endif #endif break; }