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