zptrace_armnn_linux.go 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Code generated by linux/mkall.go generatePtracePair("arm", "arm64"). DO NOT EDIT.
  2. //go:build linux && (arm || arm64)
  3. // +build linux
  4. // +build arm arm64
  5. package unix
  6. import "unsafe"
  7. // PtraceRegsArm is the registers used by arm binaries.
  8. type PtraceRegsArm struct {
  9. Uregs [18]uint32
  10. }
  11. // PtraceGetRegsArm fetches the registers used by arm binaries.
  12. func PtraceGetRegsArm(pid int, regsout *PtraceRegsArm) error {
  13. return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
  14. }
  15. // PtraceSetRegsArm sets the registers used by arm binaries.
  16. func PtraceSetRegsArm(pid int, regs *PtraceRegsArm) error {
  17. return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
  18. }
  19. // PtraceRegsArm64 is the registers used by arm64 binaries.
  20. type PtraceRegsArm64 struct {
  21. Regs [31]uint64
  22. Sp uint64
  23. Pc uint64
  24. Pstate uint64
  25. }
  26. // PtraceGetRegsArm64 fetches the registers used by arm64 binaries.
  27. func PtraceGetRegsArm64(pid int, regsout *PtraceRegsArm64) error {
  28. return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
  29. }
  30. // PtraceSetRegsArm64 sets the registers used by arm64 binaries.
  31. func PtraceSetRegsArm64(pid int, regs *PtraceRegsArm64) error {
  32. return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
  33. }