blob: 7d65857004c447cc13b0fc4c97247c81a525beb2 [file] [log] [blame]
Andrea Campanella3614a922021-02-25 12:40:42 +01001// Code generated by linux/mkall.go generatePtracePair("386", "amd64"). DO NOT EDIT.
khenaidooac637102019-01-14 15:44:34 -05002
khenaidood948f772021-08-11 17:49:24 -04003//go:build linux && (386 || amd64)
khenaidooac637102019-01-14 15:44:34 -05004// +build linux
5// +build 386 amd64
6
7package unix
8
9import "unsafe"
10
11// PtraceRegs386 is the registers used by 386 binaries.
12type PtraceRegs386 struct {
13 Ebx int32
14 Ecx int32
15 Edx int32
16 Esi int32
17 Edi int32
18 Ebp int32
19 Eax int32
20 Xds int32
21 Xes int32
22 Xfs int32
23 Xgs int32
24 Orig_eax int32
25 Eip int32
26 Xcs int32
27 Eflags int32
28 Esp int32
29 Xss int32
30}
31
32// PtraceGetRegs386 fetches the registers used by 386 binaries.
33func PtraceGetRegs386(pid int, regsout *PtraceRegs386) error {
34 return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
35}
36
37// PtraceSetRegs386 sets the registers used by 386 binaries.
38func PtraceSetRegs386(pid int, regs *PtraceRegs386) error {
39 return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
40}
41
42// PtraceRegsAmd64 is the registers used by amd64 binaries.
43type PtraceRegsAmd64 struct {
44 R15 uint64
45 R14 uint64
46 R13 uint64
47 R12 uint64
48 Rbp uint64
49 Rbx uint64
50 R11 uint64
51 R10 uint64
52 R9 uint64
53 R8 uint64
54 Rax uint64
55 Rcx uint64
56 Rdx uint64
57 Rsi uint64
58 Rdi uint64
59 Orig_rax uint64
60 Rip uint64
61 Cs uint64
62 Eflags uint64
63 Rsp uint64
64 Ss uint64
65 Fs_base uint64
66 Gs_base uint64
67 Ds uint64
68 Es uint64
69 Fs uint64
70 Gs uint64
71}
72
73// PtraceGetRegsAmd64 fetches the registers used by amd64 binaries.
74func PtraceGetRegsAmd64(pid int, regsout *PtraceRegsAmd64) error {
75 return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
76}
77
78// PtraceSetRegsAmd64 sets the registers used by amd64 binaries.
79func PtraceSetRegsAmd64(pid int, regs *PtraceRegsAmd64) error {
80 return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
81}