]>
Commit | Line | Data |
---|---|---|
08bede39 | 1 | --- strace-4.5.18/ipc.c.orig 2007-01-15 21:25:52.000000000 +0100 |
280bc7ae | 2 | +++ strace-4.5.18/ipc.c 2009-10-07 22:11:24.392613451 +0200 |
08bede39 JB |
3 | @@ -152,6 +152,12 @@ |
4 | { 0, NULL }, | |
5 | }; | |
6 | ||
7 | +static const struct xlat semop_flags[] = { | |
8 | + { SEM_UNDO, "SEM_UNDO" }, | |
9 | + { IPC_NOWAIT, "IPC_NOWAIT" }, | |
10 | + { 0, NULL }, | |
11 | +}; | |
12 | + | |
13 | int sys_msgget(tcp) | |
14 | struct tcb *tcp; | |
15 | { | |
280bc7ae | 16 | @@ -273,14 +279,40 @@ |
08bede39 JB |
17 | int sys_semop(tcp) |
18 | struct tcb *tcp; | |
19 | { | |
20 | + int i; | |
21 | + | |
22 | if (entering(tcp)) { | |
23 | tprintf("%lu", tcp->u_arg[0]); | |
24 | if (indirect_ipccall(tcp)) { | |
25 | - tprintf(", %#lx", tcp->u_arg[3]); | |
26 | - tprintf(", %lu", tcp->u_arg[1]); | |
27 | + tprintf(", %#lx {", tcp->u_arg[3]); | |
28 | + for(i = 0; i < tcp->u_arg[1]; i++) { | |
29 | + struct sembuf sb; | |
08bede39 JB |
30 | + if(i != 0) |
31 | + tprintf(", "); | |
280bc7ae JB |
32 | + if (umove(tcp, tcp->u_arg[3]+i*sizeof(struct sembuf), &sb) < 0) |
33 | + tprintf("{???}"); | |
34 | + else { | |
35 | + tprintf("{%u, %d, ", sb.sem_num, sb.sem_op); | |
36 | + printflags(semop_flags, sb.sem_flg, "SEM_???"); | |
37 | + tprintf("}"); | |
38 | + } | |
08bede39 JB |
39 | + } |
40 | + tprintf("}, %lu", tcp->u_arg[1]); | |
41 | } else { | |
42 | - tprintf(", %#lx", tcp->u_arg[1]); | |
43 | - tprintf(", %lu", tcp->u_arg[2]); | |
44 | + tprintf(", %#lx {", tcp->u_arg[1]); | |
45 | + for(i = 0; i < tcp->u_arg[2]; i++) { | |
46 | + struct sembuf sb; | |
08bede39 JB |
47 | + if(i != 0) |
48 | + tprintf(", "); | |
280bc7ae JB |
49 | + if(umove(tcp, tcp->u_arg[1]+i*sizeof(struct sembuf), &sb) < 0) |
50 | + tprintf("{???}"); | |
51 | + else { | |
52 | + tprintf("{%u, %d, ", sb.sem_num, sb.sem_op); | |
53 | + printflags(semop_flags, sb.sem_flg, "SEM_???"); | |
54 | + tprintf("}"); | |
55 | + } | |
08bede39 JB |
56 | + } |
57 | + tprintf("}, %lu", tcp->u_arg[2]); | |
58 | } | |
59 | } | |
60 | return 0; | |
280bc7ae | 61 | @@ -290,15 +322,41 @@ |
08bede39 JB |
62 | int sys_semtimedop(tcp) |
63 | struct tcb *tcp; | |
64 | { | |
65 | + int i; | |
66 | + | |
67 | if (entering(tcp)) { | |
68 | tprintf("%lu", tcp->u_arg[0]); | |
69 | if (indirect_ipccall(tcp)) { | |
70 | - tprintf(", %#lx", tcp->u_arg[3]); | |
71 | - tprintf(", %lu, ", tcp->u_arg[1]); | |
72 | + tprintf(", %#lx {", tcp->u_arg[3]); | |
73 | + for(i = 0; i < tcp->u_arg[1]; i++) { | |
74 | + struct sembuf sb; | |
08bede39 JB |
75 | + if(i != 0) |
76 | + tprintf(", "); | |
280bc7ae JB |
77 | + if(umove(tcp, tcp->u_arg[3]+i*sizeof(struct sembuf), &sb) < 0) |
78 | + tprintf("{???}"); | |
79 | + else { | |
80 | + tprintf("{%u, %d, ", sb.sem_num, sb.sem_op); | |
81 | + printflags(semop_flags, sb.sem_flg, "SEM_???"); | |
82 | + tprintf("}"); | |
83 | + } | |
08bede39 JB |
84 | + } |
85 | + tprintf("}, %lu, ", tcp->u_arg[1]); | |
86 | printtv(tcp, tcp->u_arg[5]); | |
87 | } else { | |
88 | - tprintf(", %#lx", tcp->u_arg[1]); | |
89 | - tprintf(", %lu, ", tcp->u_arg[2]); | |
90 | + tprintf(", %#lx {", tcp->u_arg[1]); | |
91 | + for(i = 0; i < tcp->u_arg[2]; i++) { | |
92 | + struct sembuf sb; | |
08bede39 JB |
93 | + if(i != 0) |
94 | + tprintf(", "); | |
280bc7ae JB |
95 | + if(umove(tcp, tcp->u_arg[1]+i*sizeof(struct sembuf), &sb) < 0) |
96 | + tprintf("{???}"); | |
97 | + else { | |
98 | + tprintf("{%u, %d, ", sb.sem_num, sb.sem_op); | |
99 | + printflags(semop_flags, sb.sem_flg, "SEM_???"); | |
100 | + tprintf("}"); | |
101 | + } | |
08bede39 JB |
102 | + } |
103 | + tprintf("}, %lu, ", tcp->u_arg[2]); | |
104 | printtv(tcp, tcp->u_arg[3]); | |
105 | } | |
106 | } |