Skip to content

Commit

Permalink
Fix debugger on non-x86 FreeBSD ##debug
Browse files Browse the repository at this point in the history
  • Loading branch information
oleavr authored and trufae committed Jan 31, 2025
1 parent 37dfc3f commit 9155ffa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libr/debug/p/debug_native.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions libr/debug/p/native/bsd/bsd_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 9155ffa

Please sign in to comment.