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 NetBSD 10 build #4524

Merged
merged 2 commits into from
Jun 1, 2024
Merged
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
11 changes: 9 additions & 2 deletions librz/debug/p/native/bsd/bsd_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ static void addr_to_string(struct sockaddr_storage *ss, char *buffer, int buflen

int bsd_handle_signals(RzDebug *dbg) {
#if __KFBSD__ || __NetBSD__
siginfo_t siginfo;
#if __KFBSD__
// Trying to figure out a bit by the signal
struct ptrace_lwpinfo linfo = { 0 };
siginfo_t siginfo;
int ret = ptrace(PT_LWPINFO, dbg->pid, (char *)&linfo, sizeof(linfo));
if (ret == -1) {
if (errno == ESRCH) {
Expand All @@ -83,7 +84,6 @@ int bsd_handle_signals(RzDebug *dbg) {
return 0;
}

#if __KFBSD__
siginfo = linfo.pl_siginfo;
#else
struct ptrace_siginfo sinfo = { 0 };
Expand All @@ -108,6 +108,13 @@ int bsd_handle_signals(RzDebug *dbg) {
case SIGSEGV:
dbg->reason.type = RZ_DEBUG_REASON_SEGFAULT;
break;
#if __NetBSD__
case SIGTRAP:
if (siginfo.si_code == TRAP_BRKPT) {
dbg->reason.type = RZ_DEBUG_REASON_BREAKPOINT;
}
break;
#endif
}

return 0;
Expand Down
Loading