2008-04-19  Dmitry V. Levin <[EMAIL PROTECTED]>

        * process.c (sys_prctl): Decode PR_SET_PDEATHSIG, PR_GET_PDEATHSIG,
        PR_SET_DUMPABLE, PR_GET_DUMPABLE, PR_SET_KEEPCAPS, PR_GET_KEEPCAPS.
        Fix PR_GET_UNALIGN decoder.
---
 strace/process.c |   50 ++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 38 insertions(+), 12 deletions(-)

--- a/strace/process.c
+++ b/strace/process.c
@@ -297,10 +297,24 @@ struct tcb *tcp;
                case PR_GETNSHARE:
                        break;
 #endif
-#ifdef PR_SET_DEATHSIG
+#ifdef PR_SET_PDEATHSIG
+               case PR_SET_PDEATHSIG:
+                       tprintf(", %lu", tcp->u_arg[1]);
+                       break;
+#endif
+#ifdef PR_GET_PDEATHSIG
                case PR_GET_PDEATHSIG:
                        break;
 #endif
+#ifdef PR_SET_DUMPABLE
+               case PR_SET_DUMPABLE:
+                       tprintf(", %lu", tcp->u_arg[1]);
+                       break;
+#endif
+#ifdef PR_GET_DUMPABLE
+               case PR_GET_DUMPABLE:
+                       break;
+#endif
 #ifdef PR_SET_UNALIGN
                case PR_SET_UNALIGN:
                        tprintf(", %s", unalignctl_string(tcp->u_arg[1]));
@@ -311,6 +325,15 @@ struct tcb *tcp;
                        tprintf(", %#lx", tcp->u_arg[1]);
                        break;
 #endif
+#ifdef PR_SET_KEEPCAPS
+               case PR_SET_KEEPCAPS:
+                       tprintf(", %lu", tcp->u_arg[1]);
+                       break;
+#endif
+#ifdef PR_GET_KEEPCAPS
+               case PR_GET_KEEPCAPS:
+                       break;
+#endif
                default:
                        for (i = 1; i < tcp->u_nargs; i++)
                                tprintf(", %#lx", tcp->u_arg[i]);
@@ -320,23 +343,26 @@ struct tcb *tcp;
                switch (tcp->u_arg[0]) {
 #ifdef PR_GET_PDEATHSIG
                case PR_GET_PDEATHSIG:
-                       for (i=1; i<tcp->u_nargs; i++)
-                               tprintf(", %#lx", tcp->u_arg[i]);
+                       if (umove(tcp, tcp->u_arg[1], &i) < 0)
+                               tprintf(", %#lx", tcp->u_arg[1]);
+                       else
+                               tprintf(", {%u}", i);
                        break;
 #endif
-#ifdef PR_SET_UNALIGN
-               case PR_SET_UNALIGN:
-                       break;
+#ifdef PR_GET_DUMPABLE
+               case PR_GET_DUMPABLE:
+                       return RVAL_UDECIMAL;
 #endif
 #ifdef PR_GET_UNALIGN
                case PR_GET_UNALIGN:
-               {
-                       int ctl;
-
-                       umove(tcp, tcp->u_arg[1], &ctl);
-                       tcp->auxstr = unalignctl_string(ctl);
+                       if (syserror(tcp) || umove(tcp, tcp->u_arg[1], &i) < 0)
+                               break;
+                       tcp->auxstr = unalignctl_string(i);
                        return RVAL_STR;
-               }
+#endif
+#ifdef PR_GET_KEEPCAPS
+               case PR_GET_KEEPCAPS:
+                       return RVAL_UDECIMAL;
 #endif
                default:
                        break;

-- 
ldv

Attachment: pgpdWmAGwOgxx.pgp
Description: PGP signature

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Strace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to