aboutsummaryrefslogtreecommitdiff
path: root/gdb/fbsd-nat.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2022-03-22 12:05:43 -0700
committerJohn Baldwin <jhb@FreeBSD.org>2022-03-22 12:05:43 -0700
commit6719bc690e2829c50d3d3bb22ede1324e5baa12a (patch)
tree23e6744628f85f6f273e3dbfd3e6f7d16ec0d5c1 /gdb/fbsd-nat.c
parent1570c37c340bb9df2db2c30b437d6c30e1d75459 (diff)
downloadgdb-6719bc690e2829c50d3d3bb22ede1324e5baa12a.zip
gdb-6719bc690e2829c50d3d3bb22ede1324e5baa12a.tar.gz
gdb-6719bc690e2829c50d3d3bb22ede1324e5baa12a.tar.bz2
fbsd-nat: Add helper routine to fetch siginfo_t for a ptid.
Diffstat (limited to 'gdb/fbsd-nat.c')
-rw-r--r--gdb/fbsd-nat.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gdb/fbsd-nat.c b/gdb/fbsd-nat.c
index 6d76c82..51234ea 100644
--- a/gdb/fbsd-nat.c
+++ b/gdb/fbsd-nat.c
@@ -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 ()