1
2
3
4
5
6
7 package unix
8
9 import "unsafe"
10
11
12 type PtraceRegsMips struct {
13 Regs [32]uint64
14 Lo uint64
15 Hi uint64
16 Epc uint64
17 Badvaddr uint64
18 Status uint64
19 Cause uint64
20 }
21
22
23 func PtraceGetRegsMips(pid int, regsout *PtraceRegsMips) error {
24 return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
25 }
26
27
28 func PtraceSetRegsMips(pid int, regs *PtraceRegsMips) error {
29 return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
30 }
31
32
33 type PtraceRegsMips64 struct {
34 Regs [32]uint64
35 Lo uint64
36 Hi uint64
37 Epc uint64
38 Badvaddr uint64
39 Status uint64
40 Cause uint64
41 }
42
43
44 func PtraceGetRegsMips64(pid int, regsout *PtraceRegsMips64) error {
45 return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
46 }
47
48
49 func PtraceSetRegsMips64(pid int, regs *PtraceRegsMips64) error {
50 return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
51 }
52
View as plain text