]> granicus.if.org Git - strace/commitdiff
Decode struct iov in PTRACE_GET/SETREGSET
authorDenys Vlasenko <vda.linux@googlemail.com>
Wed, 13 Feb 2013 15:10:10 +0000 (16:10 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Wed, 13 Feb 2013 15:10:10 +0000 (16:10 +0100)
* process.c (sys_ptrace): Decode struct iov in PTRACE_GET/SETREGSET.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
process.c

index 4cec11246fb6da7992bacdc356485c29bbc69b61..e4d491a2e29b8ecfd7fc24187994d41a49441768 100644 (file)
--- a/process.c
+++ b/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
                }
        }