ptrace.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. /* `ptrace' debugger support interface. Linux/AArch64 version.
  2. Copyright (C) 1996-2026 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. /* Avoid collision if the linux ptrace header is already included. */
  21. #undef PTRACE_TRACEME
  22. #undef PTRACE_PEEKTEXT
  23. #undef PTRACE_PEEKDATA
  24. #undef PTRACE_PEEKUSER
  25. #undef PTRACE_POKETEXT
  26. #undef PTRACE_POKEDATA
  27. #undef PTRACE_POKEUSER
  28. #undef PTRACE_CONT
  29. #undef PTRACE_KILL
  30. #undef PTRACE_SINGLESTEP
  31. #undef PTRACE_ATTACH
  32. #undef PTRACE_DETACH
  33. #undef PTRACE_SYSCALL
  34. #undef PTRACE_SYSEMU
  35. #undef PTRACE_SYSEMU_SINGLESTEP
  36. #undef PTRACE_PEEKMTETAGS
  37. #undef PTRACE_POKEMTETAGS
  38. #undef PTRACE_SETOPTIONS
  39. #undef PTRACE_GETEVENTMSG
  40. #undef PTRACE_GETSIGINFO
  41. #undef PTRACE_SETSIGINFO
  42. #undef PTRACE_GETREGSET
  43. #undef PTRACE_SETREGSET
  44. #undef PTRACE_SEIZE
  45. #undef PTRACE_INTERRUPT
  46. #undef PTRACE_LISTEN
  47. #undef PTRACE_PEEKSIGINFO
  48. #undef PTRACE_GETSIGMASK
  49. #undef PTRACE_SETSIGMASK
  50. #undef PTRACE_SECCOMP_GET_FILTER
  51. #undef PTRACE_SECCOMP_GET_METADATA
  52. #undef PTRACE_GET_SYSCALL_INFO
  53. #undef PTRACE_GET_RSEQ_CONFIGURATION
  54. #undef PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG
  55. #undef PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG
  56. /* Type of the REQUEST argument to `ptrace.' */
  57. enum __ptrace_request
  58. {
  59. /* Indicate that the process making this request should be traced.
  60. All signals received by this process can be intercepted by its
  61. parent, and its parent can use the other `ptrace' requests. */
  62. PTRACE_TRACEME = 0,
  63. #define PT_TRACE_ME PTRACE_TRACEME
  64. /* Return the word in the process's text space at address ADDR. */
  65. PTRACE_PEEKTEXT = 1,
  66. #define PT_READ_I PTRACE_PEEKTEXT
  67. /* Return the word in the process's data space at address ADDR. */
  68. PTRACE_PEEKDATA = 2,
  69. #define PT_READ_D PTRACE_PEEKDATA
  70. /* Return the word in the process's user area at offset ADDR. */
  71. PTRACE_PEEKUSER = 3,
  72. #define PT_READ_U PTRACE_PEEKUSER
  73. /* Write the word DATA into the process's text space at address ADDR. */
  74. PTRACE_POKETEXT = 4,
  75. #define PT_WRITE_I PTRACE_POKETEXT
  76. /* Write the word DATA into the process's data space at address ADDR. */
  77. PTRACE_POKEDATA = 5,
  78. #define PT_WRITE_D PTRACE_POKEDATA
  79. /* Write the word DATA into the process's user area at offset ADDR. */
  80. PTRACE_POKEUSER = 6,
  81. #define PT_WRITE_U PTRACE_POKEUSER
  82. /* Continue the process. */
  83. PTRACE_CONT = 7,
  84. #define PT_CONTINUE PTRACE_CONT
  85. /* Kill the process. */
  86. PTRACE_KILL = 8,
  87. #define PT_KILL PTRACE_KILL
  88. /* Single step the process. */
  89. PTRACE_SINGLESTEP = 9,
  90. #define PT_STEP PTRACE_SINGLESTEP
  91. /* Attach to a process that is already running. */
  92. PTRACE_ATTACH = 16,
  93. #define PT_ATTACH PTRACE_ATTACH
  94. /* Detach from a process attached to with PTRACE_ATTACH. */
  95. PTRACE_DETACH = 17,
  96. #define PT_DETACH PTRACE_DETACH
  97. /* Continue and stop at the next entry to or return from syscall. */
  98. PTRACE_SYSCALL = 24,
  99. #define PT_SYSCALL PTRACE_SYSCALL
  100. /* Continue and stop at the next syscall, it will not be executed. */
  101. PTRACE_SYSEMU = 31,
  102. #define PT_SYSEMU PTRACE_SYSEMU
  103. /* Single step the process, the next syscall will not be executed. */
  104. PTRACE_SYSEMU_SINGLESTEP = 32,
  105. #define PT_SYSEMU_SINGLESTEP PTRACE_SYSEMU_SINGLESTEP
  106. /* Read MTE tags. */
  107. PTRACE_PEEKMTETAGS = 33,
  108. #define PT_PEEKMTETAGS PTRACE_PEEKMTETAGS
  109. /* Write MTE tags. */
  110. PTRACE_POKEMTETAGS = 34,
  111. #define PT_POKEMTETAGS PTRACE_POKEMTETAGS
  112. /* Set ptrace filter options. */
  113. PTRACE_SETOPTIONS = 0x4200,
  114. #define PT_SETOPTIONS PTRACE_SETOPTIONS
  115. /* Get last ptrace message. */
  116. PTRACE_GETEVENTMSG = 0x4201,
  117. #define PT_GETEVENTMSG PTRACE_GETEVENTMSG
  118. /* Get siginfo for process. */
  119. PTRACE_GETSIGINFO = 0x4202,
  120. #define PT_GETSIGINFO PTRACE_GETSIGINFO
  121. /* Set new siginfo for process. */
  122. PTRACE_SETSIGINFO = 0x4203,
  123. #define PT_SETSIGINFO PTRACE_SETSIGINFO
  124. /* Get register content. */
  125. PTRACE_GETREGSET = 0x4204,
  126. #define PTRACE_GETREGSET PTRACE_GETREGSET
  127. /* Set register content. */
  128. PTRACE_SETREGSET = 0x4205,
  129. #define PTRACE_SETREGSET PTRACE_SETREGSET
  130. /* Like PTRACE_ATTACH, but do not force tracee to trap and do not affect
  131. signal or group stop state. */
  132. PTRACE_SEIZE = 0x4206,
  133. #define PTRACE_SEIZE PTRACE_SEIZE
  134. /* Trap seized tracee. */
  135. PTRACE_INTERRUPT = 0x4207,
  136. #define PTRACE_INTERRUPT PTRACE_INTERRUPT
  137. /* Wait for next group event. */
  138. PTRACE_LISTEN = 0x4208,
  139. #define PTRACE_LISTEN PTRACE_LISTEN
  140. /* Retrieve siginfo_t structures without removing signals from a queue. */
  141. PTRACE_PEEKSIGINFO = 0x4209,
  142. #define PTRACE_PEEKSIGINFO PTRACE_PEEKSIGINFO
  143. /* Get the mask of blocked signals. */
  144. PTRACE_GETSIGMASK = 0x420a,
  145. #define PTRACE_GETSIGMASK PTRACE_GETSIGMASK
  146. /* Change the mask of blocked signals. */
  147. PTRACE_SETSIGMASK = 0x420b,
  148. #define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
  149. /* Get seccomp BPF filters. */
  150. PTRACE_SECCOMP_GET_FILTER = 0x420c,
  151. #define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
  152. /* Get seccomp BPF filter metadata. */
  153. PTRACE_SECCOMP_GET_METADATA = 0x420d,
  154. #define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA
  155. /* Get information about system call. */
  156. PTRACE_GET_SYSCALL_INFO = 0x420e,
  157. #define PTRACE_GET_SYSCALL_INFO PTRACE_GET_SYSCALL_INFO
  158. /* Get rseq configuration information. */
  159. PTRACE_GET_RSEQ_CONFIGURATION = 0x420f,
  160. #define PTRACE_GET_RSEQ_CONFIGURATION PTRACE_GET_RSEQ_CONFIGURATION
  161. /* Set configuration for syscall user dispatch. */
  162. PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG = 0x4210,
  163. #define PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG \
  164. PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG
  165. /* Get configuration for syscall user dispatch. */
  166. PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG = 0x4211
  167. #define PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG \
  168. PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG
  169. };
  170. #include <bits/ptrace-shared.h>
  171. __END_DECLS
  172. #endif /* _SYS_PTRACE_H */