ptrace.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. /* `ptrace' debugger support interface. Linux/AArch64 version.
  2. Copyright (C) 1996-2021 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, see
  14. <https://www.gnu.org/licenses/>. */
  15. #ifndef _SYS_PTRACE_H
  16. #define _SYS_PTRACE_H 1
  17. #include <features.h>
  18. #include <bits/types.h>
  19. __BEGIN_DECLS
  20. /* Type of the REQUEST argument to `ptrace.' */
  21. enum __ptrace_request
  22. {
  23. /* Indicate that the process making this request should be traced.
  24. All signals received by this process can be intercepted by its
  25. parent, and its parent can use the other `ptrace' requests. */
  26. PTRACE_TRACEME = 0,
  27. #define PT_TRACE_ME PTRACE_TRACEME
  28. /* Return the word in the process's text space at address ADDR. */
  29. PTRACE_PEEKTEXT = 1,
  30. #define PT_READ_I PTRACE_PEEKTEXT
  31. /* Return the word in the process's data space at address ADDR. */
  32. PTRACE_PEEKDATA = 2,
  33. #define PT_READ_D PTRACE_PEEKDATA
  34. /* Return the word in the process's user area at offset ADDR. */
  35. PTRACE_PEEKUSER = 3,
  36. #define PT_READ_U PTRACE_PEEKUSER
  37. /* Write the word DATA into the process's text space at address ADDR. */
  38. PTRACE_POKETEXT = 4,
  39. #define PT_WRITE_I PTRACE_POKETEXT
  40. /* Write the word DATA into the process's data space at address ADDR. */
  41. PTRACE_POKEDATA = 5,
  42. #define PT_WRITE_D PTRACE_POKEDATA
  43. /* Write the word DATA into the process's user area at offset ADDR. */
  44. PTRACE_POKEUSER = 6,
  45. #define PT_WRITE_U PTRACE_POKEUSER
  46. /* Continue the process. */
  47. PTRACE_CONT = 7,
  48. #define PT_CONTINUE PTRACE_CONT
  49. /* Kill the process. */
  50. PTRACE_KILL = 8,
  51. #define PT_KILL PTRACE_KILL
  52. /* Single step the process. */
  53. PTRACE_SINGLESTEP = 9,
  54. #define PT_STEP PTRACE_SINGLESTEP
  55. /* Attach to a process that is already running. */
  56. PTRACE_ATTACH = 16,
  57. #define PT_ATTACH PTRACE_ATTACH
  58. /* Detach from a process attached to with PTRACE_ATTACH. */
  59. PTRACE_DETACH = 17,
  60. #define PT_DETACH PTRACE_DETACH
  61. /* Continue and stop at the next entry to or return from syscall. */
  62. PTRACE_SYSCALL = 24,
  63. #define PT_SYSCALL PTRACE_SYSCALL
  64. /* Set ptrace filter options. */
  65. PTRACE_SETOPTIONS = 0x4200,
  66. #define PT_SETOPTIONS PTRACE_SETOPTIONS
  67. /* Get last ptrace message. */
  68. PTRACE_GETEVENTMSG = 0x4201,
  69. #define PT_GETEVENTMSG PTRACE_GETEVENTMSG
  70. /* Get siginfo for process. */
  71. PTRACE_GETSIGINFO = 0x4202,
  72. #define PT_GETSIGINFO PTRACE_GETSIGINFO
  73. /* Set new siginfo for process. */
  74. PTRACE_SETSIGINFO = 0x4203,
  75. #define PT_SETSIGINFO PTRACE_SETSIGINFO
  76. /* Get register content. */
  77. PTRACE_GETREGSET = 0x4204,
  78. #define PTRACE_GETREGSET PTRACE_GETREGSET
  79. /* Set register content. */
  80. PTRACE_SETREGSET = 0x4205,
  81. #define PTRACE_SETREGSET PTRACE_SETREGSET
  82. /* Like PTRACE_ATTACH, but do not force tracee to trap and do not affect
  83. signal or group stop state. */
  84. PTRACE_SEIZE = 0x4206,
  85. #define PTRACE_SEIZE PTRACE_SEIZE
  86. /* Trap seized tracee. */
  87. PTRACE_INTERRUPT = 0x4207,
  88. #define PTRACE_INTERRUPT PTRACE_INTERRUPT
  89. /* Wait for next group event. */
  90. PTRACE_LISTEN = 0x4208,
  91. #define PTRACE_LISTEN PTRACE_LISTEN
  92. /* Retrieve siginfo_t structures without removing signals from a queue. */
  93. PTRACE_PEEKSIGINFO = 0x4209,
  94. #define PTRACE_PEEKSIGINFO PTRACE_PEEKSIGINFO
  95. /* Get the mask of blocked signals. */
  96. PTRACE_GETSIGMASK = 0x420a,
  97. #define PTRACE_GETSIGMASK PTRACE_GETSIGMASK
  98. /* Change the mask of blocked signals. */
  99. PTRACE_SETSIGMASK = 0x420b,
  100. #define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
  101. /* Get seccomp BPF filters. */
  102. PTRACE_SECCOMP_GET_FILTER = 0x420c,
  103. #define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
  104. /* Get seccomp BPF filter metadata. */
  105. PTRACE_SECCOMP_GET_METADATA = 0x420d,
  106. #define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA
  107. /* Get information about system call. */
  108. PTRACE_GET_SYSCALL_INFO = 0x420e
  109. #define PTRACE_GET_SYSCALL_INFO PTRACE_GET_SYSCALL_INFO
  110. };
  111. #include <bits/ptrace-shared.h>
  112. __END_DECLS
  113. #endif /* _SYS_PTRACE_H */