From 3a124de515e0e5043294604c95aee99c4e4d2ada Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Thu, 7 Sep 2023 22:51:39 +0200 Subject: [PATCH] syscall: remove unused ptracePtr on darwin ptracePtr was introduced in CL 470299 for darwin but it's not used on this platform. Also, the argument types for addr and data were swapped in the generated ptrace1Ptr (probably because the change was not generated but done manually). For #58387 Change-Id: I429ab0c741e19020d98729c34efabce1d9003f56 Reviewed-on: https://go-review.googlesource.com/c/go/+/526475 Auto-Submit: Tobias Klauser Reviewed-by: Ian Lance Taylor Reviewed-by: Bryan Mills LUCI-TryBot-Result: Go LUCI --- src/syscall/ptrace_darwin.go | 7 ------- src/syscall/ptrace_ios.go | 7 ------- src/syscall/syscall_darwin_amd64.go | 1 - src/syscall/syscall_darwin_arm64.go | 1 - src/syscall/zsyscall_darwin_amd64.go | 11 ----------- src/syscall/zsyscall_darwin_arm64.go | 11 ----------- 6 files changed, 38 deletions(-) diff --git a/src/syscall/ptrace_darwin.go b/src/syscall/ptrace_darwin.go index 466f8135b4c..519e451c73f 100644 --- a/src/syscall/ptrace_darwin.go +++ b/src/syscall/ptrace_darwin.go @@ -6,16 +6,9 @@ package syscall -import "unsafe" - // Nosplit because it is called from forkAndExecInChild. // //go:nosplit func ptrace(request int, pid int, addr uintptr, data uintptr) error { return ptrace1(request, pid, addr, data) } - -//go:nosplit -func ptracePtr(request int, pid int, addr unsafe.Pointer, data uintptr) error { - return ptrace1Ptr(request, pid, addr, data) -} diff --git a/src/syscall/ptrace_ios.go b/src/syscall/ptrace_ios.go index a9b291845be..fa8d0007154 100644 --- a/src/syscall/ptrace_ios.go +++ b/src/syscall/ptrace_ios.go @@ -6,16 +6,9 @@ package syscall -import "unsafe" - // Nosplit because it is called from forkAndExecInChild. // //go:nosplit func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { panic("unimplemented") } - -//go:nosplit -func ptracePtr(request int, pid int, addr unsafe.Pointer, data uintptr) (err error) { - panic("unimplemented") -} diff --git a/src/syscall/syscall_darwin_amd64.go b/src/syscall/syscall_darwin_amd64.go index 52ca3c8d5ae..ef3c1998aad 100644 --- a/src/syscall/syscall_darwin_amd64.go +++ b/src/syscall/syscall_darwin_amd64.go @@ -25,7 +25,6 @@ func setTimeval(sec, usec int64) Timeval { //sys Statfs(path string, stat *Statfs_t) (err error) = SYS_statfs64 //sys fstatat(fd int, path string, stat *Stat_t, flags int) (err error) = SYS_fstatat64 //sys ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) = SYS_ptrace -//sys ptrace1Ptr(request int, pid int, addr unsafe.Pointer, data uintptr) (err error) = SYS_ptrace func SetKevent(k *Kevent_t, fd, mode, flags int) { k.Ident = uint64(fd) diff --git a/src/syscall/syscall_darwin_arm64.go b/src/syscall/syscall_darwin_arm64.go index d5da9881178..cea42772bbc 100644 --- a/src/syscall/syscall_darwin_arm64.go +++ b/src/syscall/syscall_darwin_arm64.go @@ -25,7 +25,6 @@ func setTimeval(sec, usec int64) Timeval { //sys Statfs(path string, stat *Statfs_t) (err error) //sys fstatat(fd int, path string, stat *Stat_t, flags int) (err error) //sys ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) = SYS_ptrace -//sys ptrace1Ptr(request int, pid int, addr unsafe.Pointer, data uintptr) (err error) = SYS_ptrace func SetKevent(k *Kevent_t, fd, mode, flags int) { k.Ident = uint64(fd) diff --git a/src/syscall/zsyscall_darwin_amd64.go b/src/syscall/zsyscall_darwin_amd64.go index 83680b381ad..161bb4443a1 100644 --- a/src/syscall/zsyscall_darwin_amd64.go +++ b/src/syscall/zsyscall_darwin_amd64.go @@ -2022,14 +2022,3 @@ func ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) { func libc_ptrace_trampoline() //go:cgo_import_dynamic libc_ptrace ptrace "/usr/lib/libSystem.B.dylib" - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -//go:nosplit -func ptrace1Ptr(request int, pid int, addr unsafe.Pointer, data uintptr) (err error) { - _, _, e1 := syscall6(abi.FuncPCABI0(libc_ptrace_trampoline), uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} diff --git a/src/syscall/zsyscall_darwin_arm64.go b/src/syscall/zsyscall_darwin_arm64.go index 08da23789ac..63073713889 100644 --- a/src/syscall/zsyscall_darwin_arm64.go +++ b/src/syscall/zsyscall_darwin_arm64.go @@ -2022,14 +2022,3 @@ func ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) { func libc_ptrace_trampoline() //go:cgo_import_dynamic libc_ptrace ptrace "/usr/lib/libSystem.B.dylib" - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -//go:nosplit -func ptrace1Ptr(request int, pid int, addr unsafe.Pointer, data uintptr) (err error) { - _, _, e1 := syscall6(abi.FuncPCABI0(libc_ptrace_trampoline), uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -}