Decode struct iov in PTRACE_GET/SETREGSET
* process.c (sys_ptrace): Decode struct iov in PTRACE_GET/SETREGSET. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
873e5a5a5c
commit
be99497d39
28
process.c
28
process.c
@ -2260,9 +2260,11 @@ sys_ptrace(struct tcb *tcp)
|
||||
if (entering(tcp)) {
|
||||
printxval(ptrace_cmds, tcp->u_arg[0], "PTRACE_???");
|
||||
tprintf(", %lu, ", tcp->u_arg[1]);
|
||||
|
||||
addr = tcp->u_arg[2];
|
||||
if (tcp->u_arg[0] == PTRACE_PEEKUSER
|
||||
|| tcp->u_arg[0] == PTRACE_POKEUSER) {
|
||||
|| tcp->u_arg[0] == PTRACE_POKEUSER
|
||||
) {
|
||||
for (x = struct_user_offsets; x->str; x++) {
|
||||
if (x->val >= addr)
|
||||
break;
|
||||
@ -2275,9 +2277,15 @@ sys_ptrace(struct tcb *tcp)
|
||||
}
|
||||
else
|
||||
tprintf("%s, ", x->str);
|
||||
}
|
||||
else
|
||||
tprintf("%#lx, ", tcp->u_arg[2]);
|
||||
} else
|
||||
#ifdef PTRACE_GETREGSET
|
||||
//if (tcp->u_arg[0] == PTRACE_GET/SETREGSET) {
|
||||
// TODO: show tcp->u_arg[2] as "NT_xxx, "
|
||||
//} else
|
||||
#endif
|
||||
tprintf("%#lx, ", addr);
|
||||
|
||||
|
||||
switch (tcp->u_arg[0]) {
|
||||
#ifndef IA64
|
||||
case PTRACE_PEEKDATA:
|
||||
@ -2314,6 +2322,13 @@ sys_ptrace(struct tcb *tcp)
|
||||
case PTRACE_GETSIGINFO:
|
||||
/* Don't print anything, do it at syscall return. */
|
||||
break;
|
||||
#endif
|
||||
#ifdef PTRACE_GETREGSET
|
||||
case PTRACE_GETREGSET:
|
||||
break;
|
||||
case PTRACE_SETREGSET:
|
||||
tprint_iov(tcp, /*len:*/ 1, tcp->u_arg[3], /*as string:*/ 0);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
tprintf("%#lx", tcp->u_arg[3]);
|
||||
@ -2343,6 +2358,11 @@ sys_ptrace(struct tcb *tcp)
|
||||
printsiginfo(&si, verbose(tcp));
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
#ifdef PTRACE_GETREGSET
|
||||
case PTRACE_GETREGSET:
|
||||
tprint_iov(tcp, /*len:*/ 1, tcp->u_arg[3], /*as string:*/ 0);
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user