1 | //===-- Ptrace.h ------------------------------------------------*- C++ -*-===// |
2 | // |
3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | // See https://llvm.org/LICENSE.txt for license information. |
5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | // This file defines ptrace functions & structures |
10 | |
11 | #ifndef liblldb_Host_linux_Ptrace_h_ |
12 | #define liblldb_Host_linux_Ptrace_h_ |
13 | |
14 | #include <sys/ptrace.h> |
15 | |
16 | #ifndef __GLIBC__ |
17 | typedef int __ptrace_request; |
18 | #endif |
19 | |
20 | #define DEBUG_PTRACE_MAXBYTES 20 |
21 | |
22 | // Support ptrace extensions even when compiled without required kernel support |
23 | #ifndef PTRACE_GETREGS |
24 | #define PTRACE_GETREGS 12 |
25 | #endif |
26 | #ifndef PTRACE_SETREGS |
27 | #define PTRACE_SETREGS 13 |
28 | #endif |
29 | #ifndef PTRACE_GETFPREGS |
30 | #define PTRACE_GETFPREGS 14 |
31 | #endif |
32 | #ifndef PTRACE_SETFPREGS |
33 | #define PTRACE_SETFPREGS 15 |
34 | #endif |
35 | #ifndef PTRACE_GETREGSET |
36 | #define PTRACE_GETREGSET 0x4204 |
37 | #endif |
38 | #ifndef PTRACE_SETREGSET |
39 | #define PTRACE_SETREGSET 0x4205 |
40 | #endif |
41 | #ifndef PTRACE_GET_THREAD_AREA |
42 | #define PTRACE_GET_THREAD_AREA 25 |
43 | #endif |
44 | #ifndef PTRACE_ARCH_PRCTL |
45 | #define PTRACE_ARCH_PRCTL 30 |
46 | #endif |
47 | #ifndef ARCH_GET_FS |
48 | #define ARCH_SET_GS 0x1001 |
49 | #define ARCH_SET_FS 0x1002 |
50 | #define ARCH_GET_FS 0x1003 |
51 | #define ARCH_GET_GS 0x1004 |
52 | #endif |
53 | #ifndef PTRACE_PEEKMTETAGS |
54 | #define PTRACE_PEEKMTETAGS 33 |
55 | #endif |
56 | #ifndef PTRACE_POKEMTETAGS |
57 | #define PTRACE_POKEMTETAGS 34 |
58 | #endif |
59 | |
60 | #endif // liblldb_Host_linux_Ptrace_h_ |
61 | |