mirror of
https://github.com/golang/sys.git
synced 2026-01-29 07:02:06 +03:00
The existing ptrace wrapper accepts pointer argument as an uintptr which often points to the memory allocated in Go. This violates unsafe.Pointer safety rules. For golang/go#58387 Change-Id: Ib3b4c50368725191f0862c6c7c6d46b0568523c7 Reviewed-on: https://go-review.googlesource.com/c/sys/+/469835 Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com>
18 lines
721 B
Go
18 lines
721 B
Go
// Code generated by linux/mkall.go generatePtraceRegSet("arm64"). DO NOT EDIT.
|
|
|
|
package unix
|
|
|
|
import "unsafe"
|
|
|
|
// PtraceGetRegSetArm64 fetches the registers used by arm64 binaries.
|
|
func PtraceGetRegSetArm64(pid, addr int, regsout *PtraceRegsArm64) error {
|
|
iovec := Iovec{(*byte)(unsafe.Pointer(regsout)), uint64(unsafe.Sizeof(*regsout))}
|
|
return ptracePtr(PTRACE_GETREGSET, pid, uintptr(addr), unsafe.Pointer(&iovec))
|
|
}
|
|
|
|
// PtraceSetRegSetArm64 sets the registers used by arm64 binaries.
|
|
func PtraceSetRegSetArm64(pid, addr int, regs *PtraceRegsArm64) error {
|
|
iovec := Iovec{(*byte)(unsafe.Pointer(regs)), uint64(unsafe.Sizeof(*regs))}
|
|
return ptracePtr(PTRACE_SETREGSET, pid, uintptr(addr), unsafe.Pointer(&iovec))
|
|
}
|