Skip to contentSkip to conversation

ptrace: Mark PTRACE_{PEEK,POKE}USR as deprecated for new ports

PATCH New Palmer Dabbelt 1 participant 1 message Oct 6, 2022 ptrace support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ptrace: Mark PTRACE_{PEEK,POKE}USR as deprecated for new ports

From: Palmer Dabbelt <[email protected]>

Folks keep submitting implementations of these for RISC-V. As far as I understand they're not meant to be implemented in new ports, this adds a comment to make that more explicit.

---
 include/uapi/linux/ptrace.h | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
include/uapi/linux/ptrace.h +7 -2
index 195ae64a8c87..38201ebec276 100644
@@ -11,14 +11,19 @@
 #define PTRACE_TRACEME		   0
 #define PTRACE_PEEKTEXT		   1
 #define PTRACE_PEEKDATA		   2
-#define PTRACE_PEEKUSR		   3
 #define PTRACE_POKETEXT		   4
 #define PTRACE_POKEDATA		   5
-#define PTRACE_POKEUSR		   6
 #define PTRACE_CONT		   7
 #define PTRACE_KILL		   8
 #define PTRACE_SINGLESTEP	   9
 
+/*
+ * These are deprecated for new ports in favor of PTRACE_{GET,SET}REGSET, which
+ * support accessing multiple CPU registers in a single syscall.
+ */
+#define PTRACE_PEEKUSR		   3
+#define PTRACE_POKEUSR		   6
+
 #define PTRACE_ATTACH		  16
 #define PTRACE_DETACH		  17
 
Signature · 1 line
2.34.1