mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-05 08:37:31 -04:00
unix: remove recently introduced debug/elf dependency
CL 501795 added a dependency on debug/elf (and thus compress/gzip, debug/dwarf, hash/adler32) Add a copy of the const instead. Change-Id: I2c86094ef7de61b8dd0bdd727f6e547ac7f58527 Reviewed-on: https://go-review.googlesource.com/c/sys/+/502356 Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
committed by
Gopher Robot
parent
5059a07aa4
commit
55b11dcdae
@@ -12,7 +12,6 @@
|
|||||||
package unix
|
package unix
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"debug/elf"
|
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"strconv"
|
"strconv"
|
||||||
"syscall"
|
"syscall"
|
||||||
@@ -1700,18 +1699,23 @@ func PtracePokeUser(pid int, addr uintptr, data []byte) (count int, err error) {
|
|||||||
return ptracePoke(PTRACE_POKEUSR, PTRACE_PEEKUSR, pid, addr, data)
|
return ptracePoke(PTRACE_POKEUSR, PTRACE_PEEKUSR, pid, addr, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// elfNT_PRSTATUS is a copy of the debug/elf.NT_PRSTATUS constant so
|
||||||
|
// x/sys/unix doesn't need to depend on debug/elf and thus
|
||||||
|
// compress/zlib, debug/dwarf, and other packages.
|
||||||
|
const elfNT_PRSTATUS = 1
|
||||||
|
|
||||||
func PtraceGetRegs(pid int, regsout *PtraceRegs) (err error) {
|
func PtraceGetRegs(pid int, regsout *PtraceRegs) (err error) {
|
||||||
var iov Iovec
|
var iov Iovec
|
||||||
iov.Base = (*byte)(unsafe.Pointer(regsout))
|
iov.Base = (*byte)(unsafe.Pointer(regsout))
|
||||||
iov.SetLen(int(unsafe.Sizeof(*regsout)))
|
iov.SetLen(int(unsafe.Sizeof(*regsout)))
|
||||||
return ptracePtr(PTRACE_GETREGSET, pid, uintptr(elf.NT_PRSTATUS), unsafe.Pointer(&iov))
|
return ptracePtr(PTRACE_GETREGSET, pid, uintptr(elfNT_PRSTATUS), unsafe.Pointer(&iov))
|
||||||
}
|
}
|
||||||
|
|
||||||
func PtraceSetRegs(pid int, regs *PtraceRegs) (err error) {
|
func PtraceSetRegs(pid int, regs *PtraceRegs) (err error) {
|
||||||
var iov Iovec
|
var iov Iovec
|
||||||
iov.Base = (*byte)(unsafe.Pointer(regs))
|
iov.Base = (*byte)(unsafe.Pointer(regs))
|
||||||
iov.SetLen(int(unsafe.Sizeof(*regs)))
|
iov.SetLen(int(unsafe.Sizeof(*regs)))
|
||||||
return ptracePtr(PTRACE_SETREGSET, pid, uintptr(elf.NT_PRSTATUS), unsafe.Pointer(&iov))
|
return ptracePtr(PTRACE_SETREGSET, pid, uintptr(elfNT_PRSTATUS), unsafe.Pointer(&iov))
|
||||||
}
|
}
|
||||||
|
|
||||||
func PtraceSetOptions(pid int, options int) (err error) {
|
func PtraceSetOptions(pid int, options int) (err error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user