]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: add PtraceSyscall(pid int, signal int)
authorDave Cheney <dave@cheney.net>
Fri, 31 Aug 2012 23:17:14 +0000 (09:17 +1000)
committerDave Cheney <dave@cheney.net>
Fri, 31 Aug 2012 23:17:14 +0000 (09:17 +1000)
Fixes #3525.

PTRACE_SYSCALL behaves like PTRACE_CONT and can deliver
a signal to the process. Ideally PtraceSingleStep should
support the signal argument, but its interface is frozen
by Go1.

R=golang-dev, r, rsc
CC=golang-dev
https://golang.org/cl/6353051

src/pkg/syscall/syscall_linux.go

index 7b79073eb115746d5453f3f6cb141d1c6a29f97b..fbe6b045769c41f544dcf1ffcd611ba31a01ca27 100644 (file)
@@ -735,6 +735,10 @@ func PtraceCont(pid int, signal int) (err error) {
        return ptrace(PTRACE_CONT, pid, 0, uintptr(signal))
 }
 
+func PtraceSyscall(pid int, signal int) (err error) {
+       return ptrace(PTRACE_SYSCALL, pid, 0, uintptr(signal))
+}
+
 func PtraceSingleStep(pid int) (err error) { return ptrace(PTRACE_SINGLESTEP, pid, 0, 0) }
 
 func PtraceAttach(pid int) (err error) { return ptrace(PTRACE_ATTACH, pid, 0, 0) }