Skip to content

Commit df6d945

Browse files
Szabolcs Nagyrichfelker
Szabolcs Nagy
authored andcommitted
add support for arch-specific ptrace command macros
sys/ptrace.h is target specific, use bits/ptrace.h to add target specific macro definitions. these macros are kept in the generic sys/ptrace.h even though some targets don't support them: PTRACE_GETREGS PTRACE_SETREGS PTRACE_GETFPREGS PTRACE_SETFPREGS PTRACE_GETFPXREGS PTRACE_SETFPXREGS so no macro definition got removed in this patch on any target. only s390x has a numerically conflicting macro definition (PTRACE_SINGLEBLOCK). the PT_ aliases follow glibc headers, otherwise the definitions come from linux uapi headers except ones that are skipped in glibc and there is no real kernel support (s390x PTRACE_*_AREA) or need special type definitions (mips PTRACE_*_WATCH_*) or only relevant for linux 2.4 compatibility (PTRACE_OLDSETOPTIONS).
1 parent 7ea32a8 commit df6d945

File tree

12 files changed

+123
-0
lines changed

12 files changed

+123
-0
lines changed

arch/generic/bits/ptrace.h

Whitespace-only changes.

arch/i386/bits/ptrace.h

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#define PTRACE_GET_THREAD_AREA 25
2+
#define PTRACE_SET_THREAD_AREA 26
3+
#define PTRACE_SYSEMU 31
4+
#define PTRACE_SYSEMU_SINGLESTEP 32
5+
#define PTRACE_SINGLEBLOCK 33
6+
7+
#define PT_GET_THREAD_AREA PTRACE_GET_THREAD_AREA
8+
#define PT_SET_THREAD_AREA PTRACE_SET_THREAD_AREA
9+
#define PT_SYSEMU PTRACE_SYSEMU
10+
#define PT_SYSEMU_SINGLESTEP PTRACE_SYSEMU_SINGLESTEP
11+
#define PT_STEPBLOCK PTRACE_SINGLEBLOCK

arch/m68k/bits/ptrace.h

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#define PTRACE_GET_THREAD_AREA 25
2+
#define PTRACE_SINGLEBLOCK 33

arch/mips/bits/ptrace.h

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#define PTRACE_GET_THREAD_AREA 25
2+
#define PTRACE_SET_THREAD_AREA 26
3+
#define PTRACE_PEEKTEXT_3264 0xc0
4+
#define PTRACE_PEEKDATA_3264 0xc1
5+
#define PTRACE_POKETEXT_3264 0xc2
6+
#define PTRACE_POKEDATA_3264 0xc3
7+
#define PTRACE_GET_THREAD_AREA_3264 0xc4
8+
#define PTRACE_GET_WATCH_REGS 0xd0
9+
#define PTRACE_SET_WATCH_REGS 0xd1

arch/mips64/bits/ptrace.h

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#define PTRACE_GET_THREAD_AREA 25
2+
#define PTRACE_SET_THREAD_AREA 26
3+
#define PTRACE_PEEKTEXT_3264 0xc0
4+
#define PTRACE_PEEKDATA_3264 0xc1
5+
#define PTRACE_POKETEXT_3264 0xc2
6+
#define PTRACE_POKEDATA_3264 0xc3
7+
#define PTRACE_GET_THREAD_AREA_3264 0xc4
8+
#define PTRACE_GET_WATCH_REGS 0xd0
9+
#define PTRACE_SET_WATCH_REGS 0xd1

arch/mipsn32/bits/ptrace.h

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#define PTRACE_GET_THREAD_AREA 25
2+
#define PTRACE_SET_THREAD_AREA 26
3+
#define PTRACE_PEEKTEXT_3264 0xc0
4+
#define PTRACE_PEEKDATA_3264 0xc1
5+
#define PTRACE_POKETEXT_3264 0xc2
6+
#define PTRACE_POKEDATA_3264 0xc3
7+
#define PTRACE_GET_THREAD_AREA_3264 0xc4
8+
#define PTRACE_GET_WATCH_REGS 0xd0
9+
#define PTRACE_SET_WATCH_REGS 0xd1

arch/powerpc/bits/ptrace.h

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#define PTRACE_GETVRREGS 0x12
2+
#define PTRACE_SETVRREGS 0x13
3+
#define PTRACE_GETEVRREGS 0x14
4+
#define PTRACE_SETEVRREGS 0x15
5+
#define PTRACE_GETREGS64 0x16
6+
#define PTRACE_SETREGS64 0x17
7+
#define PTRACE_GET_DEBUGREG 0x19
8+
#define PTRACE_SET_DEBUGREG 0x1a
9+
#define PTRACE_GETVSRREGS 0x1b
10+
#define PTRACE_SETVSRREGS 0x1c
11+
#define PTRACE_SINGLEBLOCK 0x100
12+
13+
#define PT_GETVRREGS PTRACE_GETVRREGS
14+
#define PT_SETVRREGS PTRACE_SETVRREGS
15+
#define PT_GETEVRREGS PTRACE_GETEVRREGS
16+
#define PT_SETEVRREGS PTRACE_SETEVRREGS
17+
#define PT_GETREGS64 PTRACE_GETREGS64
18+
#define PT_SETREGS64 PTRACE_SETREGS64
19+
#define PT_GET_DEBUGREG PTRACE_GET_DEBUGREG
20+
#define PT_SET_DEBUGREG PTRACE_SET_DEBUGREG
21+
#define PT_GETVSRREGS PTRACE_GETVSRREGS
22+
#define PT_SETVSRREGS PTRACE_SETVSRREGS
23+
#define PT_STEPBLOCK PTRACE_SINGLEBLOCK

