本站源代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
1.8KB

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