mirror of
https://github.com/go-delve/delve.git
synced 2025-11-01 12:01:35 +08:00
migrate to go.sys subrepository
As of go version 1.4 the standard library syscall package is "locked down" and code outside of the standard library is recommended to migrate to the go.sys subrepository. Reference: https://golang.org/s/go1.4-syscall
This commit is contained in:
committed by
Hashrocket Workstation
parent
0d08380555
commit
58de1f7c85
@ -1,9 +1,9 @@
|
||||
package proctl
|
||||
|
||||
import "syscall"
|
||||
import sys "golang.org/x/sys/unix"
|
||||
|
||||
type Regs struct {
|
||||
regs *syscall.PtraceRegs
|
||||
regs *sys.PtraceRegs
|
||||
}
|
||||
|
||||
func (r *Regs) PC() uint64 {
|
||||
@ -16,12 +16,12 @@ func (r *Regs) SP() uint64 {
|
||||
|
||||
func (r *Regs) SetPC(tid int, pc uint64) error {
|
||||
r.regs.SetPC(pc)
|
||||
return syscall.PtraceSetRegs(tid, r.regs)
|
||||
return sys.PtraceSetRegs(tid, r.regs)
|
||||
}
|
||||
|
||||
func registers(tid int) (Registers, error) {
|
||||
var regs syscall.PtraceRegs
|
||||
err := syscall.PtraceGetRegs(tid, ®s)
|
||||
var regs sys.PtraceRegs
|
||||
err := sys.PtraceGetRegs(tid, ®s)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -29,11 +29,11 @@ func registers(tid int) (Registers, error) {
|
||||
}
|
||||
|
||||
func writeMemory(tid int, addr uintptr, data []byte) (int, error) {
|
||||
return syscall.PtracePokeData(tid, addr, data)
|
||||
return sys.PtracePokeData(tid, addr, data)
|
||||
}
|
||||
|
||||
func readMemory(tid int, addr uintptr, data []byte) (int, error) {
|
||||
return syscall.PtracePeekData(tid, addr, data)
|
||||
return sys.PtracePeekData(tid, addr, data)
|
||||
}
|
||||
|
||||
func clearHardwareBreakpoint(reg, tid int) error {
|
||||
|
||||
Reference in New Issue
Block a user