1 #ifndef _UAPI_LINUX_PTRACE_H
2 #define _UAPI_LINUX_PTRACE_H
4 /* structs and defines to help the user use the ptrace system call. */
6 /* has the defines to get at the registers. */
9 #define PTRACE_TRACEME 0
10 #define PTRACE_PEEKTEXT 1
11 #define PTRACE_PEEKDATA 2
12 #define PTRACE_PEEKUSR 3
13 #define PTRACE_POKETEXT 4
14 #define PTRACE_POKEDATA 5
15 #define PTRACE_POKEUSR 6
18 #define PTRACE_SINGLESTEP 9
20 #define PTRACE_ATTACH 16
21 #define PTRACE_DETACH 17
23 #define PTRACE_SYSCALL 24
25 /* 0x4200-0x4300 are reserved for architecture-independent additions. */
26 #define PTRACE_SETOPTIONS 0x4200
27 #define PTRACE_GETEVENTMSG 0x4201
28 #define PTRACE_GETSIGINFO 0x4202
29 #define PTRACE_SETSIGINFO 0x4203
32 * Generic ptrace interface that exports the architecture specific regsets
33 * using the corresponding NT_* types (which are also used in the core dump).
34 * Please note that the NT_PRSTATUS note type in a core dump contains a full
35 * 'struct elf_prstatus'. But the user_regset for NT_PRSTATUS contains just the
36 * elf_gregset_t that is the pr_reg field of 'struct elf_prstatus'. For all the
37 * other user_regset flavors, the user_regset layout and the ELF core dump note
38 * payload are exactly the same layout.
40 * This interface usage is as follows:
41 * struct iovec iov = { buf, len};
43 * ret = ptrace(PTRACE_GETREGSET/PTRACE_SETREGSET, pid, NT_XXX_TYPE, &iov);
45 * On the successful completion, iov.len will be updated by the kernel,
46 * specifying how much the kernel has written/read to/from the user's iov.buf.
48 #define PTRACE_GETREGSET 0x4204
49 #define PTRACE_SETREGSET 0x4205
51 #define PTRACE_SEIZE 0x4206
52 #define PTRACE_INTERRUPT 0x4207
53 #define PTRACE_LISTEN 0x4208
55 /* Wait extended result codes for the above trace options. */
56 #define PTRACE_EVENT_FORK 1
57 #define PTRACE_EVENT_VFORK 2
58 #define PTRACE_EVENT_CLONE 3
59 #define PTRACE_EVENT_EXEC 4
60 #define PTRACE_EVENT_VFORK_DONE 5
61 #define PTRACE_EVENT_EXIT 6
62 #define PTRACE_EVENT_SECCOMP 7
63 /* Extended result codes which enabled by means other than options. */
64 #define PTRACE_EVENT_STOP 128
66 /* Options set using PTRACE_SETOPTIONS or using PTRACE_SEIZE @data param */
67 #define PTRACE_O_TRACESYSGOOD 1
68 #define PTRACE_O_TRACEFORK (1 << PTRACE_EVENT_FORK)
69 #define PTRACE_O_TRACEVFORK (1 << PTRACE_EVENT_VFORK)
70 #define PTRACE_O_TRACECLONE (1 << PTRACE_EVENT_CLONE)
71 #define PTRACE_O_TRACEEXEC (1 << PTRACE_EVENT_EXEC)
72 #define PTRACE_O_TRACEVFORKDONE (1 << PTRACE_EVENT_VFORK_DONE)
73 #define PTRACE_O_TRACEEXIT (1 << PTRACE_EVENT_EXIT)
74 #define PTRACE_O_TRACESECCOMP (1 << PTRACE_EVENT_SECCOMP)
76 #define PTRACE_O_MASK 0x000000ff
78 #include <asm/ptrace.h>
81 #endif /* _UAPI_LINUX_PTRACE_H */