2 \\ cvs -d:pserver:anonymous@strace.cvs.sourceforge.net:/cvsroot/strace diff -u -rv4_5_18 strace > ../buildroot.git.pentium4/package/strace/strace-4.5.18-xxx-010-update_to_trunk.patch
4 Index: strace/ChangeLog
5 ===================================================================
6 RCS file: /cvsroot/strace/strace/ChangeLog,v
7 retrieving revision 1.570
8 retrieving revision 1.590
9 diff -u -r1.570 -r1.590
10 --- strace/ChangeLog 28 Aug 2008 22:00:46 -0000 1.570
11 +++ strace/ChangeLog 10 Dec 2008 13:51:40 -0000 1.590
13 +2008-11-11 Dmitry V. Levin <ldv@altlinux.org>
15 + * sock.c [LINUX] (sock_ioctl): Parse more SIOCS* ioctls.
17 +2008-12-09 Roland McGrath <roland@redhat.com>
19 + * strace.1 (DIAGNOSTICS): New section, describe exit behavior.
21 +2008-11-09 Dmitry V. Levin <ldv@altlinux.org>
23 + * process.c (prctl_options): Update constants from linux 2.6.27.
24 + * system.c (capabilities): Add more capability values.
26 + * util.c (string_quote): Fix support for NUL-terminated string.
28 + (printpathn): Fix the case when "..." was appended to the output
29 + but no truncation was actually made. Add comments.
30 + (printstr): Fix memory allocation. Fix two cases when "..." was
31 + appended to the output but no truncation was actually made.
35 +2008-10-23 Dmitry V. Levin <ldv@altlinux.org>
37 + Implement parsers for new linux syscalls.
38 + * desc.c (do_dup2, [LINUX] sys_dup3): New functions.
39 + (sys_dup2): Use do_dup2.
40 + [LINUX] (sys_epoll_create1): New function.
41 + [LINUX] (do_eventfd, sys_eventfd2): New functions.
42 + [LINUX] (sys_eventfd): Use do_eventfd.
43 + * net.c (do_pipe, [LINUX] sys_pipe2): New functions.
44 + (sys_pipe): Use do_pipe.
45 + * signal.c [LINUX] (do_signalfd, sys_signalfd4): New functions.
46 + [LINUX] (sys_signalfd): Use do_signalfd.
47 + * linux/syscall.h: Declare new sys_* functions.
48 + * linux/syscallent.h: Hook up signalfd4, eventfd2, epoll_create1,
49 + dup3, pipe2, inotify_init1.
50 + * linux/x86_64/syscallent.h: Hook up paccept, signalfd4, eventfd2,
51 + epoll_create1, dup3, pipe2, inotify_init1.
53 +2008-10-23 Mike Frysinger <vapier@gentoo.org>
55 + Port strace to the Blackfin architecture.
56 + * configure.ac: Add bfin to supported architectures.
57 + * process.c: Skip u_fpvalid/u_fpstate for Blackfin architecture.
58 + (change_syscall): Support Blackfin architecture.
59 + * syscall.c: Declare r0 for Blackfin architecture.
60 + (get_scno): Decode Blackfin syscall number.
61 + (syscall_fixup): Extract Blackfin return value.
62 + (get_error): Decode Blackfin return value.
63 + (force_result): Poke Blackfin return value.
64 + (syscall_enter): Extract Blackfin syscall arguments.
65 + * defs.h: Define TCB_WAITEXECVE for Blackfin architecture.
66 + * linux/syscall.h (sys_sram_alloc): Declare for Blackfin
68 + * system.c (sys_sram_alloc): Decode Blackfin sram_alloc() syscall.
69 + * util.c (getpc): Handle PC on Blackfin architecture.
70 + (printcall): Likewise.
71 + * linux/bfin/ioctlent.h, linux/bfin/syscallent.h: New Blackfin
73 + * Makefile.am (EXTRA_DIST): Add linux/bfin/ioctlent.h and
74 + linux/bfin/syscallent.h.
76 +2008-09-18 Mike Frysinger <vapier@gentoo.org>
78 + * configure.ac: Accept uclinux hosts as linux.
80 +2008-10-22 Dmitry V. Levin <ldv@altlinux.org>
82 + Handle socket type flags introduced in linux 2.6.27.
83 + * net.c (socktypes): Add SOCK_DCCP.
84 + (sock_type_flags): New xlat structure.
85 + (tprint_sock_type): New function.
86 + (sys_socket, sys_socketpair): Use it to parse socket type and
89 +2008-09-29 Dmitry V. Levin <ldv@altlinux.org>
91 + * strace.c (startup_child): Save child pid for future use.
92 + (main): Exit/kill ourself with straced child's exitcode/signal.
93 + (trace): If signalled process pid matches the saved child pid,
94 + save the signal number. If terminated process pid matches the
95 + saved child pid, save its exit status.
96 + Patch from Denys Vlasenko <dvlasenk@redhat.com>
99 +2008-09-12 Tomas Pospisek <tpo@sourcepole.ch>
100 + Jan Kratochvil <jan.kratochvil@redhat.com>
102 + * strace.1 (DESCRIPTION): New description of unfinished system calls
103 + and system calls restarting.
105 +2008-09-03 Dmitry V. Levin <ldv@altlinux.org>
107 + * desc.c (sys_fcntl): Do not initialize auxstr for failed syscall.
108 + * process.c (sys_fork, sys_rfork) [USE_PROCFS]: Likewise.
109 + * signal.c (sys_signal): Likewise.
110 + * stream.c (internal_stream_ioctl): Likewise.
111 + * time.c (sys_adjtimex): Likewise.
112 + * syscall.c (trace_syscall): If RVAL_STR is set, then
113 + print auxstr for failed syscall as well.
115 + * syscall.c (is_restart_error): New function.
116 + * defs.h (is_restart_error): Declare it.
118 + * linux/dummy.h (sys_nanosleep): Uncouple from sys_adjtime().
119 + * time.c (sys_nanosleep): New function, based on is_restart_error().
121 + * process.c (sys_prctl): Decode PR_SET_PDEATHSIG, PR_GET_PDEATHSIG,
122 + PR_SET_DUMPABLE, PR_GET_DUMPABLE, PR_SET_KEEPCAPS, PR_GET_KEEPCAPS.
123 + Fix PR_GET_UNALIGN decoder.
124 + (prctl_options): Add more constants.
126 + * linux/syscallent.h: Use sys_prctl() decoder for "prctl" syscall.
127 + * linux/alpha/syscallent.h: Likewise.
128 + * linux/arm/syscallent.h: Likewise.
129 + * linux/m68k/syscallent.h: Likewise.
130 + * linux/powerpc/syscallent.h: Likewise.
131 + * linux/s390/syscallent.h: Likewise.
132 + * linux/s390x/syscallent.h: Likewise.
133 + * linux/sh/syscallent.h: Likewise.
134 + * linux/sh64/syscallent.h: Likewise.
135 + * linux/x86_64/syscallent.h: Likewise.
137 +2008-09-02 Dmitry V. Levin <ldv@altlinux.org>
139 + * linux/x86_64/syscallent.h: Fix syscall numbers for "tee" and
141 + From Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
143 2008-08-28 Roland McGrath <roland@redhat.com>
145 + * strace.1 (BUGS): New section, mention SIGTRAP interference.
147 + * strace.spec (%ifarch %{strace64_arches}): Use cp -p instead of ln
150 * configure.ac, NEWS: Version 4.5.18.
151 * strace.spec: 4.5.18-1.
153 Index: strace/Makefile.am
154 ===================================================================
155 RCS file: /cvsroot/strace/strace/Makefile.am,v
156 retrieving revision 1.19
157 retrieving revision 1.20
158 diff -u -r1.19 -r1.20
159 --- strace/Makefile.am 1 Aug 2008 01:15:24 -0000 1.19
160 +++ strace/Makefile.am 10 Nov 2008 22:21:41 -0000 1.20
162 linux/arm/syscallent.h linux/arm/syscallent1.h \
163 linux/arm/signalent1.h linux/arm/ioctlent1.h \
164 linux/arm/errnoent1.h \
165 + linux/bfin/ioctlent.h linux/bfin/syscallent.h \
166 linux/hppa/errnoent.h linux/hppa/ioctlent.h \
167 linux/hppa/signalent.h linux/hppa/syscallent.h \
168 linux/ia64/syscallent.h linux/ia64/errnoent.h \
169 Index: strace/configure.ac
170 ===================================================================
171 RCS file: /cvsroot/strace/strace/configure.ac,v
172 retrieving revision 1.57
173 retrieving revision 1.59
174 diff -u -r1.57 -r1.59
175 --- strace/configure.ac 28 Aug 2008 22:00:46 -0000 1.57
176 +++ strace/configure.ac 10 Nov 2008 22:21:41 -0000 1.59
179 AC_MSG_CHECKING([for supported operating system])
184 AC_DEFINE([LINUX], 1, [Define for the Linux operating system.])
188 AC_MSG_CHECKING([for supported architecture])
192 + AC_DEFINE([BFIN], 1, [Define for the Blackfin architecture.])
196 AC_DEFINE([I386], 1, [Define for the i386 architecture.])
198 ===================================================================
199 RCS file: /cvsroot/strace/strace/defs.h,v
200 retrieving revision 1.83
201 retrieving revision 1.85
202 diff -u -r1.83 -r1.85
203 --- strace/defs.h 1 Aug 2008 01:06:31 -0000 1.83
204 +++ strace/defs.h 10 Nov 2008 22:21:41 -0000 1.85
206 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
207 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
209 - * $Id: defs.h,v 1.83 2008/08/01 01:06:31 roland Exp $
210 + * $Id: defs.h,v 1.85 2008/11/10 22:21:41 ldv Exp $
215 #define TCB_FOLLOWFORK 00400 /* Process should have forks followed */
216 #define TCB_REPRINT 01000 /* We should reprint this syscall on exit */
218 -# if defined(ALPHA) || defined(SPARC) || defined(SPARC64) || defined(POWERPC) || defined(IA64) || defined(HPPA) || defined(SH) || defined(SH64) || defined(S390) || defined(S390X) || defined(ARM) || defined(MIPS)
219 +# if defined(ALPHA) || defined(SPARC) || defined(SPARC64) || defined(POWERPC) || defined(IA64) || defined(HPPA) || defined(SH) || defined(SH64) || defined(S390) || defined(S390X) || defined(ARM) || defined(MIPS) || defined(BFIN)
220 # define TCB_WAITEXECVE 02000 /* ignore SIGTRAP after exceve */
222 # define TCB_CLONE_DETACHED 04000 /* CLONE_DETACHED set in creating syscall */
224 extern void call_summary P((FILE *));
225 extern void tprint_iov P((struct tcb *, unsigned long, unsigned long));
226 extern void tprint_open_modes P((struct tcb *, mode_t));
227 +extern int is_restart_error P((struct tcb *));
230 extern int internal_clone P((struct tcb *));
232 ===================================================================
233 RCS file: /cvsroot/strace/strace/desc.c,v
234 retrieving revision 1.33
235 retrieving revision 1.35
236 diff -u -r1.33 -r1.35
237 --- strace/desc.c 1 Nov 2007 21:52:20 -0000 1.33
238 +++ strace/desc.c 10 Nov 2008 22:53:02 -0000 1.35
240 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
241 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
243 - * $Id: desc.c,v 1.33 2007/11/01 21:52:20 roland Exp $
244 + * $Id: desc.c,v 1.35 2008/11/10 22:53:02 ldv Exp $
252 +extern const struct xlat open_mode_flags[];
255 * low bits of the open(2) flags define access mode,
256 * other bits are real flags.
258 sprint_open_modes(mode_t flags)
260 extern const struct xlat open_access_modes[];
261 - extern const struct xlat open_mode_flags[];
262 static char outstr[1024];
263 const char *str = xlookup(open_access_modes, flags & 3);
264 const char *sep = "";
265 @@ -332,12 +333,14 @@
266 case F_SETOWN: case F_GETOWN:
269 - if (tcp->u_rval == 0)
270 + if (syserror(tcp) || tcp->u_rval == 0)
273 sprintflags("flags ", fdflags, tcp->u_rval);
274 return RVAL_HEX|RVAL_STR;
278 tcp->auxstr = sprint_open_modes(tcp->u_rval);
279 return RVAL_HEX|RVAL_STR;
281 @@ -394,16 +397,33 @@
289 +do_dup2(struct tcb *tcp, int flags_arg)
292 tprintf("%ld, %ld", tcp->u_arg[0], tcp->u_arg[1]);
293 + if (flags_arg >= 0) {
295 + printflags(open_mode_flags, tcp->u_arg[flags_arg], "O_???");
302 +sys_dup2(struct tcb *tcp)
304 + return do_dup2(tcp, -1);
309 +sys_dup3(struct tcb *tcp)
311 + return do_dup2(tcp, 2);
315 #if defined(ALPHA) || defined(FREEBSD) || defined(SUNOS4)
317 sys_getdtablesize(tcp)
318 @@ -603,14 +623,21 @@
322 -sys_epoll_create(tcp)
324 +sys_epoll_create(struct tcb *tcp)
327 tprintf("%ld", tcp->u_arg[0]);
332 +sys_epoll_create1(struct tcb *tcp)
335 + printflags(open_mode_flags, tcp->u_arg[0], "O_???");
339 #ifdef HAVE_SYS_EPOLL_H
341 print_epoll_event(ev)
342 @@ -887,12 +914,28 @@
350 +do_eventfd(struct tcb *tcp, int flags_arg)
353 + if (entering(tcp)) {
354 tprintf("%lu", tcp->u_arg[0]);
355 + if (flags_arg >= 0) {
357 + printflags(open_mode_flags, tcp->u_arg[flags_arg], "O_???");
364 +sys_eventfd(struct tcb *tcp)
366 + return do_eventfd(tcp, -1);
370 +sys_eventfd2(struct tcb *tcp)
372 + return do_eventfd(tcp, 1);
376 ===================================================================
377 RCS file: /cvsroot/strace/strace/net.c,v
378 retrieving revision 1.56
379 retrieving revision 1.58
380 diff -u -r1.56 -r1.58
381 --- strace/net.c 1 Nov 2007 21:37:33 -0000 1.56
382 +++ strace/net.c 10 Nov 2008 22:53:02 -0000 1.58
384 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
385 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
387 - * $Id: net.c,v 1.56 2007/11/01 21:37:33 roland Exp $
388 + * $Id: net.c,v 1.58 2008/11/10 22:53:02 ldv Exp $
392 @@ -320,17 +320,32 @@
394 { SOCK_RAW, "SOCK_RAW" },
397 + { SOCK_RDM, "SOCK_RDM" },
399 #ifdef SOCK_SEQPACKET
400 { SOCK_SEQPACKET,"SOCK_SEQPACKET"},
403 - { SOCK_RDM, "SOCK_RDM" },
405 + { SOCK_DCCP, "SOCK_DCCP" },
408 { SOCK_PACKET, "SOCK_PACKET" },
412 +const struct xlat sock_type_flags[] = {
414 + { SOCK_CLOEXEC, "SOCK_CLOEXEC" },
416 +#ifdef SOCK_NONBLOCK
417 + { SOCK_NONBLOCK,"SOCK_NONBLOCK" },
421 +#ifndef SOCK_TYPE_MASK
422 +# define SOCK_TYPE_MASK 0xf
424 static const struct xlat socketlayers[] = {
426 { SOL_IP, "SOL_IP" },
427 @@ -1182,14 +1197,33 @@
429 #endif /* HAVE_SENDMSG */
432 + * low bits of the socket type define real socket type,
433 + * other bits are socket type flags.
436 +tprint_sock_type(struct tcb *tcp, int flags)
438 + const char *str = xlookup(socktypes, flags & SOCK_TYPE_MASK);
442 + tprintf("%s", str);
443 + flags &= ~SOCK_TYPE_MASK;
448 + printflags(sock_type_flags, flags, "SOCK_???");
454 +sys_socket(struct tcb *tcp)
457 printxval(domains, tcp->u_arg[0], "PF_???");
459 - printxval(socktypes, tcp->u_arg[1], "SOCK_???");
460 + tprint_sock_type(tcp, tcp->u_arg[1]);
462 switch (tcp->u_arg[0]) {
464 @@ -1463,34 +1497,52 @@
465 return sys_accept(tcp);
473 -#if defined(LINUX) && !defined(SPARC) && !defined(SPARC64) && !defined(SH) && !defined(IA64)
475 +extern const struct xlat open_mode_flags[];
478 +do_pipe(struct tcb *tcp, int flags_arg)
482 tprintf("%#lx", tcp->u_arg[0]);
485 - if (umoven(tcp, tcp->u_arg[0], sizeof fds, (char *) fds) < 0)
488 - tprintf("[%u, %u]", fds[0], fds[1]);
491 +#if defined(LINUX) && !defined(SPARC) && !defined(SPARC64) && !defined(SH) && !defined(IA64)
494 + if (umoven(tcp, tcp->u_arg[0], sizeof fds, (char *) fds) < 0)
497 + tprintf("[%u, %u]", fds[0], fds[1]);
498 #elif defined(SPARC) || defined(SPARC64) || defined(SH) || defined(SVR4) || defined(FREEBSD) || defined(IA64)
500 - tprintf("[%lu, %lu]", tcp->u_rval, getrval2(tcp));
501 + tprintf("[%lu, %lu]", tcp->u_rval, getrval2(tcp));
503 + tprintf("%#lx", tcp->u_arg[0]);
506 + if (flags_arg >= 0) {
508 + printflags(open_mode_flags, tcp->u_arg[flags_arg], "O_???");
517 +sys_pipe(struct tcb *tcp)
519 + return do_pipe(tcp, -1);
524 +sys_pipe2(struct tcb *tcp)
526 + return do_pipe(tcp, 1);
531 +sys_socketpair(struct tcb *tcp)
535 @@ -1499,7 +1551,7 @@
537 printxval(domains, tcp->u_arg[0], "PF_???");
539 - printxval(socktypes, tcp->u_arg[1], "SOCK_???");
540 + tprint_sock_type(tcp, tcp->u_arg[1]);
542 switch (tcp->u_arg[0]) {
544 Index: strace/process.c
545 ===================================================================
546 RCS file: /cvsroot/strace/strace/process.c,v
547 retrieving revision 1.113
548 retrieving revision 1.118
549 diff -u -r1.113 -r1.118
550 --- strace/process.c 18 Jul 2008 02:16:47 -0000 1.113
551 +++ strace/process.c 11 Nov 2008 00:25:22 -0000 1.118
553 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
554 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
556 - * $Id: process.c,v 1.113 2008/07/18 02:16:47 roland Exp $
557 + * $Id: process.c,v 1.118 2008/11/11 00:25:22 ldv Exp $
563 { PR_GETNSHARE, "PR_GETNSHARE" },
565 -#if defined(PR_SET_PDEATHSIG)
566 - { PR_SET_PDEATHSIG, "PR_SET_PDEATHSIG" },
569 { PR_COREPID, "PR_COREPID" },
572 #ifdef PR_GET_PDEATHSIG
573 { PR_GET_PDEATHSIG, "PR_GET_PDEATHSIG" },
575 +#ifdef PR_GET_DUMPABLE
576 + { PR_GET_DUMPABLE, "PR_GET_DUMPABLE" },
578 +#ifdef PR_SET_DUMPABLE
579 + { PR_SET_DUMPABLE, "PR_SET_DUMPABLE" },
581 #ifdef PR_GET_UNALIGN
582 { PR_GET_UNALIGN, "PR_GET_UNALIGN" },
584 @@ -211,10 +214,10 @@
585 { PR_SET_UNALIGN, "PR_SET_UNALIGN" },
587 #ifdef PR_GET_KEEPCAPS
588 - { PR_GET_KEEPCAPS, "PR_GET_KEEP_CAPS" },
589 + { PR_GET_KEEPCAPS, "PR_GET_KEEPCAPS" },
591 #ifdef PR_SET_KEEPCAPS
592 - { PR_SET_KEEPCAPS, "PR_SET_KEEP_CAPS" },
593 + { PR_SET_KEEPCAPS, "PR_SET_KEEPCAPS" },
596 { PR_GET_FPEMU, "PR_GET_FPEMU" },
598 #ifdef PR_SET_SECCOMP
599 { PR_SET_SECCOMP, "PR_SET_SECCOMP" },
602 + { PR_GET_TSC, "PR_GET_TSC" },
605 + { PR_SET_TSC, "PR_SET_TSC" },
607 +#ifdef PR_GET_SECUREBITS
608 + { PR_GET_SECUREBITS, "PR_GET_SECUREBITS" },
610 +#ifdef PR_SET_SECUREBITS
611 + { PR_SET_SECUREBITS, "PR_SET_SECUREBITS" },
616 @@ -291,10 +306,24 @@
620 -#ifdef PR_SET_DEATHSIG
621 +#ifdef PR_SET_PDEATHSIG
622 + case PR_SET_PDEATHSIG:
623 + tprintf(", %lu", tcp->u_arg[1]);
626 +#ifdef PR_GET_PDEATHSIG
627 case PR_GET_PDEATHSIG:
630 +#ifdef PR_SET_DUMPABLE
631 + case PR_SET_DUMPABLE:
632 + tprintf(", %lu", tcp->u_arg[1]);
635 +#ifdef PR_GET_DUMPABLE
636 + case PR_GET_DUMPABLE:
639 #ifdef PR_SET_UNALIGN
641 tprintf(", %s", unalignctl_string(tcp->u_arg[1]));
643 tprintf(", %#lx", tcp->u_arg[1]);
646 +#ifdef PR_SET_KEEPCAPS
647 + case PR_SET_KEEPCAPS:
648 + tprintf(", %lu", tcp->u_arg[1]);
651 +#ifdef PR_GET_KEEPCAPS
652 + case PR_GET_KEEPCAPS:
656 for (i = 1; i < tcp->u_nargs; i++)
657 tprintf(", %#lx", tcp->u_arg[i]);
658 @@ -314,23 +352,26 @@
659 switch (tcp->u_arg[0]) {
660 #ifdef PR_GET_PDEATHSIG
661 case PR_GET_PDEATHSIG:
662 - for (i=1; i<tcp->u_nargs; i++)
663 - tprintf(", %#lx", tcp->u_arg[i]);
664 + if (umove(tcp, tcp->u_arg[1], &i) < 0)
665 + tprintf(", %#lx", tcp->u_arg[1]);
667 + tprintf(", {%u}", i);
670 -#ifdef PR_SET_UNALIGN
671 - case PR_SET_UNALIGN:
673 +#ifdef PR_GET_DUMPABLE
674 + case PR_GET_DUMPABLE:
675 + return RVAL_UDECIMAL;
677 #ifdef PR_GET_UNALIGN
682 - umove(tcp, tcp->u_arg[1], &ctl);
683 - tcp->auxstr = unalignctl_string(ctl);
684 + if (syserror(tcp) || umove(tcp, tcp->u_arg[1], &i) < 0)
686 + tcp->auxstr = unalignctl_string(i);
690 +#ifdef PR_GET_KEEPCAPS
691 + case PR_GET_KEEPCAPS:
692 + return RVAL_UDECIMAL;
700 - if (exiting(tcp)) {
701 + if (exiting(tcp) && !syserror(tcp)) {
703 tcp->auxstr = "child process";
704 return RVAL_UDECIMAL | RVAL_STR;
707 tprintf ("%ld", tcp->u_arg[0]);
710 + else if (!syserror(tcp)) {
712 tcp->auxstr = "child process";
713 return RVAL_UDECIMAL | RVAL_STR;
715 if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(REG_A3), new)<0)
719 + if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(REG_P0), new)<0)
725 @@ -3004,7 +3049,7 @@
729 -#if !defined(S390) && !defined(S390X) && !defined(MIPS) && !defined(SPARC64)
730 +#if !defined(S390) && !defined(S390X) && !defined(MIPS) && !defined(SPARC64) && !defined(BFIN)
731 { uoff(u_fpvalid), "offsetof(struct user, u_fpvalid)" },
733 #if defined(I386) || defined(X86_64)
734 @@ -3033,7 +3078,7 @@
735 #if !defined(SPARC64)
736 { uoff(u_ar0), "offsetof(struct user, u_ar0)" },
738 -#if !defined(ARM) && !defined(MIPS) && !defined(S390) && !defined(S390X) && !defined(SPARC64)
739 +#if !defined(ARM) && !defined(MIPS) && !defined(S390) && !defined(S390X) && !defined(SPARC64) && !defined(BFIN)
740 { uoff(u_fpstate), "offsetof(struct user, u_fpstate)" },
742 { uoff(magic), "offsetof(struct user, magic)" },
743 Index: strace/signal.c
744 ===================================================================
745 RCS file: /cvsroot/strace/strace/signal.c,v
746 retrieving revision 1.68
747 retrieving revision 1.70
748 diff -u -r1.68 -r1.70
749 --- strace/signal.c 20 Aug 2008 01:59:40 -0000 1.68
750 +++ strace/signal.c 10 Nov 2008 22:53:03 -0000 1.70
752 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
753 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
755 - * $Id: signal.c,v 1.68 2008/08/20 01:59:40 roland Exp $
756 + * $Id: signal.c,v 1.70 2008/11/10 22:53:03 ldv Exp $
760 @@ -1199,7 +1199,7 @@
765 + else if (!syserror(tcp)) {
766 switch (tcp->u_rval) {
768 tcp->auxstr = "SIG_ERR"; break;
769 @@ -1212,6 +1212,7 @@
771 return RVAL_HEX | RVAL_STR;
777 @@ -2010,15 +2011,32 @@
784 +extern const struct xlat open_mode_flags[];
787 +do_signalfd(struct tcb *tcp, int flags_arg)
790 tprintf("%ld, ", tcp->u_arg[0]);
791 print_sigset(tcp, tcp->u_arg[1], 1);
792 tprintf("%lu", tcp->u_arg[2]);
793 + if (flags_arg >= 0) {
795 + printflags(open_mode_flags, tcp->u_arg[flags_arg], "O_???");
802 +sys_signalfd(struct tcb *tcp)
804 + return do_signalfd(tcp, -1);
808 +sys_signalfd4(struct tcb *tcp)
810 + return do_signalfd(tcp, 3);
814 ===================================================================
815 RCS file: /cvsroot/strace/strace/sock.c,v
816 retrieving revision 1.14
817 retrieving revision 1.15
818 diff -u -r1.14 -r1.15
819 --- strace/sock.c 21 Mar 2007 14:18:19 -0000 1.14
820 +++ strace/sock.c 10 Dec 2008 13:51:40 -0000 1.15
822 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
823 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
825 - * $Id: sock.c,v 1.14 2007/03/21 14:18:19 ldv Exp $
826 + * $Id: sock.c,v 1.15 2008/12/10 13:51:40 ldv Exp $
830 @@ -134,26 +134,38 @@
839 + case SIOCSIFDSTADDR:
841 + case SIOCSIFBRDADDR:
843 + case SIOCSIFNETMASK:
847 + case SIOCSIFMETRIC:
853 + case SIOCSIFHWADDR:
855 + case SIOCSIFTXQLEN:
858 if (umove(tcp, tcp->u_arg[2], &ifr) < 0)
859 tprintf(", %#lx", tcp->u_arg[2]);
860 else if (syserror(tcp)) {
861 - if (code == SIOCGIFNAME)
862 + if (code == SIOCGIFNAME || code == SIOCSIFNAME)
863 tprintf(", {ifr_index=%d, ifr_name=???}", ifr.ifr_ifindex);
865 tprintf(", {ifr_name=\"%s\", ???}", ifr.ifr_name);
866 - } else if (code == SIOCGIFNAME)
867 + } else if (code == SIOCGIFNAME || code == SIOCSIFNAME)
868 tprintf(", {ifr_index=%d, ifr_name=\"%s\"}",
869 ifr.ifr_ifindex, ifr.ifr_name);
871 @@ -163,15 +175,19 @@
872 tprintf("ifr_index=%d", ifr.ifr_ifindex);
879 + case SIOCSIFDSTADDR:
884 + case SIOCSIFBRDADDR:
886 str = "ifr_broadaddr";
889 + case SIOCSIFNETMASK:
892 tprintf("%s={", str);
898 + case SIOCSIFHWADDR:
899 /* XXX Are there other hardware addresses
901 bytes = (unsigned char *) &ifr.ifr_hwaddr.sa_data;
902 @@ -193,22 +210,28 @@
903 bytes[3], bytes[4], bytes[5]);
907 tprintf("ifr_flags=");
908 printflags(iffflags, ifr.ifr_flags, "IFF_???");
911 + case SIOCSIFMETRIC:
912 tprintf("ifr_metric=%d", ifr.ifr_metric);
916 tprintf("ifr_mtu=%d", ifr.ifr_mtu);
920 tprintf("ifr_slave=\"%s\"", ifr.ifr_slave);
923 + case SIOCSIFTXQLEN:
924 tprintf("ifr_qlen=%d", ifr.ifr_qlen);
928 tprintf("ifr_map={mem_start=%#lx, "
929 "mem_end=%#lx, base_addr=%#x, "
930 "irq=%u, dma=%u, port=%u}",
931 Index: strace/strace.1
932 ===================================================================
933 RCS file: /cvsroot/strace/strace/strace.1,v
934 retrieving revision 1.16
935 retrieving revision 1.20
936 diff -u -r1.16 -r1.20
937 --- strace/strace.1 18 Jul 2008 00:25:10 -0000 1.16
938 +++ strace/strace.1 10 Dec 2008 06:09:29 -0000 1.20
940 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
941 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
943 -.\" $Id: strace.1,v 1.16 2008/07/18 00:25:10 roland Exp $
944 +.\" $Id: strace.1,v 1.20 2008/12/10 06:09:29 roland Exp $
949 --- SIGINT (Interrupt) ---
950 +++ killed by SIGINT +++
952 +If a system call is being executed and meanwhile another one is being called
953 +from a different thread/process then
955 +will try to preserve the order of those events and mark the ongoing call as
956 +being \fIunfinished\fP. When the call returns it will be marked as
959 +[pid 28772] select(4, [3], NULL, NULL, NULL <unfinished ...>
960 +[pid 28779] clock_gettime(CLOCK_REALTIME, {1130322148, 939977000}) = 0
961 +[pid 28772] <... select resumed> ) = 1 (in [3])
963 +Interruption of a (restartable) system call by a signal delivery is processed
964 +differently as kernel terminates the system call and also arranges its
965 +immediate reexecution after the signal handler completes.
967 +read(0, 0x7ffff72cf5cf, 1) = ? ERESTARTSYS (To be restarted)
968 +--- SIGALRM (Alarm clock) @ 0 (0) ---
969 +rt_sigreturn(0xe) = 0
970 +read(0, ""..., 1) = 0
972 Arguments are printed in symbolic form with a passion.
973 This example shows the shell performing ``>>xyzzy'' output redirection:
977 from the inherited list of environment variables before passing it on to
984 +exits with the same exit status.
987 +is terminated by a signal,
989 +terminates itself with the same signal, so that
991 +can be used as a wrapper process transparent to the invoking parent process.
997 +is zero unless there was an unexpected error in doing the tracing.
998 .SH "SETUID INSTALLATION"
1001 @@ -653,6 +692,12 @@
1004 and tired of writing about himself in the third person.
1006 +The SIGTRAP signal is used internally by the kernel implementation of
1007 +system call tracing. When a traced process receives a SIGTRAP signal not
1008 +associated with tracing, strace will not report that signal correctly.
1009 +This signal is not normally used by programs, but could be via a hard-coded
1010 +break instruction or via kill(2).
1014 Index: strace/strace.c
1015 ===================================================================
1016 RCS file: /cvsroot/strace/strace/strace.c,v
1017 retrieving revision 1.88
1018 retrieving revision 1.89
1019 diff -u -r1.88 -r1.89
1020 --- strace/strace.c 6 Aug 2008 21:38:52 -0000 1.88
1021 +++ strace/strace.c 10 Nov 2008 17:14:58 -0000 1.89
1023 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
1024 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1026 - * $Id: strace.c,v 1.88 2008/08/06 21:38:52 kratochvil Exp $
1027 + * $Id: strace.c,v 1.89 2008/11/10 17:14:58 ldv Exp $
1032 /* Sometimes we want to print only succeeding syscalls. */
1033 int not_failing_only = 0;
1035 +static int exit_code = 0;
1036 +static int strace_child = 0;
1038 static char *username = NULL;
1042 progname, filename);
1045 - switch (pid = fork()) {
1046 + strace_child = pid = fork();
1049 perror("strace: fork");
1051 @@ -879,7 +883,17 @@
1057 + if (exit_code > 0xff) {
1058 + /* Child was killed by a signal, mimic that. */
1059 + exit_code &= 0xff;
1060 + signal(exit_code, SIG_DFL);
1062 + /* Paranoia - what if this signal is not fatal?
1063 + Exit with 128 + signo then. */
1070 @@ -1783,7 +1797,7 @@
1079 @@ -1807,7 +1821,7 @@
1081 if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
1082 perror("getrlimit(RLIMIT_NOFILE, ...)");
1087 for (i = 0; i < n; i++) {
1088 @@ -2322,6 +2336,8 @@
1091 if (WIFSIGNALED(status)) {
1092 + if (pid == strace_child)
1093 + exit_code = 0x100 | WTERMSIG(status);
1095 && (qual_flags[WTERMSIG(status)] & QUAL_SIGNAL)) {
1097 @@ -2341,6 +2357,8 @@
1100 if (WIFEXITED(status)) {
1101 + if (pid == strace_child)
1102 + exit_code = WEXITSTATUS(status);
1104 fprintf(stderr, "pid %u exited\n", pid);
1105 if ((tcp->flags & TCB_ATTACHED)
1106 Index: strace/strace.spec
1107 ===================================================================
1108 RCS file: /cvsroot/strace/strace/strace.spec,v
1109 retrieving revision 1.44
1110 retrieving revision 1.45
1111 diff -u -r1.44 -r1.45
1112 --- strace/strace.spec 28 Aug 2008 22:00:46 -0000 1.44
1113 +++ strace/strace.spec 28 Aug 2008 23:26:21 -0000 1.45
1115 # remove unpackaged files from the buildroot
1116 rm -f %{buildroot}%{_bindir}/strace-graph
1122 +%define copy64 cp -p
1125 %ifarch %{strace64_arches}
1126 -ln %{buildroot}%{_bindir}/strace %{buildroot}%{_bindir}/strace64
1127 +%{copy64} %{buildroot}%{_bindir}/strace %{buildroot}%{_bindir}/strace64
1131 Index: strace/stream.c
1132 ===================================================================
1133 RCS file: /cvsroot/strace/strace/stream.c,v
1134 retrieving revision 1.28
1135 retrieving revision 1.29
1136 diff -u -r1.28 -r1.29
1137 --- strace/stream.c 1 Nov 2007 21:50:54 -0000 1.28
1138 +++ strace/stream.c 3 Sep 2008 01:22:18 -0000 1.29
1140 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
1141 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1143 - * $Id: stream.c,v 1.28 2007/11/01 21:50:54 roland Exp $
1144 + * $Id: stream.c,v 1.29 2008/09/03 01:22:18 ldv Exp $
1148 @@ -1177,7 +1177,7 @@
1152 - if (timod && tcp->u_rval) {
1153 + if (timod && tcp->u_rval && !syserror(tcp)) {
1154 tcp->auxstr = xlookup (tli_errors, tcp->u_rval);
1155 return RVAL_STR + 1;
1157 Index: strace/syscall.c
1158 ===================================================================
1159 RCS file: /cvsroot/strace/strace/syscall.c,v
1160 retrieving revision 1.96
1161 retrieving revision 1.99
1162 diff -u -r1.96 -r1.99
1163 --- strace/syscall.c 25 Aug 2008 03:16:26 -0000 1.96
1164 +++ strace/syscall.c 10 Nov 2008 22:21:41 -0000 1.99
1166 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
1167 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1169 - * $Id: syscall.c,v 1.96 2008/08/25 03:16:26 roland Exp $
1170 + * $Id: syscall.c,v 1.99 2008/11/10 22:21:41 ldv Exp $
1175 static long result,flags;
1176 #elif defined (M68K)
1178 +#elif defined(BFIN)
1181 static struct pt_regs regs;
1182 #elif defined (ALPHA)
1183 @@ -899,6 +901,12 @@
1187 +#elif defined(BFIN)
1188 + if (upeek(pid, PT_ORIG_P0, &scno))
1190 + /* Check if we return from execve. */
1191 + if (tcp->flags & TCB_WAITEXECVE && tcp->flags & TCB_INSYSCALL)
1192 + tcp->flags &= ~(TCB_INSYSCALL | TCB_WAITEXECVE);
1193 #elif defined (I386)
1194 if (upeek(pid, 4*ORIG_EAX, &scno) < 0)
1196 @@ -1455,6 +1463,9 @@
1200 +#elif defined(BFIN)
1201 + if (upeek(pid, PT_R0, &r0) < 0)
1203 #elif defined (HPPA)
1204 if (upeek(pid, PT_GR28, &r28) < 0)
1206 @@ -1588,6 +1599,15 @@
1211 + if (is_negated_errno(r0)) {
1222 @@ -1655,6 +1675,7 @@
1224 #endif /* SPARC64 */
1229 #endif /* POWERPC */
1230 @@ -1781,6 +1802,11 @@
1235 + r0 = error ? -error : rval;
1236 + if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)PT_R0, r0) < 0)
1242 @@ -1885,6 +1911,7 @@
1244 #endif /* POWERPC */
1250 @@ -2116,6 +2143,20 @@
1251 for (i = 0; i < tcp->u_nargs; i++)
1252 tcp->u_arg[i] = regs.uregs[i];
1254 +#elif defined(BFIN)
1257 + int argreg[] = {PT_R0, PT_R1, PT_R2, PT_R3, PT_R4, PT_R5};
1259 + if (tcp->scno >= 0 && tcp->scno < nsyscalls && sysent[tcp->scno].nargs != -1)
1260 + tcp->u_nargs = sysent[tcp->scno].nargs;
1262 + tcp->u_nargs = sizeof(argreg) / sizeof(argreg[0]);
1264 + for (i = 0; i < tcp->u_nargs; ++i)
1265 + if (upeek(pid, argreg[i], &tcp->u_arg[i]) < 0)
1271 @@ -2369,6 +2410,8 @@
1275 + if ((sys_res & RVAL_STR) && tcp->auxstr)
1276 + tprintf(" (%s)", tcp->auxstr);
1279 if (sys_res & RVAL_NONE)
1280 @@ -2641,3 +2684,22 @@
1286 +is_restart_error(struct tcb *tcp)
1289 + if (!syserror(tcp))
1291 + switch (tcp->u_error) {
1293 + case ERESTARTNOINTR:
1294 + case ERESTARTNOHAND:
1295 + case ERESTART_RESTARTBLOCK:
1303 Index: strace/system.c
1304 ===================================================================
1305 RCS file: /cvsroot/strace/strace/system.c,v
1306 retrieving revision 1.43
1307 retrieving revision 1.45
1308 diff -u -r1.43 -r1.45
1309 --- strace/system.c 16 Jan 2007 15:10:08 -0000 1.43
1310 +++ strace/system.c 11 Nov 2008 00:21:09 -0000 1.45
1312 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
1313 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1315 - * $Id: system.c,v 1.43 2007/01/16 15:10:08 ldv Exp $
1316 + * $Id: system.c,v 1.45 2008/11/11 00:21:09 ldv Exp $
1320 @@ -293,6 +293,33 @@
1326 +#include <bfin_sram.h>
1328 +static const struct xlat sram_alloc_flags[] = {
1329 + { L1_INST_SRAM, "L1_INST_SRAM" },
1330 + { L1_DATA_A_SRAM, "L1_DATA_A_SRAM" },
1331 + { L1_DATA_B_SRAM, "L1_DATA_B_SRAM" },
1332 + { L1_DATA_SRAM, "L1_DATA_SRAM" },
1337 +sys_sram_alloc(tcp)
1340 + if (entering(tcp)) {
1342 + tprintf("%zu, ", tcp->u_arg[0]);
1344 + printxval(sram_alloc_flags, tcp->u_arg[1], "L1_???_SRAM");
1354 @@ -1480,6 +1507,21 @@
1355 { 1<<CAP_SYS_RESOURCE, "CAP_SYS_RESOURCE"},
1356 { 1<<CAP_SYS_TIME, "CAP_SYS_TIME" },
1357 { 1<<CAP_SYS_TTY_CONFIG,"CAP_SYS_TTY_CONFIG"},
1359 + { 1<<CAP_MKNOD, "CAP_MKNOD" },
1362 + { 1<<CAP_LEASE, "CAP_LEASE" },
1364 +#ifdef CAP_AUDIT_WRITE
1365 + { 1<<CAP_AUDIT_WRITE, "CAP_AUDIT_WRITE"},
1367 +#ifdef CAP_AUDIT_CONTROL
1368 + { 1<<CAP_AUDIT_CONTROL, "CAP_AUDIT_CONTROL"},
1371 + { 1<<CAP_SETFCAP, "CAP_SETFCAP" },
1376 Index: strace/time.c
1377 ===================================================================
1378 RCS file: /cvsroot/strace/strace/time.c,v
1379 retrieving revision 1.24
1380 retrieving revision 1.26
1381 diff -u -r1.24 -r1.26
1382 --- strace/time.c 20 May 2008 04:56:13 -0000 1.24
1383 +++ strace/time.c 3 Sep 2008 01:22:18 -0000 1.26
1385 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
1386 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1388 - * $Id: time.c,v 1.24 2008/05/20 04:56:13 roland Exp $
1389 + * $Id: time.c,v 1.26 2008/09/03 01:22:18 ldv Exp $
1393 @@ -329,6 +329,21 @@
1398 +sys_nanosleep(struct tcb *tcp)
1400 + if (entering(tcp)) {
1401 + print_timespec(tcp, tcp->u_arg[0]);
1404 + if (!tcp->u_arg[1] || is_restart_error(tcp))
1405 + print_timespec(tcp, tcp->u_arg[1]);
1407 + tprintf("%#lx", tcp->u_arg[1]);
1412 static const struct xlat which[] = {
1413 { ITIMER_REAL, "ITIMER_REAL" },
1414 { ITIMER_VIRTUAL,"ITIMER_VIRTUAL"},
1416 tprintf("%#lx", tcp->u_arg[0]);
1417 else if (tprint_timex(tcp, tcp->u_arg[0]) < 0)
1419 + if (syserror(tcp))
1421 tcp->auxstr = xlookup(adjtimex_state, tcp->u_rval);
1424 Index: strace/util.c
1425 ===================================================================
1426 RCS file: /cvsroot/strace/strace/util.c,v
1427 retrieving revision 1.79
1428 retrieving revision 1.81
1429 diff -u -r1.79 -r1.81
1430 --- strace/util.c 6 Aug 2008 21:43:35 -0000 1.79
1431 +++ strace/util.c 10 Nov 2008 23:19:13 -0000 1.81
1433 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
1434 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1436 - * $Id: util.c,v 1.79 2008/08/06 21:43:35 kratochvil Exp $
1437 + * $Id: util.c,v 1.81 2008/11/10 23:19:13 ldv Exp $
1441 @@ -407,6 +407,12 @@
1443 static char path[MAXPATHLEN + 1];
1446 + * Quote string `instr' of length `size'
1447 + * Write up to (3 + `size' * 4) bytes to `outstr' buffer.
1448 + * If `len' < 0, treat `instr' as a NUL-terminated string
1449 + * and quote at most (`size' - 1) bytes.
1452 string_quote(const char *instr, char *outstr, int len, int size)
1454 @@ -417,12 +423,18 @@
1458 + /* Check for presence of symbol which require
1459 + to hex-quote the whole string. */
1460 for (i = 0; i < size; ++i) {
1462 - if (len < 0 && i == size - 2 && c != '\0')
1464 - if (len < 0 && c == '\0')
1466 + /* Check for NUL-terminated string. */
1470 + /* Quote at most size - 1 bytes. */
1471 + if (i == size - 1)
1474 if (!isprint(c) && !isspace(c)) {
1477 @@ -433,20 +445,31 @@
1481 + /* Hex-quote the whole string. */
1482 for (i = 0; i < size; ++i) {
1484 - if (len < 0 && c == '\0')
1486 + /* Check for NUL-terminated string. */
1490 + /* Quote at most size - 1 bytes. */
1491 + if (i == size - 1)
1494 sprintf(s, "\\x%02x", c);
1498 for (i = 0; i < size; ++i) {
1500 - if (len < 0 && i == size - 2 && c != '\0')
1502 - if (len < 0 && c == '\0')
1504 + /* Check for NUL-terminated string. */
1508 + /* Quote at most size - 1 bytes. */
1509 + if (i == size - 1)
1513 case '\"': case '\\':
1515 @@ -495,18 +518,25 @@
1520 + * Print path string specified by address `addr' and length `n'.
1521 + * If path length exceeds `n', append `...' to the output.
1524 printpathn(struct tcb *tcp, long addr, int n)
1526 - if (n > sizeof path - 1)
1527 - n = sizeof path - 1;
1535 + /* Cap path length to the path buffer size,
1536 + and NUL-terminate the buffer. */
1537 + if (n > sizeof path - 1)
1538 + n = sizeof path - 1;
1541 + /* Fetch one byte more to find out whether path length > n. */
1542 if (umovestr(tcp, addr, n + 1, path) < 0)
1543 tprintf("%#lx", addr);
1549 - if (string_quote(path, outstr, -1, n + 1) || trunc)
1550 + (void) string_quote(path, outstr, -1, n + 1);
1552 strcat(outstr, "...");
1553 tprintf("%s", outstr);
1555 @@ -527,6 +558,11 @@
1556 printpathn(tcp, addr, sizeof path - 1);
1560 + * Print string specified by address `addr' and length `len'.
1561 + * If `len' < 0, treat the string as a NUL-terminated string.
1562 + * If string length exceeds `max_strlen', append `...' to the output.
1565 printstr(struct tcb *tcp, long addr, int len)
1567 @@ -538,32 +574,39 @@
1572 - if ((str = malloc(max_strlen + 1)) == NULL
1573 - || (outstr = malloc(4*max_strlen
1574 - + sizeof "\"\"...")) == NULL) {
1575 - fprintf(stderr, "out of memory\n");
1576 - tprintf("%#lx", addr);
1579 + /* Allocate static buffers if they are not allocated yet. */
1581 + str = malloc(max_strlen + 1);
1583 + outstr = malloc(4 * max_strlen + sizeof "\"...\"");
1584 + if (!str || !outstr) {
1585 + fprintf(stderr, "out of memory\n");
1586 + tprintf("%#lx", addr);
1592 + * Treat as a NUL-terminated string: fetch one byte more
1593 + * because string_quote() quotes one byte less.
1595 size = max_strlen + 1;
1596 + str[max_strlen] = '\0';
1597 if (umovestr(tcp, addr, size, str) < 0) {
1598 tprintf("%#lx", addr);
1603 - size = MIN(len, max_strlen + 1);
1604 + size = MIN(len, max_strlen);
1605 if (umoven(tcp, addr, size, str) < 0) {
1606 tprintf("%#lx", addr);
1611 - if (string_quote(str, outstr, len, size))
1612 + if (string_quote(str, outstr, len, size) &&
1613 + (len < 0 || len > max_strlen))
1614 strcat(outstr, "...");
1616 tprintf("%s", outstr);
1617 @@ -1068,6 +1111,9 @@
1619 if (upeek(tcp->pid, 4*15, &pc) < 0)
1621 +#elif defined(BFIN)
1622 + if (upeek(tcp->pid, REG_PC, &pc) < 0)
1624 #elif defined(POWERPC)
1625 if (upeek(tcp->pid, sizeof(unsigned long)*PT_NIP, &pc) < 0)
1627 @@ -1245,6 +1291,14 @@
1630 tprintf("[%08lx] ", pc);
1631 +#elif defined(BFIN)
1634 + if (upeek(tcp->pid, PT_PC, &pc) < 0) {
1638 + tprintf("[%08lx] ", pc);
1639 #endif /* !architecture */
1642 Index: strace/linux/dummy.h
1643 ===================================================================
1644 RCS file: /cvsroot/strace/strace/linux/dummy.h,v
1645 retrieving revision 1.18
1646 retrieving revision 1.19
1647 diff -u -r1.18 -r1.19
1648 --- strace/linux/dummy.h 5 Jul 2007 19:28:35 -0000 1.18
1649 +++ strace/linux/dummy.h 3 Sep 2008 01:02:47 -0000 1.19
1651 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
1652 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1654 - * $Id: dummy.h,v 1.18 2007/07/05 19:28:35 roland Exp $
1655 + * $Id: dummy.h,v 1.19 2008/09/03 01:02:47 ldv Exp $
1658 /* still unfinished */
1660 #define sys_fchdir sys_close
1661 #define sys_setfsuid sys_setuid
1662 #define sys_setfsgid sys_setgid
1663 -#define sys_nanosleep sys_adjtime
1664 #define sys_acct sys_chdir
1665 #define sys_fdatasync sys_close
1666 #define sys_mlock sys_munmap
1667 Index: strace/linux/syscall.h
1668 ===================================================================
1669 RCS file: /cvsroot/strace/strace/linux/syscall.h,v
1670 retrieving revision 1.59
1671 retrieving revision 1.61
1672 diff -u -r1.59 -r1.61
1673 --- strace/linux/syscall.h 25 Aug 2008 03:15:43 -0000 1.59
1674 +++ strace/linux/syscall.h 10 Nov 2008 22:53:03 -0000 1.61
1676 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
1677 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1679 - * $Id: syscall.h,v 1.59 2008/08/25 03:15:43 roland Exp $
1680 + * $Id: syscall.h,v 1.61 2008/11/10 22:53:03 ldv Exp $
1685 int sys_utimensat(), sys_epoll_pwait(), sys_signalfd(), sys_timerfd(), sys_eventfd();
1687 int sys_fallocate(), sys_timerfd_create(), sys_timerfd_settime(), sys_timerfd_gettime();
1688 +int sys_signalfd4(), sys_eventfd2(), sys_epoll_create1(), sys_dup3(), sys_pipe2();
1690 /* sys_socketcall subcalls */
1694 int sys_subpage_prot();
1698 +int sys_sram_alloc();
1700 Index: strace/linux/syscallent.h
1701 ===================================================================
1702 RCS file: /cvsroot/strace/strace/linux/syscallent.h,v
1703 retrieving revision 1.54
1704 retrieving revision 1.56
1705 diff -u -r1.54 -r1.56
1706 --- strace/linux/syscallent.h 18 Jul 2008 01:23:49 -0000 1.54
1707 +++ strace/linux/syscallent.h 10 Nov 2008 22:53:03 -0000 1.56
1709 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
1710 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1712 - * $Id: syscallent.h,v 1.54 2008/07/18 01:23:49 roland Exp $
1713 + * $Id: syscallent.h,v 1.56 2008/11/10 22:53:03 ldv Exp $
1716 { 0, 0, sys_restart_syscall, "restart_syscall" }, /* 0 */
1718 { 3, 0, printargs, "nfsservctl" }, /* 169 */
1719 { 3, 0, sys_setresgid, "setresgid" }, /* 170 */
1720 { 3, 0, sys_getresgid, "getresgid" }, /* 171 */
1721 - { 5, 0, printargs, "prctl" }, /* 172 */
1722 + { 5, 0, sys_prctl, "prctl" }, /* 172 */
1723 { 1, TS, printargs, "rt_sigreturn" }, /* 173 */
1724 { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 174 */
1725 { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask"}, /* 175 */
1726 @@ -357,12 +357,12 @@
1727 { 6, TF, sys_fallocate, "fallocate" }, /* 324 */
1728 { 4, TD, sys_timerfd_settime, "timerfd_settime"}, /* 325 */
1729 { 2, TD, sys_timerfd_gettime, "timerfd_gettime"}, /* 326 */
1730 - { 5, 0, printargs, "SYS_327" }, /* 327 */
1731 - { 5, 0, printargs, "SYS_328" }, /* 328 */
1732 - { 5, 0, printargs, "SYS_329" }, /* 329 */
1733 - { 5, 0, printargs, "SYS_330" }, /* 330 */
1734 - { 5, 0, printargs, "SYS_331" }, /* 331 */
1735 - { 5, 0, printargs, "SYS_332" }, /* 332 */
1736 + { 4, TD|TS, sys_signalfd4, "signalfd4" }, /* 327 */
1737 + { 2, TD, sys_eventfd2, "eventfd2" }, /* 328 */
1738 + { 1, 0, sys_epoll_create1, "epoll_create1" }, /* 329 */
1739 + { 3, TD, sys_dup3, "dup3" }, /* 330 */
1740 + { 2, TD, sys_pipe2, "pipe2" }, /* 331 */
1741 + { 1, TD, printargs, "inotify_init1" }, /* 332 */
1742 { 5, 0, printargs, "SYS_333" }, /* 333 */
1743 { 5, 0, printargs, "SYS_334" }, /* 334 */
1744 { 5, 0, printargs, "SYS_335" }, /* 335 */
1745 Index: strace/linux/alpha/syscallent.h
1746 ===================================================================
1747 RCS file: /cvsroot/strace/strace/linux/alpha/syscallent.h,v
1748 retrieving revision 1.22
1749 retrieving revision 1.23
1750 diff -u -r1.22 -r1.23
1751 --- strace/linux/alpha/syscallent.h 18 Jul 2008 01:23:49 -0000 1.22
1752 +++ strace/linux/alpha/syscallent.h 3 Sep 2008 00:52:47 -0000 1.23
1754 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
1755 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1757 - * $Id: syscallent.h,v 1.22 2008/07/18 01:23:49 roland Exp $
1758 + * $Id: syscallent.h,v 1.23 2008/09/03 00:52:47 ldv Exp $
1761 { 6, 0, printargs, "osf_syscall" }, /* 0, not implemented */
1763 { 5, 0, printargs, "pciconfig_read" }, /* 345 */
1764 { 5, 0, printargs, "pciconfig_write" }, /* 346 */
1765 { 5, 0, sys_query_module, "query_module" }, /* 347 */
1766 - { 5, 0, printargs, "prctl" }, /* 348 */
1767 + { 5, 0, sys_prctl, "prctl" }, /* 348 */
1768 { 5, TD, sys_pread, "pread" }, /* 349 */
1769 { 5, TD, sys_pwrite, "pwrite" }, /* 350 */
1770 { 1, TS, printargs, "rt_sigreturn" }, /* 351 */
1771 Index: strace/linux/arm/syscallent.h
1772 ===================================================================
1773 RCS file: /cvsroot/strace/strace/linux/arm/syscallent.h,v
1774 retrieving revision 1.15
1775 retrieving revision 1.16
1776 diff -u -r1.15 -r1.16
1777 --- strace/linux/arm/syscallent.h 18 Jul 2008 01:23:49 -0000 1.15
1778 +++ strace/linux/arm/syscallent.h 3 Sep 2008 00:52:47 -0000 1.16
1780 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
1781 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1783 - * $Id: syscallent.h,v 1.15 2008/07/18 01:23:49 roland Exp $
1784 + * $Id: syscallent.h,v 1.16 2008/09/03 00:52:47 ldv Exp $
1787 { 0, 0, sys_restart_syscall, "restart_syscall"}, /* 0 */
1789 { 3, 0, printargs, "nfsservctl" }, /* 169 */
1790 { 3, 0, sys_setresgid, "setresgid" }, /* 170 */
1791 { 3, 0, sys_getresgid, "getresgid" }, /* 171 */
1792 - { 5, 0, printargs, "prctl" }, /* 172 */
1793 + { 5, 0, sys_prctl, "prctl" }, /* 172 */
1794 { 1, TS, printargs, "rt_sigreturn" }, /* 173 */
1795 { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 174 */
1796 { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask"}, /* 175 */
1797 Index: strace/linux/m68k/syscallent.h
1798 ===================================================================
1799 RCS file: /cvsroot/strace/strace/linux/m68k/syscallent.h,v
1800 retrieving revision 1.7
1801 retrieving revision 1.8
1803 --- strace/linux/m68k/syscallent.h 18 Jul 2008 01:23:49 -0000 1.7
1804 +++ strace/linux/m68k/syscallent.h 3 Sep 2008 00:52:47 -0000 1.8
1806 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
1807 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1809 - * $Id: syscallent.h,v 1.7 2008/07/18 01:23:49 roland Exp $
1810 + * $Id: syscallent.h,v 1.8 2008/09/03 00:52:47 ldv Exp $
1813 { 0, 0, sys_restart_syscall, "restart_syscall" }, /* 0 */
1815 { 3, 0, printargs, "nfsservctl" }, /* 169 */
1816 { 3, 0, sys_setresgid, "setresgid" }, /* 170 */
1817 { 3, 0, sys_getresgid, "getresgid" }, /* 171 */
1818 - { 5, 0, printargs, "prctl" }, /* 172 */
1819 + { 5, 0, sys_prctl, "prctl" }, /* 172 */
1820 { 1, TS, printargs, "rt_sigreturn" }, /* 173 */
1821 { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 174 */
1822 { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask"}, /* 175 */
1823 Index: strace/linux/powerpc/syscallent.h
1824 ===================================================================
1825 RCS file: /cvsroot/strace/strace/linux/powerpc/syscallent.h,v
1826 retrieving revision 1.35
1827 retrieving revision 1.36
1828 diff -u -r1.35 -r1.36
1829 --- strace/linux/powerpc/syscallent.h 25 Aug 2008 03:09:16 -0000 1.35
1830 +++ strace/linux/powerpc/syscallent.h 3 Sep 2008 00:52:47 -0000 1.36
1832 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
1833 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1835 - * $Id: syscallent.h,v 1.35 2008/08/25 03:09:16 roland Exp $
1836 + * $Id: syscallent.h,v 1.36 2008/09/03 00:52:47 ldv Exp $
1839 { 0, 0, sys_restart_syscall, "restart_syscall" }, /* 0 */
1841 { 3, 0, printargs, "nfsservctl" }, /* 168 */
1842 { 3, 0, sys_setresgid, "setresgid" }, /* 169 */
1843 { 3, 0, sys_getresgid, "getresgid" }, /* 170 */
1844 - { 5, 0, printargs, "prctl" }, /* 171 */
1845 + { 5, 0, sys_prctl, "prctl" }, /* 171 */
1846 { 1, TS, printargs, "rt_sigreturn" }, /* 172 */
1847 { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 173 */
1848 { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask" }, /* 174 */
1849 Index: strace/linux/s390/syscallent.h
1850 ===================================================================
1851 RCS file: /cvsroot/strace/strace/linux/s390/syscallent.h,v
1852 retrieving revision 1.24
1853 retrieving revision 1.25
1854 diff -u -r1.24 -r1.25
1855 --- strace/linux/s390/syscallent.h 18 Jul 2008 01:23:49 -0000 1.24
1856 +++ strace/linux/s390/syscallent.h 3 Sep 2008 00:52:47 -0000 1.25
1858 { 3, 0, printargs, "nfsservctl" }, /* 169 */
1859 { 3, 0, sys_setresgid, "setresgid" }, /* 170 */
1860 { 3, 0, sys_getresgid, "getresgid" }, /* 171 */
1861 - { 5, 0, printargs, "prctl" }, /* 172 */
1862 + { 5, 0, sys_prctl, "prctl" }, /* 172 */
1863 { 1, TS, sys_sigreturn, "rt_sigreturn" }, /* 173 */
1864 { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 174 */
1865 { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask"}, /* 175 */
1866 Index: strace/linux/s390x/syscallent.h
1867 ===================================================================
1868 RCS file: /cvsroot/strace/strace/linux/s390x/syscallent.h,v
1869 retrieving revision 1.23
1870 retrieving revision 1.24
1871 diff -u -r1.23 -r1.24
1872 --- strace/linux/s390x/syscallent.h 18 Jul 2008 01:23:49 -0000 1.23
1873 +++ strace/linux/s390x/syscallent.h 3 Sep 2008 00:52:47 -0000 1.24
1875 { 3, 0, printargs, "nfsservctl" }, /* 169 */
1876 { -1, 0, printargs, "SYS_170" }, /* 170 */
1877 { -1, 0, printargs, "SYS_171" }, /* 171 */
1878 - { 5, 0, printargs, "prctl" }, /* 172 */
1879 + { 5, 0, sys_prctl, "prctl" }, /* 172 */
1880 { 1, TS, sys_sigreturn, "rt_sigreturn" }, /* 173 */
1881 { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 174 */
1882 { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask"}, /* 175 */
1883 Index: strace/linux/sh/syscallent.h
1884 ===================================================================
1885 RCS file: /cvsroot/strace/strace/linux/sh/syscallent.h,v
1886 retrieving revision 1.18
1887 retrieving revision 1.19
1888 diff -u -r1.18 -r1.19
1889 --- strace/linux/sh/syscallent.h 19 Nov 2007 22:10:22 -0000 1.18
1890 +++ strace/linux/sh/syscallent.h 3 Sep 2008 00:52:47 -0000 1.19
1892 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
1893 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1895 - * $Id: syscallent.h,v 1.18 2007/11/19 22:10:22 roland Exp $
1896 + * $Id: syscallent.h,v 1.19 2008/09/03 00:52:47 ldv Exp $
1899 { 0, 0, sys_restart_syscall, "restart_syscall"}, /* 0 */
1901 { 3, 0, printargs, "nfsservctl" }, /* 169 */
1902 { 3, 0, sys_setresgid, "setresgid" }, /* 170 */
1903 { 3, 0, sys_getresgid, "getresgid" }, /* 171 */
1904 - { 5, 0, printargs, "prctl" }, /* 172 */
1905 + { 5, 0, sys_prctl, "prctl" }, /* 172 */
1906 { 1, TS, printargs, "rt_sigreturn" }, /* 173 */
1907 { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 174 */
1908 { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask"}, /* 175 */
1909 Index: strace/linux/sh64/syscallent.h
1910 ===================================================================
1911 RCS file: /cvsroot/strace/strace/linux/sh64/syscallent.h,v
1912 retrieving revision 1.15
1913 retrieving revision 1.16
1914 diff -u -r1.15 -r1.16
1915 --- strace/linux/sh64/syscallent.h 20 May 2008 01:25:52 -0000 1.15
1916 +++ strace/linux/sh64/syscallent.h 3 Sep 2008 00:52:47 -0000 1.16
1918 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
1919 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1921 - * $Id: syscallent.h,v 1.15 2008/05/20 01:25:52 roland Exp $
1922 + * $Id: syscallent.h,v 1.16 2008/09/03 00:52:47 ldv Exp $
1925 { 0, 0, sys_setup, "setup" }, /* 0 */
1927 { 3, 0, printargs, "nfsservctl" }, /* 169 */
1928 { 3, 0, sys_setresgid, "setresgid" }, /* 170 */
1929 { 3, 0, sys_getresgid, "getresgid" }, /* 171 */
1930 - { 5, 0, printargs, "prctl" }, /* 172 */
1931 + { 5, 0, sys_prctl, "prctl" }, /* 172 */
1932 { 1, TS, printargs, "rt_sigreturn" }, /* 173 */
1933 { 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 174 */
1934 { 4, TS, sys_rt_sigprocmask, "rt_sigprocmask"}, /* 175 */
1935 Index: strace/linux/x86_64/syscallent.h
1936 ===================================================================
1937 RCS file: /cvsroot/strace/strace/linux/x86_64/syscallent.h,v
1938 retrieving revision 1.31
1939 retrieving revision 1.34
1940 diff -u -r1.31 -r1.34
1941 --- strace/linux/x86_64/syscallent.h 18 Jul 2008 01:23:49 -0000 1.31
1942 +++ strace/linux/x86_64/syscallent.h 10 Nov 2008 22:53:03 -0000 1.34
1944 { 3, 0, sys_modify_ldt, "modify_ldt" }, /* 154 */
1945 { 2, TF, sys_pivotroot, "pivot_root" }, /* 155 */
1946 { 1, 0, sys_sysctl, "_sysctl" }, /* 156 */
1947 - { 5, 0, printargs, "prctl" }, /* 157 */
1948 + { 5, 0, sys_prctl, "prctl" }, /* 157 */
1949 { 2, TP, sys_arch_prctl, "arch_prctl" }, /* 158 */
1950 { 1, 0, sys_adjtimex, "adjtimex" }, /* 159 */
1951 { 2, 0, sys_setrlimit, "setrlimit" }, /* 160 */
1953 { 2, 0, printargs, "set_robust_list" }, /* 273 */
1954 { 3, 0, printargs, "get_robust_list" }, /* 274 */
1955 { 6, TD, printargs, "splice" }, /* 275 */
1956 - { 4, TD, printargs, "sync_file_range" }, /* 276 */
1957 - { 4, TD, printargs, "tee" }, /* 277 */
1958 + { 4, TD, printargs, "tee" }, /* 276 */
1959 + { 4, TD, printargs, "sync_file_range" }, /* 277 */
1960 { 4, TD, printargs, "vmsplice" }, /* 278 */
1961 { 6, 0, sys_move_pages, "move_pages" }, /* 279 */
1962 { 4, TD|TF, sys_utimensat, "utimensat" }, /* 280 */
1963 @@ -286,3 +286,10 @@
1964 { 6, TF, sys_fallocate, "fallocate" }, /* 285 */
1965 { 4, TD, sys_timerfd_settime, "timerfd_settime"}, /* 286 */
1966 { 2, TD, sys_timerfd_gettime, "timerfd_gettime"}, /* 287 */
1967 + { 6, TN, printargs, "paccept" }, /* 288 */
1968 + { 4, TD|TS, sys_signalfd4, "signalfd4" }, /* 289 */
1969 + { 2, TD, sys_eventfd2, "eventfd2" }, /* 290 */
1970 + { 1, 0, sys_epoll_create1, "epoll_create1" }, /* 291 */
1971 + { 3, TD, sys_dup3, "dup3" }, /* 292 */
1972 + { 2, TD, sys_pipe2, "pipe2" }, /* 293 */
1973 + { 1, TD, printargs, "inotify_init1" }, /* 294 */