From: Dmitry V. Levin Date: Thu, 12 May 2016 15:10:41 +0000 (+0000) Subject: ptrace: do not print addr and data arguments of PTRACE_ATTACH-like requests X-Git-Tag: v4.12~181 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=91bd125f5370ca380a697ac156c06f968c311a33;p=strace ptrace: do not print addr and data arguments of PTRACE_ATTACH-like requests As kernel ignores addr and data arguments of PTRACE_ATTACH, PTRACE_INTERRUPT, PTRACE_KILL, and PTRACE_LISTEN request, we do not print them either. * process.c (SYS_FUNC(ptrace)): After printing pid argument, return RVAL_DECODED if request is one of PTRACE_ATTACH, PTRACE_INTERRUPT, PTRACE_KILL, or PTRACE_LISTEN. --- diff --git a/process.c b/process.c index f53c12e0..620cc1f4 100644 --- a/process.c +++ b/process.c @@ -97,24 +97,34 @@ SYS_FUNC(ptrace) } /* pid */ - tprintf(", %d, ", pid); + tprintf(", %d", pid); /* addr */ switch (request) { + case PTRACE_ATTACH: + case PTRACE_INTERRUPT: + case PTRACE_KILL: + case PTRACE_LISTEN: + /* addr and data are ignored */ + return RVAL_DECODED; case PTRACE_PEEKUSER: case PTRACE_POKEUSER: + tprints(", "); print_user_offset_addr(addr); break; case PTRACE_GETREGSET: case PTRACE_SETREGSET: + tprints(", "); printxval(nt_descriptor_types, addr, "NT_???"); break; default: + tprints(", "); printaddr(addr); } tprints(", "); + /* data */ switch (request) { #ifndef IA64 case PTRACE_PEEKDATA: