fbsd-nat: Add helper routine to fetch siginfo_t for a ptid.

This commit is contained in:
John Baldwin
2022-03-22 12:05:43 -07:00
parent 1570c37c34
commit 6719bc690e
2 changed files with 20 additions and 0 deletions

View File

@ -1766,6 +1766,22 @@ fbsd_nat_target::store_register_set (struct regcache *regcache, int regnum,
return false;
}
/* See fbsd-nat.h. */
bool
fbsd_nat_get_siginfo (ptid_t ptid, siginfo_t *siginfo)
{
struct ptrace_lwpinfo pl;
pid_t pid = get_ptrace_pid (ptid);
if (ptrace (PT_LWPINFO, pid, (caddr_t) &pl, sizeof pl) == -1)
return false;
if (!(pl.pl_flags & PL_FLAG_SI))
return false;;
*siginfo = pl.pl_siginfo;
return (true);
}
void _initialize_fbsd_nat ();
void
_initialize_fbsd_nat ()

View File

@ -166,4 +166,8 @@ protected:
}
};
/* Fetch the signal information for PTID and store it in *SIGINFO.
Return true if successful. */
bool fbsd_nat_get_siginfo (ptid_t ptid, siginfo_t *siginfo);
#endif /* fbsd-nat.h */