ptrace.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #ifndef _SYS_PTRACE_H
  2. #define _SYS_PTRACE_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #define PTRACE_TRACEME 0
  7. #define PT_TRACE_ME PTRACE_TRACEME
  8. #define PTRACE_PEEKTEXT 1
  9. #define PTRACE_PEEKDATA 2
  10. #define PTRACE_PEEKUSER 3
  11. #define PTRACE_POKETEXT 4
  12. #define PTRACE_POKEDATA 5
  13. #define PTRACE_POKEUSER 6
  14. #define PTRACE_CONT 7
  15. #define PTRACE_KILL 8
  16. #define PTRACE_SINGLESTEP 9
  17. #define PTRACE_GETREGS 12
  18. #define PTRACE_SETREGS 13
  19. #define PTRACE_GETFPREGS 14
  20. #define PTRACE_SETFPREGS 15
  21. #define PTRACE_ATTACH 16
  22. #define PTRACE_DETACH 17
  23. #define PTRACE_GETFPXREGS 18
  24. #define PTRACE_SETFPXREGS 19
  25. #define PTRACE_SYSCALL 24
  26. #define PTRACE_SETOPTIONS 0x4200
  27. #define PTRACE_GETEVENTMSG 0x4201
  28. #define PTRACE_GETSIGINFO 0x4202
  29. #define PTRACE_SETSIGINFO 0x4203
  30. #define PT_READ_I PTRACE_PEEKTEXT
  31. #define PT_READ_D PTRACE_PEEKDATA
  32. #define PT_READ_U PTRACE_PEEKUSER
  33. #define PT_WRITE_I PTRACE_POKETEXT
  34. #define PT_WRITE_D PTRACE_POKEDATA
  35. #define PT_WRITE_U PTRACE_POKEUSER
  36. #define PT_CONTINUE PTRACE_CONT
  37. #define PT_KILL PTRACE_KILL
  38. #define PT_STEP PTRACE_SINGLESTEP
  39. #define PT_GETREGS PTRACE_GETREGS
  40. #define PT_SETREGS PTRACE_SETREGS
  41. #define PT_GETFPREGS PTRACE_GETFPREGS
  42. #define PT_SETFPREGS PTRACE_SETFPREGS
  43. #define PT_ATTACH PTRACE_ATTACH
  44. #define PT_DETACH PTRACE_DETACH
  45. #define PT_GETFPXREGS PTRACE_GETFPXREGS
  46. #define PT_SETFPXREGS PTRACE_SETFPXREGS
  47. #define PT_SYSCALL PTRACE_SYSCALL
  48. #define PT_SETOPTIONS PTRACE_SETOPTIONS
  49. #define PT_GETEVENTMSG PTRACE_GETEVENTMSG
  50. #define PT_GETSIGINFO PTRACE_GETSIGINFO
  51. #define PT_SETSIGINFO PTRACE_SETSIGINFO
  52. #define PTRACE_O_TRACESYSGOOD 0x00000001
  53. #define PTRACE_O_TRACEFORK 0x00000002
  54. #define PTRACE_O_TRACEVFORK 0x00000004
  55. #define PTRACE_O_TRACECLONE 0x00000008
  56. #define PTRACE_O_TRACEEXEC 0x00000010
  57. #define PTRACE_O_TRACEVFORKDONE 0x00000020
  58. #define PTRACE_O_TRACEEXIT 0x00000040
  59. #define PTRACE_O_MASK 0x0000007f
  60. #define PTRACE_EVENT_FORK 1
  61. #define PTRACE_EVENT_VFORK 2
  62. #define PTRACE_EVENT_CLONE 3
  63. #define PTRACE_EVENT_EXEC 4
  64. #define PTRACE_EVENT_VFORK_DONE 5
  65. #define PTRACE_EVENT_EXIT 6
  66. long int ptrace(int, ...);
  67. #ifdef __cplusplus
  68. }
  69. #endif
  70. #endif