Gentoo Archives: gentoo-commits

From: "Samuli Suominen (ssuominen)" <ssuominen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-apps/fakeroot-ng/files: fakeroot-ng-0.17-gcc47.patch
Date: Tue, 03 Jul 2012 10:04:32
Message-Id: 20120703100422.982782004C@flycatcher.gentoo.org
1 ssuominen 12/07/03 10:04:22
2
3 Added: fakeroot-ng-0.17-gcc47.patch
4 Log:
5 Fix building with sys-devel/gcc >= 4.7.0 wrt #422905
6
7 (Portage version: 2.2.0_alpha114/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 sys-apps/fakeroot-ng/files/fakeroot-ng-0.17-gcc47.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/fakeroot-ng/files/fakeroot-ng-0.17-gcc47.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/fakeroot-ng/files/fakeroot-ng-0.17-gcc47.patch?rev=1.1&content-type=text/plain
14
15 Index: fakeroot-ng-0.17-gcc47.patch
16 ===================================================================
17 --- file.cpp
18 +++ file.cpp
19 @@ -29,6 +29,7 @@
20 #include <limits.h>
21
22 #include <string.h>
23 +#include <unistd.h>
24
25 #include "syscalls.h"
26 #include "file_lie.h"
27 @@ -53,7 +54,7 @@
28 // Entering the syscall
29 state->state=pid_state::RETURN;
30 state->context_state[0]=ptlib_get_argument( pid, 2 ); // Store the pointer to the stat struct
31 - dlog("stat64: "PID_F" stored pointer at %p\n", pid, (void*)state->context_state[0] );
32 + dlog("stat64: " PID_F " stored pointer at %p\n", pid, (void*)state->context_state[0] );
33
34 // If the process is chrooted, we need to translate the file name
35 int real_sc=ptlib_get_syscall( pid );
36 @@ -63,7 +64,7 @@
37 } else if( state->state==pid_state::RETURN ) {
38 // Returning from the syscall
39 int returncode=ptlib_get_retval( pid );
40 - dlog("stat64: "PID_F" returned %x\n", pid, returncode);
41 + dlog("stat64: " PID_F " returned %x\n", pid, returncode);
42 if( ptlib_success( pid, sc_num ) ) {
43 struct ptlib_stat ret;
44 struct stat_override override;
45 @@ -92,11 +93,11 @@
46 }
47
48 if( ok ) {
49 - dlog("stat64: "PID_F" override dev="DEV_F" inode="INODE_F" mode=%o uid="UID_F" gid="GID_F"\n",
50 + dlog("stat64: " PID_F " override dev=" DEV_F " inode=" INODE_F " mode=%o uid=" UID_F " gid=" GID_F "\n",
51 pid, ret.dev, ret.ino, ret.mode, ret.uid, ret.gid );
52 ptlib_set_mem( pid, &ret, (void *)state->context_state[0], sizeof(struct stat) );
53 } else {
54 - dlog("stat64: "PID_F" dev="DEV_F" inode="INODE_F" override entry corrupt - removed\n", pid, ret.dev, ret.ino );
55 + dlog("stat64: " PID_F " dev=" DEV_F " inode=" INODE_F " override entry corrupt - removed\n", pid, ret.dev, ret.ino );
56 remove_map( ret.dev, ret.ino );
57 }
58 }
59 @@ -117,7 +118,7 @@
60 chroot_translate_paramat( pid, state, ptlib_get_argument( pid, 1 ), 2, (ptlib_get_argument(pid, 4)&AT_SYMLINK_NOFOLLOW)!=0 );
61
62 state->context_state[0]=ptlib_get_argument( pid, 3 ); // Store the pointer to the stat struct
63 - dlog("statat64: "PID_F" stored pointer at %p\n", pid, (void*)state->context_state[0] );
64 + dlog("statat64: " PID_F " stored pointer at %p\n", pid, (void*)state->context_state[0] );
65
66 return true;
67 } else {
68 @@ -213,11 +214,11 @@
69 override.dev_id=0;
70 override.transient=true;
71
72 - dlog("chmod: "PID_F" error (race?) getting override info for dev "DEV_F" inode "INODE_F"\n",
73 + dlog("chmod: " PID_F " error (race?) getting override info for dev " DEV_F " inode " INODE_F "\n",
74 pid, state->context_state[2], state->context_state[3] );
75 }
76 override.mode=(override.mode&~07777)|(((mode_t)state->context_state[1])&07777);
77 - dlog("chmod: "PID_F" Setting override mode %o dev "DEV_F" inode "INODE_F"\n", pid, override.mode, override.dev,
78 + dlog("chmod: " PID_F " Setting override mode %o dev " DEV_F " inode " INODE_F "\n", pid, override.mode, override.dev,
79 override.inode );
80 set_map( &override );
81
82 @@ -233,7 +234,7 @@
83
84 state->state=pid_state::NONE;
85 } else {
86 - dlog("chmod: "PID_F" unknown state %d\n", pid, state->state );
87 + dlog("chmod: " PID_F " unknown state %d\n", pid, state->state );
88 }
89
90 return true;
91 @@ -295,7 +296,7 @@
92 }
93
94 ptlib_set_syscall( pid, stat_function );
95 - dlog("chown: "PID_F" redirected chown call to stat\n", pid );
96 + dlog("chown: " PID_F " redirected chown call to stat\n", pid );
97
98 state->state=pid_state::REDIRECT2;
99 } else if( state->state==pid_state::REDIRECT2 ) {
100 @@ -306,7 +307,7 @@
101 ptlib_get_mem( pid, state->memory, &stat, sizeof( stat ) );
102
103 if( !get_map( stat.dev, stat.ino, &override ) ) {
104 - dlog("chown: "PID_F" no override for file - create a new one\n", pid );
105 + dlog("chown: " PID_F " no override for file - create a new one\n", pid );
106 stat_override_copy( &stat, &override );
107 }
108
109 @@ -315,10 +316,10 @@
110 if( ((int)state->context_state[1])!=-1 )
111 override.gid=state->context_state[1];
112
113 - dlog("chown: "PID_F" changing owner of dev "DEV_F" inode "INODE_F"\n", pid, override.dev, override.inode );
114 + dlog("chown: " PID_F " changing owner of dev " DEV_F " inode " INODE_F "\n", pid, override.dev, override.inode );
115 set_map( &override );
116 } else {
117 - dlog("chown: "PID_F" stat call failed with error %s\n", pid, strerror(ptlib_get_error(pid, sc_num)) );
118 + dlog("chown: " PID_F " stat call failed with error %s\n", pid, strerror(ptlib_get_error(pid, sc_num)) );
119 }
120
121 state->state=pid_state::NONE;
122 @@ -391,7 +392,7 @@
123 mode|= 00600;
124
125 if( S_ISCHR(mode) || S_ISBLK(mode) ) {
126 - dlog("mknod: "PID_F" tried to create %s device, turn to regular file\n", pid, S_ISCHR(mode) ? "character" : "block" );
127 + dlog("mknod: " PID_F " tried to create %s device, turn to regular file\n", pid, S_ISCHR(mode) ? "character" : "block" );
128 mode=(mode&~S_IFMT) | S_IFREG;
129 }
130 ptlib_set_argument( pid, mode_offset+1, mode );
131 @@ -414,11 +415,11 @@
132
133 state->state=pid_state::REDIRECT1;
134
135 - dlog("mknod: "PID_F" Actual node creation successful. Calling stat\n", pid );
136 + dlog("mknod: " PID_F " Actual node creation successful. Calling stat\n", pid );
137 return ptlib_generate_syscall( pid, stat_function, state->shared_memory );
138 } else {
139 // Nothing to do if the call failed
140 - dlog("mknod: "PID_F" call failed with error %s\n", pid, strerror(ptlib_get_error(pid, sc_num) ) );
141 + dlog("mknod: " PID_F " call failed with error %s\n", pid, strerror(ptlib_get_error(pid, sc_num) ) );
142 }
143 } else if( state->state==pid_state::REDIRECT2 ) {
144 if( ptlib_success( pid, sc_num ) ) {
145 @@ -434,12 +435,12 @@
146 override.uid=state->fsuid;
147 override.gid=state->fsgid;
148
149 - dlog("mknod: "PID_F" registering the new device in the override DB dev "DEV_F" inode "INODE_F"\n", pid,
150 + dlog("mknod: " PID_F " registering the new device in the override DB dev " DEV_F " inode " INODE_F "\n", pid,
151 stat.dev, stat.ino );
152
153 mode_t mode=(mode_t)state->context_state[0];
154 if( S_ISCHR(mode) || S_ISBLK(mode) || (mode&07000)!=0) {
155 - dlog("mknod: "PID_F" overriding the file type and/or mode\n", pid );
156 + dlog("mknod: " PID_F " overriding the file type and/or mode\n", pid );
157 override.mode=(override.mode&~(S_IFMT|07000)) | (mode&(S_IFMT|07000));
158 override.dev_id=(dev_t)state->context_state[1];
159 }
160 @@ -451,7 +452,7 @@
161 set_map( &override );
162 } else {
163 // mknod succeeded, but stat failed?
164 - dlog("mknod: "PID_F" stat failed. Leave override DB non-updated\n", pid );
165 + dlog("mknod: " PID_F " stat failed. Leave override DB non-updated\n", pid );
166 }
167
168 ptlib_restore_state( pid, state->saved_state );
169 @@ -512,7 +513,7 @@
170 // Did we request to create a new file?
171 if( (state->context_state[0]&O_CREAT)!=0 && ptlib_success(pid, sc_num) ) {
172 int fd=(long)ptlib_get_retval(pid);
173 - dlog("open: "PID_F" opened fd %d, assume we actually created it\n", pid, fd );
174 + dlog("open: " PID_F " opened fd %d, assume we actually created it\n", pid, fd );
175
176 ptlib_save_state( pid, state->saved_state );
177 state->state=pid_state::REDIRECT1;
178 @@ -545,12 +546,12 @@
179 // XXX We are ignoring the umask here!
180
181 set_map( &override );
182 - dlog("open: "PID_F" creating override for dev "DEV_F" inode "INODE_F"\n", pid, override.dev, override.inode);
183 + dlog("open: " PID_F " creating override for dev " DEV_F " inode " INODE_F "\n", pid, override.dev, override.inode);
184 } else {
185 - dlog("open: "PID_F" map for dev "DEV_F" inode "INODE_F" already exists - doing nothing\n", pid, stat.dev, stat.ino );
186 + dlog("open: " PID_F " map for dev " DEV_F " inode " INODE_F " already exists - doing nothing\n", pid, stat.dev, stat.ino );
187 }
188 } else {
189 - dlog("open: "PID_F" fstat failed %s\n", pid, strerror( ptlib_get_error( pid, sc_num ) ) );
190 + dlog("open: " PID_F " fstat failed %s\n", pid, strerror( ptlib_get_error( pid, sc_num ) ) );
191 }
192
193 state->state=pid_state::NONE;
194 @@ -607,7 +608,7 @@
195 state->state=pid_state::NONE;
196
197 if( ptlib_success( pid, sc_num ) ) {
198 - dlog("mkdir: "PID_F" succeeded. Call stat\n", pid );
199 + dlog("mkdir: " PID_F " succeeded. Call stat\n", pid );
200 ptlib_save_state( pid, state->saved_state );
201
202 // Perform a stat operation so we can know the directory's dev and inode
203 @@ -625,7 +626,7 @@
204 return ptlib_generate_syscall( pid, stat_function, state->shared_memory );
205 } else {
206 // If mkdir failed, we don't have anything else to do.
207 - dlog("mkdir: "PID_F" failed with error %s\n", pid, strerror(ptlib_get_error( pid, sc_num ) ) );
208 + dlog("mkdir: " PID_F " failed with error %s\n", pid, strerror(ptlib_get_error( pid, sc_num ) ) );
209 }
210 } else if( state->state==pid_state::REDIRECT2 ) {
211 if( ptlib_success( pid, sc_num ) ) {
212 @@ -643,10 +644,10 @@
213 override.mode|= state->context_state[0]&00700;
214 // XXX This code does not take the umask into account
215
216 - dlog("mkdir: "PID_F" storing override for dev "DEV_F" inode "INODE_F"\n", pid, override.dev, override.inode);
217 + dlog("mkdir: " PID_F " storing override for dev " DEV_F " inode " INODE_F "\n", pid, override.dev, override.inode);
218 set_map( &override );
219 } else {
220 - dlog("mkdir: "PID_F" stat failed with error %s\n", pid, strerror(ptlib_get_error(pid, sc_num)));
221 + dlog("mkdir: " PID_F " stat failed with error %s\n", pid, strerror(ptlib_get_error(pid, sc_num)));
222 }
223
224 ptlib_restore_state( pid, state->saved_state );
225 @@ -704,7 +705,7 @@
226 state->state=pid_state::RETURN;
227 } else if( state->state==pid_state::RETURN ) {
228 if( ptlib_success( pid, sc_num ) ) {
229 - dlog("symlink: "PID_F" success. Call stat to mark uid/gid override\n", pid );
230 + dlog("symlink: " PID_F " success. Call stat to mark uid/gid override\n", pid );
231 ptlib_save_state( pid, state->saved_state );
232
233 for( int i=0; i<mode_offset; ++i ) {
234 @@ -720,7 +721,7 @@
235
236 return ptlib_generate_syscall( pid, stat_function, state->shared_memory );
237 } else {
238 - dlog("symlink: "PID_F" failed with error %s\n", pid, strerror( ptlib_get_error(pid, sc_num) ) );
239 + dlog("symlink: " PID_F " failed with error %s\n", pid, strerror( ptlib_get_error(pid, sc_num) ) );
240 state->state=pid_state::NONE;
241 }
242 } else if( state->state==pid_state::REDIRECT2 ) {
243 @@ -738,14 +739,14 @@
244 override.uid=state->fsuid;
245 override.gid=state->fsgid;
246
247 - dlog("symlink: "PID_F" set uid/gid override for dev "DEV_F" inode "INODE_F"\n", pid, override.dev, override.inode );
248 + dlog("symlink: " PID_F " set uid/gid override for dev " DEV_F " inode " INODE_F "\n", pid, override.dev, override.inode );
249 set_map( &override );
250 } else {
251 - dlog("symlink: "PID_F" acutal file on disk is not a symlink. Type %o dev "DEV_F" inode "INODE_F"\n", pid, stat.mode, stat.dev,
252 + dlog("symlink: " PID_F " acutal file on disk is not a symlink. Type %o dev " DEV_F " inode " INODE_F "\n", pid, stat.mode, stat.dev,
253 stat.ino );
254 }
255 } else {
256 - dlog("symlink: "PID_F" symlink succeeded, but stat failed with %s\n", pid, strerror(ptlib_get_error(pid, sc_num)));
257 + dlog("symlink: " PID_F " symlink succeeded, but stat failed with %s\n", pid, strerror(ptlib_get_error(pid, sc_num)));
258 }
259
260 ptlib_restore_state( pid, state->saved_state );
261 @@ -885,7 +886,7 @@
262 state->state=pid_state::REDIRECT2;
263 if( start<addr1 && end>addr1 ) {
264 // The unmap range covers the lower range
265 - dlog("sys_munmap: "PID_F" tried to unmap range %p-%p, which conflicts with our %s range %p-%p\n",
266 + dlog("sys_munmap: " PID_F " tried to unmap range %p-%p, which conflicts with our %s range %p-%p\n",
267 pid, (void*)start, (void*)end, name1, (void*)addr1, (void*)(addr1+len1) );
268
269 if( end>addr1+len1 ) {
270 @@ -897,13 +898,13 @@
271 end=addr1;
272 } else if( start>=addr1 && start<addr1+len1 ) {
273 // The start pointer is inside the lower memory range
274 - dlog("sys_munmap: "PID_F" tried to unmap range %p-%p, which conflicts with our %s range %p-%p\n",
275 + dlog("sys_munmap: " PID_F " tried to unmap range %p-%p, which conflicts with our %s range %p-%p\n",
276 pid, (void*)start, (void*)end, name1, (void*)addr1, (void*)(addr1+len1) );
277
278 start=addr1+len1;
279 } else if( start<addr2 && end>addr2 ) {
280 // The unmap area covers the upper memory range
281 - dlog("sys_munmap: "PID_F" tried to unmap range %p-%p, which conflicts with our %s range %p-%p\n",
282 + dlog("sys_munmap: " PID_F " tried to unmap range %p-%p, which conflicts with our %s range %p-%p\n",
283 pid, (void*)start, (void*)end, name2, (void*)addr2, (void*)(addr2+len2) );
284
285 if( end>addr2+len2 ) {
286 @@ -915,7 +916,7 @@
287 end=addr2;
288 } else if( start>=addr2 && start<addr2+len2 ) {
289 // The start pointer is inside the upper memory range
290 - dlog("sys_munmap: "PID_F" tried to unmap range %p-%p, which conflicts with our %s range %p-%p\n",
291 + dlog("sys_munmap: " PID_F " tried to unmap range %p-%p, which conflicts with our %s range %p-%p\n",
292 pid, (void*)start, (void*)end, name2, (void*)addr2, (void*)(addr2+len2) );
293
294 start=addr2+len2;
295 @@ -951,7 +952,7 @@
296 }
297 } else {
298 // The syscall failed - we will end it here even if we thought we had something more to do
299 - dlog("sys_munmap: "PID_F" failed: %s\n", pid, strerror(ptlib_get_error(pid, sc_num)));
300 + dlog("sys_munmap: " PID_F " failed: %s\n", pid, strerror(ptlib_get_error(pid, sc_num)));
301 }
302
303 if( state->context_state[2]==1 ) {
304 @@ -1090,7 +1091,7 @@
305 } else {
306 // lstat syscall failed - pass the error along
307 state->state=pid_state::NONE;
308 - dlog("%s: "PID_F" lstat failed with error: %s\n", __FUNCTION__, pid, strerror(ptlib_get_error(pid, sc_num)));
309 + dlog("%s: " PID_F " lstat failed with error: %s\n", __FUNCTION__, pid, strerror(ptlib_get_error(pid, sc_num)));
310 }
311 }
312 break;
313 @@ -1111,13 +1112,13 @@
314 if( get_map( key->dev, key->inode, &map ) ) {
315 map.transient=true;
316 set_map( &map );
317 - dlog("sys_unlink: "PID_F" inode "INODE_F" in override mapping marked transient\n", pid, key->inode );
318 + dlog("sys_unlink: " PID_F " inode " INODE_F " in override mapping marked transient\n", pid, key->inode );
319 }
320 }
321 } else {
322 // The "restore state" command overwrote the error
323 ptlib_set_error( pid, sc_num, error );
324 - dlog("%s: "PID_F" unlink failed with error: %s\n", __FUNCTION__, pid, strerror(error));
325 + dlog("%s: " PID_F " unlink failed with error: %s\n", __FUNCTION__, pid, strerror(error));
326 }
327 }
328 break;
329 @@ -1229,7 +1230,7 @@
330 } else {
331 // lstat syscall failed - pass the error along
332 state->state=pid_state::NONE;
333 - dlog("%s: "PID_F" fstatat failed with error: %s\n", __FUNCTION__, pid, strerror(ptlib_get_error(pid, sc_num)));
334 + dlog("%s: " PID_F " fstatat failed with error: %s\n", __FUNCTION__, pid, strerror(ptlib_get_error(pid, sc_num)));
335 }
336 }
337 break;
338 @@ -1250,14 +1251,14 @@
339 if( get_map( key->dev, key->inode, &map ) ) {
340 map.transient=true;
341 set_map( &map );
342 - dlog("%s: "PID_F" inode "INODE_F" in override mapping marked transient\n", __FUNCTION__,
343 + dlog("%s: " PID_F " inode " INODE_F " in override mapping marked transient\n", __FUNCTION__,
344 pid, key->inode );
345 }
346 }
347 } else {
348 // The "restore state" command overwrote the error
349 ptlib_set_error( pid, sc_num, error );
350 - dlog("%s: "PID_F" unlinkat failed with error: %s\n", __FUNCTION__, pid, strerror(error));
351 + dlog("%s: " PID_F " unlinkat failed with error: %s\n", __FUNCTION__, pid, strerror(error));
352 }
353 }
354 break;
355 @@ -1350,7 +1351,7 @@
356 if( get_map( key->dev, key->inode, &map ) ) {
357 map.transient=true;
358 set_map( &map );
359 - dlog("sys_rmdir: "PID_F" inode "INODE_F" in override mapping marked transient\n", pid, key->inode );
360 + dlog("sys_rmdir: " PID_F " inode " INODE_F " in override mapping marked transient\n", pid, key->inode );
361 }
362 } else {
363 // Need to copy the error number (overwritten by the state restore)
364 --- file_lie.cpp
365 +++ file_lie.cpp
366 @@ -64,7 +64,7 @@
367 stat_override override;
368 int params;
369
370 - while( (params=fscanf(file, "dev="DEV_F", ino="INODE_F", mode=%o, uid=%d, gid=%d, rdev="DEV_F" \n", &override.dev, &override.inode,
371 + while( (params=fscanf(file, "dev=" DEV_F ", ino=" INODE_F ", mode=%o, uid=%d, gid=%d, rdev=" DEV_F " \n", &override.dev, &override.inode,
372 &override.mode, &override.uid, &override.gid, &override.dev_id ))==6 )
373 {
374 set_map( &override );
375 @@ -78,7 +78,7 @@
376
377 override=&(i->second);
378 if( !override->transient ) {
379 - fprintf( file, "dev="DEV_F",ino="INODE_F",mode=%o,uid=%d,gid=%d,rdev="DEV_F"\n", override->dev, override->inode,
380 + fprintf( file, "dev=" DEV_F ",ino=" INODE_F ",mode=%o,uid=%d,gid=%d,rdev=" DEV_F "\n", override->dev, override->inode,
381 override->mode, override->uid, override->gid, override->dev_id );
382 }
383 }
384 --- parent.cpp
385 +++ parent.cpp
386 @@ -40,6 +40,7 @@
387 #include <limits.h>
388 #include <string.h>
389 #include <stdlib.h>
390 +#include <unistd.h>
391
392 #include "arch/platform.h"
393
394 @@ -397,7 +398,7 @@
395 // This process has no parent, or had a parent that already quit
396 return;
397 }
398 - dlog("notify_parent: "PID_F" sent a notify about "PID_F"(%x)\n", parent, waiting.pid(), waiting.status());
399 + dlog("notify_parent: " PID_F " sent a notify about " PID_F "(%x)\n", parent, waiting.pid(), waiting.status());
400 pid_state *proc_state=lookup_state(parent);
401 assert(proc_state!=NULL);
402
403 @@ -407,7 +408,7 @@
404 if( proc_state->state==pid_state::WAITING ) {
405 // Call the original function handler, now that it has something to do
406 if( syscalls[proc_state->orig_sc].func( -1, parent, proc_state ) ) {
407 - dlog("notify_parent: "PID_F" released from wait\n", parent);
408 + dlog("notify_parent: " PID_F " released from wait\n", parent);
409 ptlib_continue(PTRACE_SYSCALL, parent, 0);
410 }
411 }
412 @@ -423,7 +424,7 @@
413 // Set the process state to ZOMBIE with usage count of 1
414 proc_state->state=pid_state::ZOMBIE;
415 proc_state->context_state[0]=1;
416 - dlog("%s: "PID_F" is now a zombie\n", __func__, pid );
417 + dlog("%s: " PID_F " is now a zombie\n", __func__, pid );
418
419 pid_state *parent_state=lookup_state(proc_state->parent);
420
421 @@ -497,12 +498,12 @@
422 // Due to platform incompatibilities and other issues, we may be called several times over the same
423 // child. Don't make a fuss - just return.
424
425 - dlog("%s: Process "PID_F" already registered - not performing any operation\n", __FUNCTION__, child_id );
426 + dlog("%s: Process " PID_F " already registered - not performing any operation\n", __FUNCTION__, child_id );
427
428 return;
429 }
430
431 - dlog("%s: Registering "PID_F" with parent "PID_F"\n", __FUNCTION__, child_id, parent_id );
432 + dlog("%s: Registering " PID_F " with parent " PID_F "\n", __FUNCTION__, child_id, parent_id );
433
434 // The platform may want to init the process in some way
435 ptlib_prepare(child_id);
436 @@ -561,7 +562,7 @@
437 // The process does not exist!
438 // Register it
439 pid_t parent_pid=ptlib_get_parent(pid);
440 - dlog("Caught unknown new process "PID_F", detected parent "PID_F"\n", pid, parent_pid );
441 + dlog("Caught unknown new process " PID_F ", detected parent " PID_F "\n", pid, parent_pid );
442 dlog(NULL);
443 assert( parent_pid==0 || parent_pid==1 || state.find(parent_pid)!=state.end() ); // Make sure the parent is, indeed, ours
444
445 @@ -583,20 +584,20 @@
446 if( proc_state->state==pid_state::REDIRECT1 ) {
447 // REDIRECT1 is just a filler state between the previous call, where the arguments were set up and
448 // the call initiated, and the call's return (REDIRECT2). No need to actually call the handler
449 - dlog(PID_F": Calling syscall %ld redirected from %s\n", pid, ret, syscalls[proc_state->orig_sc].name );
450 + dlog(PID_F ": Calling syscall %ld redirected from %s\n", pid, ret, syscalls[proc_state->orig_sc].name );
451 proc_state->state=pid_state::REDIRECT2;
452 } else if( proc_state->state==pid_state::REDIRECT2 || proc_state->state==pid_state::REDIRECT3 ) {
453 // REDIRECT2 means a return from a syscall generated by us.
454 // REDIRECT3 means entering a syscall generated by us, but for which the handler function would like
455 // to be notified (unlike REDIRECT1 above, which is short circuited)
456 if( proc_state->orig_sc!=SYS_execve ) {
457 - dlog(PID_F": Called syscall %ld, redirected from %s\n", pid, ret, syscalls[proc_state->orig_sc].name );
458 + dlog(PID_F ": Called syscall %ld, redirected from %s\n", pid, ret, syscalls[proc_state->orig_sc].name );
459
460 if( !syscalls[proc_state->orig_sc].func( ret, pid, proc_state ) )
461 sig=-1; // Mark for ptrace not to continue the process
462 } else {
463 // Special handling of the execve case
464 - dlog(PID_F": Called syscall %ld, redirected from execve\n", pid, ret );
465 + dlog(PID_F ": Called syscall %ld, redirected from execve\n", pid, ret );
466
467 if( !sys_execve( ret, pid, proc_state, posttrap_always ) )
468 sig=-1;
469 @@ -610,14 +611,14 @@
470 if( proc_state->state!=pid_state::ALLOCATE ) {
471 // Sanity check - returning from same syscall that got us in
472 if( proc_state->state==pid_state::RETURN && ret!=proc_state->orig_sc ) {
473 - dlog("process "PID_F" orig_sc=%d actual sc=%ld state=%s\n", pid, proc_state->orig_sc, ret,
474 + dlog("process " PID_F " orig_sc=%d actual sc=%ld state=%s\n", pid, proc_state->orig_sc, ret,
475 state2str(proc_state->state));
476 dlog(NULL);
477 assert( proc_state->state!=pid_state::RETURN || ret==proc_state->orig_sc );
478 }
479
480 if( proc_state->state==pid_state::NONE && proc_state->debugger!=0 && proc_state->trace_mode==TRACE_SYSCALL ) {
481 - dlog(PID_F": pre-syscall hook called for debugger "PID_F"\n", pid, proc_state->debugger );
482 + dlog(PID_F ": pre-syscall hook called for debugger " PID_F "\n", pid, proc_state->debugger );
483
484 // Notify the debugger before the syscall
485 proc_state->context_state[0]=wait_state;
486 @@ -651,18 +652,18 @@
487 proc_state->orig_sc=ret;
488
489 if( syscalls.find(ret)!=syscalls.end() ) {
490 - dlog(PID_F": Called %s(%s)\n", pid, syscalls[ret].name, state2str(proc_state->state));
491 + dlog(PID_F ": Called %s(%s)\n", pid, syscalls[ret].name, state2str(proc_state->state));
492
493 if( !syscalls[ret].func( ret, pid, proc_state ) ) {
494 sig=-1; // Mark for ptrace not to continue the process
495 }
496 } else if( ret==SYS_execve ) {
497 - dlog(PID_F": Called execve(%s)\n", pid, state2str(proc_state->state));
498 + dlog(PID_F ": Called execve(%s)\n", pid, state2str(proc_state->state));
499
500 if( !sys_execve(ret, pid, proc_state, posttrap_always ) )
501 sig=-1;
502 } else {
503 - dlog(PID_F": Unknown syscall %ld(%s)\n", pid, ret, state2str(proc_state->state));
504 + dlog(PID_F ": Unknown syscall %ld(%s)\n", pid, ret, state2str(proc_state->state));
505 if( proc_state->state==pid_state::NONE ) {
506 proc_state->state=pid_state::RETURN;
507 } else if( proc_state->state==pid_state::RETURN ) {
508 @@ -680,7 +681,7 @@
509 posttrap_always )
510 )
511 {
512 - dlog(PID_F": notify debugger "PID_F" about post-syscall hook\n", pid, proc_state->debugger );
513 + dlog(PID_F ": notify debugger " PID_F " about post-syscall hook\n", pid, proc_state->debugger );
514 proc_state->trace_mode=TRACE_STOPPED2;
515
516 pid_state::wait_state waiting;
517 @@ -694,7 +695,7 @@
518 }
519 break;
520 case SIGNAL:
521 - dlog(PID_F": Signal %s\n", pid, sig2str(ret));
522 + dlog(PID_F ": Signal %s\n", pid, sig2str(ret));
523 if( proc_state->debugger==0 )
524 sig=ret;
525 else {
526 @@ -713,9 +714,9 @@
527 case SIGEXIT:
528 {
529 if( wait_state==EXIT ) {
530 - dlog(PID_F": Exit with return code %ld\n", pid, ret);
531 + dlog(PID_F ": Exit with return code %ld\n", pid, ret);
532 } else {
533 - dlog(PID_F": Exit with %s\n", pid, sig2str(ret));
534 + dlog(PID_F ": Exit with %s\n", pid, sig2str(ret));
535 }
536
537 struct rusage rusage;
538 @@ -738,7 +739,7 @@
539 break;
540 case NEWPROCESS:
541 {
542 - dlog(PID_F": Created new child process %ld\n", pid, ret);
543 + dlog(PID_F ": Created new child process %ld\n", pid, ret);
544 handle_new_process( pid, ret );
545 }
546 }
547 @@ -752,11 +753,11 @@
548
549 // Attach a debugger to the child
550 if( ptrace(PTRACE_ATTACH, child, 0, 0)!=0 ) {
551 - dlog("Could not start trace of process "PID_F": %s\n", child, strerror(errno) );
552 + dlog("Could not start trace of process " PID_F ": %s\n", child, strerror(errno) );
553
554 return false;
555 }
556 - dlog("Debugger successfully attached to process "PID_F"\n", child );
557 + dlog("Debugger successfully attached to process " PID_F "\n", child );
558
559 // Let's free the process to do the exec
560 errno=0;
561 @@ -892,7 +893,7 @@
562 pid_t child=-1;
563
564 if( read( session_socket, &child, sizeof(child))>0 && child>0 ) {
565 - dlog("Got asynchronous request to attach to process "PID_F"\n", child);
566 + dlog("Got asynchronous request to attach to process " PID_F "\n", child);
567
568 attach_debugger(child, session_socket);
569 }
570 @@ -932,7 +933,7 @@
571
572 bool allocate_process_mem( pid_t pid, pid_state *state, int sc_num )
573 {
574 - dlog("allocate_process_mem: "PID_F" running syscall %d needs process memory\n", pid, sc_num );
575 + dlog("allocate_process_mem: " PID_F " running syscall %d needs process memory\n", pid, sc_num );
576
577 state->orig_sc=sc_num;
578
579 @@ -964,7 +965,7 @@
580 int fd=mkstemp(filename);
581
582 if( fd==-1 ) {
583 - dlog("allocate_shared_mem: "PID_F" Failed to create file %s: %s\n", pid, filename, strerror(errno) );
584 + dlog("allocate_shared_mem: " PID_F " Failed to create file %s: %s\n", pid, filename, strerror(errno) );
585
586 // We'll kill the process
587 ptlib_continue( PTRACE_KILL, pid, 0 );
588 @@ -978,7 +979,7 @@
589 char *memory=(char *)mmap( NULL, shared_mem_size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0 );
590
591 if( memory==MAP_FAILED ) {
592 - dlog("allocate_shared_mem: "PID_F" filed to map file %s into memory: %s\n", pid, filename, strerror(errno) );
593 + dlog("allocate_shared_mem: " PID_F " filed to map file %s into memory: %s\n", pid, filename, strerror(errno) );
594
595 // Cleanup
596 close(fd);
597 @@ -1035,7 +1036,7 @@
598 // First step - mmap just returned
599 if( ptlib_success( pid, sc_num ) ) {
600 state->memory=(void *)ptlib_get_retval( pid );
601 - dlog("handle_memory_allocation: "PID_F" allocated for our use %lu bytes at %p\n", pid,
602 + dlog("handle_memory_allocation: " PID_F " allocated for our use %lu bytes at %p\n", pid,
603 (unsigned long)static_mem_size, state->memory);
604
605 // "All" we need now is the shared memory. First, let's generate the local version for it.
606 @@ -1045,7 +1046,7 @@
607 return false;
608 } else {
609 // The allocation failed. What can you do except kill the process?
610 - dlog("handle_memory_allocation: "PID_F" our memory allocation failed with error. Kill process. %s\n", pid,
611 + dlog("handle_memory_allocation: " PID_F " our memory allocation failed with error. Kill process. %s\n", pid,
612 strerror(ptlib_get_error(pid, sc_num)) );
613 ptlib_continue( PTRACE_KILL, pid, 0 );
614 return false;
615 @@ -1088,7 +1089,7 @@
616 ptlib_generate_syscall( pid, PREF_MMAP, (char *)state->memory+ptlib_prepare_memory_len() );
617 } else {
618 // open failed
619 - dlog( "handle_memory_allocation: "PID_F" process failed to open %s: %s\n", pid, state->shared_mem_local.getc(),
620 + dlog( "handle_memory_allocation: " PID_F " process failed to open %s: %s\n", pid, state->shared_mem_local.getc(),
621 strerror(ptlib_get_error(pid, sc_num)) );
622 ptlib_continue( PTRACE_KILL, pid, 0 );
623 return false;
624 @@ -1105,7 +1106,7 @@
625 if( ptlib_success( pid, sc_num ) ) {
626 // mmap succeeded
627 state->shared_memory=(void *)(ptlib_get_retval( pid )+ptlib_prepare_memory_len());
628 - dlog("handle_memory_allocation: "PID_F" allocated for our use %lu shared bytes at %p\n", pid,
629 + dlog("handle_memory_allocation: " PID_F " allocated for our use %lu shared bytes at %p\n", pid,
630 (unsigned long)shared_mem_size, (char *)state->shared_memory-ptlib_prepare_memory_len());
631
632 // We now need to close the file descriptor
633 @@ -1113,7 +1114,7 @@
634
635 return ptlib_generate_syscall( pid, SYS_close, state->shared_memory );
636 } else {
637 - dlog( "handle_memory_allocation: "PID_F" process failed to mmap memory: %s\n", pid, strerror(ptlib_get_error(pid, sc_num) ) );
638 + dlog( "handle_memory_allocation: " PID_F " process failed to mmap memory: %s\n", pid, strerror(ptlib_get_error(pid, sc_num) ) );
639
640 ptlib_continue( PTRACE_KILL, pid, 0 );
641 return false;
642 @@ -1128,7 +1129,7 @@
643 // Close done - we can revert to whatever we were previously doing
644 if( !ptlib_success( pid, sc_num ) ) {
645 // If close failed, we'll log the error and leak the file descriptor, but otherwise do nothing about it
646 - dlog( "handle_memory_allocation: "PID_F" procss close failed: %s\n", pid, strerror(ptlib_get_error(pid, sc_num) ) );
647 + dlog( "handle_memory_allocation: " PID_F " procss close failed: %s\n", pid, strerror(ptlib_get_error(pid, sc_num) ) );
648 }
649 return ptlib_generate_syscall( pid, state->orig_sc , state->shared_memory );
650 case 8:
651 @@ -1137,14 +1138,14 @@
652 ptlib_restore_state( pid, state->saved_state );
653 state->state=pid_state::NONE;
654
655 - dlog("handle_memory_allocation: "PID_F" restore state and call handler for syscall %d\n", pid, sc_num );
656 + dlog("handle_memory_allocation: " PID_F " restore state and call handler for syscall %d\n", pid, sc_num );
657 }
658 break;
659 case 25:
660 // Close done - we now need to deallocate the previous shared mem
661 if( !ptlib_success( pid, sc_num ) ) {
662 // If close failed, we'll log the error and leak the file descriptor, but otherwise do nothing about it
663 - dlog( "handle_memory_allocation: "PID_F" procss close failed: %s\n", pid, strerror(ptlib_get_error(pid, sc_num) ) );
664 + dlog( "handle_memory_allocation: " PID_F " procss close failed: %s\n", pid, strerror(ptlib_get_error(pid, sc_num) ) );
665 }
666
667 ptlib_set_argument( pid, 1, state->context_state[2]-ptlib_prepare_memory_len() );
668 @@ -1159,7 +1160,7 @@
669 // Munmap done
670 if( !ptlib_success( pid, sc_num ) ) {
671 // Again, if the unmap failed, we'll log it but otherwise continue
672 - dlog( "handle_memory_allocation: "PID_F" process munmap failed: %s\n", pid, strerror( ptlib_get_error(pid, sc_num) ) );
673 + dlog( "handle_memory_allocation: " PID_F " process munmap failed: %s\n", pid, strerror( ptlib_get_error(pid, sc_num) ) );
674 }
675
676 // Restart the original system call
677 @@ -1173,10 +1174,10 @@
678 bool sys_mmap( int sc_num, pid_t pid, pid_state *state )
679 {
680 if( state->state==pid_state::NONE ) {
681 - dlog("mmap: "PID_F" direct call\n", pid);
682 + dlog("mmap: " PID_F " direct call\n", pid);
683 state->state=pid_state::RETURN;
684 } else if( state->state==pid_state::RETURN ) {
685 - dlog("mmap: "PID_F" direct return\n", pid);
686 + dlog("mmap: " PID_F " direct return\n", pid);
687 state->state=pid_state::NONE;
688 }
689
690 @@ -1209,7 +1210,7 @@
691 dlog("PID\tParent\tState\n");
692
693 for( map_class<pid_t, pid_state>::const_iterator i=state.begin(); i!=state.end(); ++i ) {
694 - dlog(PID_F"\t"PID_F"\t%s", i->first, i->second.parent, state2str(i->second.state) );
695 + dlog(PID_F "\t" PID_F "\t%s", i->first, i->second.parent, state2str(i->second.state) );
696
697 if( i->second.state==pid_state::ZOMBIE ) {
698 dlog("(%d)", (int)i->second.context_state[0]);
699 --- process.cpp
700 +++ process.cpp
701 @@ -95,7 +95,7 @@
702 if( (flags&CLONE_PTRACE)!=0 )
703 state->context_state[0]|=NEW_PROCESS_SAME_DEBUGGER;
704
705 - dlog(PID_F": clone called with flags %lx\n", pid, (unsigned long)flags );
706 + dlog(PID_F ": clone called with flags %lx\n", pid, (unsigned long)flags );
707
708 // Whatever it originally was, add a CLONE_PTRACE to the flags so that we remain in control
709 flags|=CLONE_PTRACE;
710 @@ -107,10 +107,10 @@
711
712 if( ptlib_success( pid, state->orig_sc ) ) {
713 pid_t newpid=(pid_t)ptlib_get_retval( pid );
714 - dlog(PID_F": clone succeeded, new process "PID_F"\n", pid, newpid );
715 + dlog(PID_F ": clone succeeded, new process " PID_F "\n", pid, newpid );
716 handle_new_process( pid, newpid );
717 } else {
718 - dlog(PID_F": clone failed: %s\n", pid, strerror( ptlib_get_error( pid, state->orig_sc ) ) );
719 + dlog(PID_F ": clone failed: %s\n", pid, strerror( ptlib_get_error( pid, state->orig_sc ) ) );
720 }
721 }
722
723 @@ -133,7 +133,7 @@
724 if( log_level>0 ) {
725 char cmd[PATH_MAX];
726 ptlib_get_string( pid, (void *)ptlib_get_argument( pid, 1 ), cmd, sizeof(cmd) );
727 - dlog("execve: "PID_F" calling execve for executing %s\n", pid, cmd );
728 + dlog("execve: " PID_F " calling execve for executing %s\n", pid, cmd );
729 dlog(NULL);
730 }
731
732 @@ -156,7 +156,7 @@
733 state->state=pid_state::NONE;
734
735 if( ptlib_success( pid, sc_num ) && state->context_state[1]==0 ) {
736 - dlog("execve: "PID_F" successfully execed a new command\n", pid );
737 + dlog("execve: " PID_F " successfully execed a new command\n", pid );
738
739 // All memory allocations performed before the exec are now null and void
740 state->memory=NULL;
741 @@ -175,15 +175,15 @@
742 }
743 #endif
744 } else if( state->context_state[1]!=0 ) {
745 - dlog("execve: "PID_F" chroot translation forced error on us: %s\n", pid, strerror(state->context_state[1]) );
746 + dlog("execve: " PID_F " chroot translation forced error on us: %s\n", pid, strerror(state->context_state[1]) );
747
748 ptlib_set_error( pid, state->orig_sc, state->context_state[1] );
749 } else {
750 - dlog("execve: "PID_F" failed with error %s\n", pid, strerror(ptlib_get_error(pid, sc_num)) );
751 + dlog("execve: " PID_F " failed with error %s\n", pid, strerror(ptlib_get_error(pid, sc_num)) );
752 }
753 } else {
754 state->state=pid_state::NONE;
755 - dlog("execve: "PID_F" absorbed dummy SIGTRAP after successful execve\n", pid );
756 + dlog("execve: " PID_F " absorbed dummy SIGTRAP after successful execve\n", pid );
757
758 // If the trace mode is not SYSCALL, the post handling will not generate a TRACE. If PTLIB_TRAP_AFTER_EXEC is set,
759 // a trace is required, however, even if not in TRACE_SYSCALL
760 @@ -328,7 +328,7 @@
761 if( child_state->state==pid_state::ZOMBIE ) {
762 // We can dispense with the pid entry
763 delete_state(child->pid());
764 - dlog("%s: Child "PID_F" removed from process table\n", __func__, child->pid() );
765 + dlog("%s: Child " PID_F " removed from process table\n", __func__, child->pid() );
766 child_state=NULL;
767 }
768
769 @@ -367,7 +367,7 @@
770
771 state->state=pid_state::REDIRECT2;
772 } else {
773 - dlog("wait4: "PID_F" hanged in wait for %d\n", pid, wait_pid );
774 + dlog("wait4: " PID_F " hanged in wait for %d\n", pid, wait_pid );
775 }
776 }
777
778 --- ptrace.cpp
779 +++ ptrace.cpp
780 @@ -37,13 +37,13 @@
781 pid_state *child_state=lookup_state( traced );
782 if( child_state==NULL || child_state->debugger!=pid )
783 {
784 - dlog("ptrace verify_permission: %d failed permission - not the debugger for "PID_F"\n", pid, traced);
785 + dlog("ptrace verify_permission: %d failed permission - not the debugger for " PID_F "\n", pid, traced);
786 errno=ESRCH;
787 return false;
788 }
789 if( child_state->trace_mode!=TRACE_STOPPED1 && child_state->trace_mode!=TRACE_STOPPED2 )
790 {
791 - dlog("ptrace verify_permission: %d failed permission - "PID_F" is not stopped\n", pid, traced);
792 + dlog("ptrace verify_permission: %d failed permission - " PID_F " is not stopped\n", pid, traced);
793 errno=ESRCH;
794 return false;
795 }
796 @@ -57,10 +57,10 @@
797 pid_state *parent_state=lookup_state( debugger );
798
799 if( child_state==NULL || parent_state==NULL || child_state->debugger!=0 ) {
800 - dlog("begin_trace: %d Failed to start trace for "PID_F": child_state=%p, parent_state=%p", debugger, child, child_state,
801 + dlog("begin_trace: %d Failed to start trace for " PID_F ": child_state=%p, parent_state=%p", debugger, child, child_state,
802 parent_state );
803 if( child_state!=NULL ) {
804 - dlog("child_state debugger="PID_F, child_state->debugger);
805 + dlog("child_state debugger=" PID_F, child_state->debugger);
806 }
807 dlog("\n");
808
809 @@ -82,10 +82,10 @@
810 __ptrace_request req=(__ptrace_request)state->context_state[0];
811 if( req==PTRACE_CONT ) {
812 child_state->trace_mode|=TRACE_CONT;
813 - dlog("ptrace: %d PTRACE_CONT("PID_F")\n", pid, child );
814 + dlog("ptrace: %d PTRACE_CONT(" PID_F ")\n", pid, child );
815 } else if( req==PTRACE_SYSCALL ) {
816 child_state->trace_mode|=TRACE_SYSCALL;
817 - dlog("ptrace: %d PTRACE_SYSCALL("PID_F")\n", pid, child );
818 + dlog("ptrace: %d PTRACE_SYSCALL(" PID_F ")\n", pid, child );
819 } else if( req==PTRACE_DETACH ) {
820 child_state->trace_mode&=TRACE_MASK2;
821 } else {
822 @@ -95,7 +95,7 @@
823 long rc=0;
824
825 if( (child_state->trace_mode&TRACE_MASK2)==TRACE_STOPPED1 ) {
826 - dlog("handle_cont_syscall: "PID_F" process "PID_F" was in pre-syscall hook\n", pid, child );
827 + dlog("handle_cont_syscall: " PID_F " process " PID_F " was in pre-syscall hook\n", pid, child );
828 // Need to restart the syscall
829 int status=child_state->context_state[1];
830 PTLIB_WAIT_RET wait_state=(PTLIB_WAIT_RET)child_state->context_state[0];
831 @@ -109,14 +109,14 @@
832 rc=ptlib_continue(PTRACE_SYSCALL, child, sig);
833 }
834 } else if( (child_state->trace_mode&TRACE_MASK2)==TRACE_STOPPED2 ) {
835 - dlog("handle_cont_syscall: "PID_F" process "PID_F" was in post-syscall hook\n", pid, child );
836 + dlog("handle_cont_syscall: " PID_F " process " PID_F " was in post-syscall hook\n", pid, child );
837 child_state->trace_mode&=TRACE_MASK1;
838 rc=ptlib_continue( PTRACE_SYSCALL, child, (int)state->context_state[3] );
839 } else {
840 // Our child was not stopped (at least, by us)
841 // This is an internal inconsistency
842
843 - dlog("handle_cont_syscall: "PID_F" process "PID_F" was started with no specific state (%x)\n", pid, child,
844 + dlog("handle_cont_syscall: " PID_F " process " PID_F " was started with no specific state (%x)\n", pid, child,
845 child_state->trace_mode );
846 dlog(NULL);
847 rc=-1;
848 @@ -143,7 +143,7 @@
849 static bool handle_detach( pid_t pid, pid_state *state )
850 {
851 if( verify_permission( pid, state ) ) {
852 - dlog("ptrace: %d PTRACE_DETACH("PID_F")\n", pid, (pid_t)state->context_state[1]);
853 + dlog("ptrace: %d PTRACE_DETACH(" PID_F ")\n", pid, (pid_t)state->context_state[1]);
854
855 pid_state *child_state=lookup_state((pid_t)state->context_state[1]);
856
857 @@ -167,13 +167,13 @@
858 pid_t child=(pid_t)state->context_state[1];
859
860 if( verify_permission( pid, state ) ) {
861 - dlog("handle_kill: %d is sending a kill to "PID_F"\n", pid, child );
862 + dlog("handle_kill: %d is sending a kill to " PID_F "\n", pid, child );
863
864 ptlib_continue(PTRACE_KILL, child, 0);
865 ptlib_set_retval( pid, 0 );
866 } else {
867 ptlib_set_error( pid, state->orig_sc, errno );
868 - dlog("handle_kill: %d tried to kill "PID_F": %s\n", pid, child, strerror(errno));
869 + dlog("handle_kill: %d tried to kill " PID_F ": %s\n", pid, child, strerror(errno));
870 }
871 }
872
873 @@ -185,7 +185,7 @@
874 errno=0;
875 long data=ptrace( (__ptrace_request)state->context_state[0], child, state->context_state[2], 0 );
876 if( data!=-1 || errno==0 ) {
877 - dlog("handle_peek_data: %d is peeking data from "PID_F" at address %p\n", pid, child, (void*)state->context_state[2] );
878 + dlog("handle_peek_data: %d is peeking data from " PID_F " at address %p\n", pid, child, (void*)state->context_state[2] );
879
880 // Write the result where applicable
881 // XXX This may be a Linux only semantics - pass addres to write result to as "data" argument
882 @@ -199,7 +199,7 @@
883 }
884 } else {
885 ptlib_set_error( pid, state->orig_sc, errno );
886 - dlog("handle_peek_data: %d tried get data from "PID_F": %s\n", pid, child, strerror(errno));
887 + dlog("handle_peek_data: %d tried get data from " PID_F ": %s\n", pid, child, strerror(errno));
888 }
889 }
890
891 @@ -210,11 +210,11 @@
892 if( verify_permission( pid, state ) &&
893 ptrace( (__ptrace_request)state->context_state[0], child, state->context_state[2], state->context_state[3] )==0 )
894 {
895 - dlog("handle_poke_data: %d is pokeing data in "PID_F" at address %p\n", pid, child, (void*)state->context_state[2] );
896 + dlog("handle_poke_data: %d is pokeing data in " PID_F " at address %p\n", pid, child, (void*)state->context_state[2] );
897 ptlib_set_retval( pid, 0 );
898 } else {
899 ptlib_set_error( pid, state->orig_sc, errno );
900 - dlog("handle_poke_data: %d tried push data to "PID_F": %s\n", pid, child, strerror(errno));
901 + dlog("handle_poke_data: %d tried push data to " PID_F ": %s\n", pid, child, strerror(errno));
902 }
903 }
904
905 @@ -228,7 +228,7 @@
906 state->context_state[2]=ptlib_get_argument( pid, 3 ); // addr
907 state->context_state[3]=ptlib_get_argument( pid, 4 ); // data
908
909 - dlog("ptrace: "PID_F" ptrace( %d, "PID_F", %p, %p )\n", pid, (int)state->context_state[0], (pid_t)state->context_state[1],
910 + dlog("ptrace: " PID_F " ptrace( %d, " PID_F ", %p, %p )\n", pid, (int)state->context_state[0], (pid_t)state->context_state[1],
911 (void*)state->context_state[2], (void*)state->context_state[3] );
912
913 ptlib_set_syscall( pid, PREF_NOP );
914 @@ -240,7 +240,7 @@
915 switch( state->context_state[0] ) {
916 case PTRACE_TRACEME:
917 if( begin_trace( state->parent, pid ) ) {
918 - dlog("ptrace: %d PTRACE_TRACEME parent "PID_F"\n", pid, state->parent );
919 + dlog("ptrace: %d PTRACE_TRACEME parent " PID_F "\n", pid, state->parent );
920 ptlib_set_retval( pid, 0 );
921 } else {
922 dlog("ptrace: %d PTRACE_TRACEME failed %s\n", pid, strerror(errno) );
923 @@ -249,10 +249,10 @@
924 break;
925 case PTRACE_ATTACH:
926 if( begin_trace( pid, (pid_t)state->context_state[1] ) ) {
927 - dlog("ptrace: "PID_F" PTRACE_ATTACH("PID_F") succeeded\n", pid, (pid_t)state->context_state[1] );
928 + dlog("ptrace: " PID_F " PTRACE_ATTACH(" PID_F ") succeeded\n", pid, (pid_t)state->context_state[1] );
929 ptlib_set_retval( pid, 0 );
930 } else {
931 - dlog("ptrace: "PID_F" PTRACE_ATTACH("PID_F") failed %s\n", pid, (pid_t)state->context_state[1], strerror(errno) );
932 + dlog("ptrace: " PID_F " PTRACE_ATTACH(" PID_F ") failed %s\n", pid, (pid_t)state->context_state[1], strerror(errno) );
933 ptlib_set_error( pid, state->orig_sc, errno );
934 }
935 break;
936 @@ -293,7 +293,7 @@
937 case PTRACE_SINGLESTEP:
938 // We do not support single step right now
939 ptlib_set_error( pid, state->orig_sc, EINVAL );
940 - dlog("ptrace: "PID_F" tried to call SINGLESTEP on "PID_F"\n", pid, (pid_t)state->context_state[1]);
941 + dlog("ptrace: " PID_F " tried to call SINGLESTEP on " PID_F "\n", pid, (pid_t)state->context_state[1]);
942 break;
943 case PTRACE_CONT:
944 case PTRACE_SYSCALL:
945 @@ -306,7 +306,7 @@
946 handle_detach( pid, state );
947 break;
948 default:
949 - dlog("ptrace: "PID_F" Unsupported option %lx\n", pid, state->context_state[0] );
950 + dlog("ptrace: " PID_F " Unsupported option %lx\n", pid, state->context_state[0] );
951 ptlib_set_error(pid, state->orig_sc, EINVAL);
952 break;
953 }