1  /* `ptrace' debugger support interface.  Linux/AArch64 version.
       2     Copyright (C) 1996-2023 Free Software Foundation, Inc.
       3  
       4     This file is part of the GNU C Library.
       5  
       6     The GNU C Library is free software; you can redistribute it and/or
       7     modify it under the terms of the GNU Lesser General Public
       8     License as published by the Free Software Foundation; either
       9     version 2.1 of the License, or (at your option) any later version.
      10  
      11     The GNU C Library is distributed in the hope that it will be useful,
      12     but WITHOUT ANY WARRANTY; without even the implied warranty of
      13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      14     Lesser General Public License for more details.
      15  
      16     You should have received a copy of the GNU Lesser General Public
      17     License along with the GNU C Library; if not, see
      18     <https://www.gnu.org/licenses/>.  */
      19  
      20  #ifndef _SYS_PTRACE_H
      21  #define _SYS_PTRACE_H	1
      22  
      23  #include <features.h>
      24  #include <bits/types.h>
      25  
      26  __BEGIN_DECLS
      27  
      28  /* Avoid collision if the linux ptrace header is already included.  */
      29  #undef PTRACE_TRACEME
      30  #undef PTRACE_PEEKTEXT
      31  #undef PTRACE_PEEKDATA
      32  #undef PTRACE_PEEKUSER
      33  #undef PTRACE_POKETEXT
      34  #undef PTRACE_POKEDATA
      35  #undef PTRACE_POKEUSER
      36  #undef PTRACE_CONT
      37  #undef PTRACE_KILL
      38  #undef PTRACE_SINGLESTEP
      39  #undef PTRACE_ATTACH
      40  #undef PTRACE_DETACH
      41  #undef PTRACE_SYSCALL
      42  #undef PTRACE_SYSEMU
      43  #undef PTRACE_SYSEMU_SINGLESTEP
      44  #undef PTRACE_PEEKMTETAGS
      45  #undef PTRACE_POKEMTETAGS
      46  #undef PTRACE_SETOPTIONS
      47  #undef PTRACE_GETEVENTMSG
      48  #undef PTRACE_GETSIGINFO
      49  #undef PTRACE_SETSIGINFO
      50  #undef PTRACE_GETREGSET
      51  #undef PTRACE_SETREGSET
      52  #undef PTRACE_SEIZE
      53  #undef PTRACE_INTERRUPT
      54  #undef PTRACE_LISTEN
      55  #undef PTRACE_PEEKSIGINFO
      56  #undef PTRACE_GETSIGMASK
      57  #undef PTRACE_SETSIGMASK
      58  #undef PTRACE_SECCOMP_GET_FILTER
      59  #undef PTRACE_SECCOMP_GET_METADATA
      60  #undef PTRACE_GET_SYSCALL_INFO
      61  #undef PTRACE_GET_RSEQ_CONFIGURATION
      62  
      63  /* Type of the REQUEST argument to `ptrace.'  */
      64  enum __ptrace_request
      65  {
      66    /* Indicate that the process making this request should be traced.
      67       All signals received by this process can be intercepted by its
      68       parent, and its parent can use the other `ptrace' requests.  */
      69    PTRACE_TRACEME = 0,
      70  #define PT_TRACE_ME PTRACE_TRACEME
      71  
      72    /* Return the word in the process's text space at address ADDR.  */
      73    PTRACE_PEEKTEXT = 1,
      74  #define PT_READ_I PTRACE_PEEKTEXT
      75  
      76    /* Return the word in the process's data space at address ADDR.  */
      77    PTRACE_PEEKDATA = 2,
      78  #define PT_READ_D PTRACE_PEEKDATA
      79  
      80    /* Return the word in the process's user area at offset ADDR.  */
      81    PTRACE_PEEKUSER = 3,
      82  #define PT_READ_U PTRACE_PEEKUSER
      83  
      84    /* Write the word DATA into the process's text space at address ADDR.  */
      85    PTRACE_POKETEXT = 4,
      86  #define PT_WRITE_I PTRACE_POKETEXT
      87  
      88    /* Write the word DATA into the process's data space at address ADDR.  */
      89    PTRACE_POKEDATA = 5,
      90  #define PT_WRITE_D PTRACE_POKEDATA
      91  
      92    /* Write the word DATA into the process's user area at offset ADDR.  */
      93    PTRACE_POKEUSER = 6,
      94  #define PT_WRITE_U PTRACE_POKEUSER
      95  
      96    /* Continue the process.  */
      97    PTRACE_CONT = 7,
      98  #define PT_CONTINUE PTRACE_CONT
      99  
     100    /* Kill the process.  */
     101    PTRACE_KILL = 8,
     102  #define PT_KILL PTRACE_KILL
     103  
     104    /* Single step the process.  */
     105    PTRACE_SINGLESTEP = 9,
     106  #define PT_STEP PTRACE_SINGLESTEP
     107  
     108    /* Attach to a process that is already running. */
     109    PTRACE_ATTACH = 16,
     110  #define PT_ATTACH PTRACE_ATTACH
     111  
     112    /* Detach from a process attached to with PTRACE_ATTACH.  */
     113    PTRACE_DETACH = 17,
     114  #define PT_DETACH PTRACE_DETACH
     115  
     116    /* Continue and stop at the next entry to or return from syscall.  */
     117    PTRACE_SYSCALL = 24,
     118  #define PT_SYSCALL PTRACE_SYSCALL
     119  
     120    /* Continue and stop at the next syscall, it will not be executed.  */
     121    PTRACE_SYSEMU = 31,
     122  #define PT_SYSEMU PTRACE_SYSEMU
     123  
     124    /* Single step the process, the next syscall will not be executed.  */
     125    PTRACE_SYSEMU_SINGLESTEP = 32,
     126  #define PT_SYSEMU_SINGLESTEP PTRACE_SYSEMU_SINGLESTEP
     127  
     128    /* Read MTE tags.  */
     129    PTRACE_PEEKMTETAGS = 33,
     130  #define PT_PEEKMTETAGS PTRACE_PEEKMTETAGS
     131  
     132    /* Write MTE tags.  */
     133    PTRACE_POKEMTETAGS = 34,
     134  #define PT_POKEMTETAGS PTRACE_POKEMTETAGS
     135  
     136    /* Set ptrace filter options.  */
     137    PTRACE_SETOPTIONS = 0x4200,
     138  #define PT_SETOPTIONS PTRACE_SETOPTIONS
     139  
     140    /* Get last ptrace message.  */
     141    PTRACE_GETEVENTMSG = 0x4201,
     142  #define PT_GETEVENTMSG PTRACE_GETEVENTMSG
     143  
     144    /* Get siginfo for process.  */
     145    PTRACE_GETSIGINFO = 0x4202,
     146  #define PT_GETSIGINFO PTRACE_GETSIGINFO
     147  
     148    /* Set new siginfo for process.  */
     149    PTRACE_SETSIGINFO = 0x4203,
     150  #define PT_SETSIGINFO PTRACE_SETSIGINFO
     151  
     152    /* Get register content.  */
     153    PTRACE_GETREGSET = 0x4204,
     154  #define PTRACE_GETREGSET PTRACE_GETREGSET
     155  
     156    /* Set register content.  */
     157    PTRACE_SETREGSET = 0x4205,
     158  #define PTRACE_SETREGSET PTRACE_SETREGSET
     159  
     160    /* Like PTRACE_ATTACH, but do not force tracee to trap and do not affect
     161       signal or group stop state.  */
     162    PTRACE_SEIZE = 0x4206,
     163  #define PTRACE_SEIZE PTRACE_SEIZE
     164  
     165    /* Trap seized tracee.  */
     166    PTRACE_INTERRUPT = 0x4207,
     167  #define PTRACE_INTERRUPT PTRACE_INTERRUPT
     168  
     169    /* Wait for next group event.  */
     170    PTRACE_LISTEN = 0x4208,
     171  #define PTRACE_LISTEN PTRACE_LISTEN
     172  
     173    /* Retrieve siginfo_t structures without removing signals from a queue.  */
     174    PTRACE_PEEKSIGINFO = 0x4209,
     175  #define PTRACE_PEEKSIGINFO PTRACE_PEEKSIGINFO
     176  
     177    /* Get the mask of blocked signals.  */
     178    PTRACE_GETSIGMASK = 0x420a,
     179  #define PTRACE_GETSIGMASK PTRACE_GETSIGMASK
     180  
     181    /* Change the mask of blocked signals.  */
     182    PTRACE_SETSIGMASK = 0x420b,
     183  #define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
     184  
     185    /* Get seccomp BPF filters.  */
     186    PTRACE_SECCOMP_GET_FILTER = 0x420c,
     187  #define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
     188  
     189    /* Get seccomp BPF filter metadata.  */
     190    PTRACE_SECCOMP_GET_METADATA = 0x420d,
     191  #define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA
     192  
     193    /* Get information about system call.  */
     194    PTRACE_GET_SYSCALL_INFO = 0x420e,
     195  #define PTRACE_GET_SYSCALL_INFO PTRACE_GET_SYSCALL_INFO
     196  
     197    /* Get rseq configuration information.  */
     198    PTRACE_GET_RSEQ_CONFIGURATION = 0x420f
     199  #define PTRACE_GET_RSEQ_CONFIGURATION PTRACE_GET_RSEQ_CONFIGURATION
     200  };
     201  
     202  
     203  #include <bits/ptrace-shared.h>
     204  
     205  __END_DECLS
     206  
     207  #endif /* _SYS_PTRACE_H */