1
2
3
4
5
6
7 package unix
8
9 import "unsafe"
10
11
12 type PtraceRegsArm struct {
13 Uregs [18]uint32
14 }
15
16
17 func PtraceGetRegsArm(pid int, regsout *PtraceRegsArm) error {
18 return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
19 }
20
21
22 func PtraceSetRegsArm(pid int, regs *PtraceRegsArm) error {
23 return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
24 }
25
26
27 type PtraceRegsArm64 struct {
28 Regs [31]uint64
29 Sp uint64
30 Pc uint64
31 Pstate uint64
32 }
33
34
35 func PtraceGetRegsArm64(pid int, regsout *PtraceRegsArm64) error {
36 return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
37 }
38
39
40 func PtraceSetRegsArm64(pid int, regs *PtraceRegsArm64) error {
41 return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
42 }
43
View as plain text