HomeFreeBSD

Add PT_GETREGSET

Description

Add PT_GETREGSET

This adds the PT_GETREGSET and PT_SETREGSET ptrace types. These can be
used to access all the registers from a specified core dump note type.
The NT_PRSTATUS and NT_FPREGSET notes are initially supported. Other
machine-dependant types are expected to be added in the future.

The ptrace addr points to a struct iovec pointing at memory to hold the
registers along with its length. On success the length in the iovec is
updated to tell userspace the actual length the kernel wrote or, if the
base address is NULL, the length the kernel would have written.

Because the data field is an int the arguments are backwards when
compared to the Linux PTRACE_GETREGSET call.

Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D19831

(cherry picked from commit 548a2ec49bd4ebf9ab00d362257c6bb4d2d7edbc)

Details

Provenance
andrewAuthored on Jan 24 2022, 11:24 AM
jhbCommitted on May 12 2022, 10:12 PM
Reviewer
kib
Differential Revision
D19831: Add PT_GETREGSET
Parents
rGe5e2c7ffa0f7: Create sys/reg.h for the common code previously in machine/reg.h
Branches
Unknown
Tags
Unknown