Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix FreeBSD/arm64 support #23939

Merged
merged 2 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
6 changes: 3 additions & 3 deletions libr/io/p/io_self.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static void macosx_debug_regions (SelfData *data, RIO *io, task_t task, mach_vm_
#include <kvm.h>
#endif
#include <errno.h>
static bool bsd_proc_vmmaps(RIO *io, int pid);
static bool bsd_proc_vmmaps(SelfData *sd, RIO *io, int pid);
#endif
#ifdef __HAIKU__
#include <kernel/image.h>
Expand Down Expand Up @@ -246,7 +246,7 @@ static int update_self_regions(RIO *io, int pid, SelfData *sd) {

return true;
#elif R2__BSD__
return bsd_proc_vmmaps(io, pid);
return bsd_proc_vmmaps(sd, io, pid);
#elif __HAIKU__
image_info ii;
int32 cookie = 0;
Expand Down Expand Up @@ -738,7 +738,7 @@ static void macosx_debug_regions(SelfData *sd, RIO *io, task_t task, mach_vm_add
}
}
#elif R2__BSD__
static bool bsd_proc_vmmaps(RIO *io, int pid) {
static bool bsd_proc_vmmaps(SelfData *sd, RIO *io, int pid) {
#if __FreeBSD__
size_t size;
bool ret = false;
Expand Down
Loading