zptrace_x86_linux.go 1.9 KB

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