arch/powerpc64/bits/ptrace.h

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#define PTRACE_GETVRREGS 0x12
2+
#define PTRACE_SETVRREGS 0x13
3+
#define PTRACE_GETEVRREGS 0x14
4+
#define PTRACE_SETEVRREGS 0x15
5+
#define PTRACE_GETREGS64 0x16
6+
#define PTRACE_SETREGS64 0x17
7+
#define PTRACE_GET_DEBUGREG 0x19
8+
#define PTRACE_SET_DEBUGREG 0x1a
9+
#define PTRACE_GETVSRREGS 0x1b
10+
#define PTRACE_SETVSRREGS 0x1c
11+
#define PTRACE_SINGLEBLOCK 0x100
12+
13+
#define PT_GETVRREGS PTRACE_GETVRREGS
14+
#define PT_SETVRREGS PTRACE_SETVRREGS
15+
#define PT_GETEVRREGS PTRACE_GETEVRREGS
16+
#define PT_SETEVRREGS PTRACE_SETEVRREGS
17+
#define PT_GETREGS64 PTRACE_GETREGS64
18+
#define PT_SETREGS64 PTRACE_SETREGS64
19+
#define PT_GET_DEBUGREG PTRACE_GET_DEBUGREG
20+
#define PT_SET_DEBUGREG PTRACE_SET_DEBUGREG
21+
#define PT_GETVSRREGS PTRACE_GETVSRREGS
22+
#define PT_SETVSRREGS PTRACE_SETVSRREGS
23+
#define PT_STEPBLOCK PTRACE_SINGLEBLOCK

arch/s390x/bits/ptrace.h

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#define PTRACE_SINGLEBLOCK 12
2+
#define PTRACE_PEEKUSR_AREA 0x5000
3+
#define PTRACE_POKEUSR_AREA 0x5001
4+
#define PTRACE_GET_LAST_BREAK 0x5006
5+
#define PTRACE_ENABLE_TE 0x5009
6+
#define PTRACE_DISABLE_TE 0x5010
7+
#define PTRACE_TE_ABORT_RAND 0x5011
8+
9+
#define PT_STEPBLOCK PTRACE_SINGLEBLOCK

arch/x32/bits/ptrace.h

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#define PTRACE_GET_THREAD_AREA 25
2+
#define PTRACE_SET_THREAD_AREA 26
3+
#define PTRACE_ARCH_PRCTL 30
4+
#define PTRACE_SYSEMU 31
5+
#define PTRACE_SYSEMU_SINGLESTEP 32
6+
#define PTRACE_SINGLEBLOCK 33
7+
8+
#define PT_GET_THREAD_AREA PTRACE_GET_THREAD_AREA
9+
#define PT_SET_THREAD_AREA PTRACE_SET_THREAD_AREA
10+
#define PT_ARCH_PRCTL PTRACE_ARCH_PRCTL
11+
#define PT_SYSEMU PTRACE_SYSEMU
12+
#define PT_SYSEMU_SINGLESTEP PTRACE_SYSEMU_SINGLESTEP
13+
#define PT_STEPBLOCK PTRACE_SINGLEBLOCK

arch/x86_64/bits/ptrace.h

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#define PTRACE_GET_THREAD_AREA 25
2+
#define PTRACE_SET_THREAD_AREA 26
3+
#define PTRACE_ARCH_PRCTL 30
4+
#define PTRACE_SYSEMU 31
5+
#define PTRACE_SYSEMU_SINGLESTEP 32
6+
#define PTRACE_SINGLEBLOCK 33
7+
8+
#define PT_GET_THREAD_AREA PTRACE_GET_THREAD_AREA
9+
#define PT_SET_THREAD_AREA PTRACE_SET_THREAD_AREA
10+
#define PT_ARCH_PRCTL PTRACE_ARCH_PRCTL
11+
#define PT_SYSEMU PTRACE_SYSEMU
12+
#define PT_SYSEMU_SINGLESTEP PTRACE_SYSEMU_SINGLESTEP
13+
#define PT_STEPBLOCK PTRACE_SINGLEBLOCK

include/sys/ptrace.h

+2
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ extern "C" {
8888

8989
#define PTRACE_PEEKSIGINFO_SHARED 1
9090

91+
#include <bits/ptrace.h>
92+
9193
struct __ptrace_peeksiginfo_args {
9294
uint64_t off;
9395
uint32_t flags;

0 commit comments

Comments
 (0)