strace 4.10 doesn't build on MIPS arch

Dmitry V. Levin ldv at altlinux.org
Fri Apr 17 10:50:31 UTC 2015


On Fri, Apr 17, 2015 at 12:42:55PM +0200, Arturo Borrero Gonzalez wrote:
> On 17 April 2015 at 11:23, Dmitry V. Levin <ldv at altlinux.org> wrote:
> >
> >> ../syscall.c:1798:3: error: too few arguments to function 'decode_mips_subcall'
> >>    decode_mips_subcall();
> >
> > That's correct, it has to be decode_mips_subcall(tcp);
> >
> 
> You are right. In the current HEAD, error is just:
> 
> [...]
> gcc -DHAVE_CONFIG_H -I.  -I./linux/mips -I./linux/mips -I./linux
> -I./linux  -Wall -Wwrite-strings -Wsign-compare -g -O2 -MT
> strace-syscall.o -MD -MP -MF .deps/strace-syscall.Tpo -c -o
> strace-syscall.o `test -f 'syscall.c' || echo './'`syscall.c
> syscall.c: In function 'trace_syscall_entering':
> syscall.c:794:3: error: too few arguments to function 'decode_mips_subcall'
>    decode_mips_subcall();
>    ^
> syscall.c:607:1: note: declared here
>  decode_mips_subcall(struct tcb *tcp)
>  ^
> Makefile:2371: recipe for target 'strace-syscall.o' failed
> [...]
> 
> Could please generate a new patch?

Sure.

--- a/linux/mips/syscallent-o32.h
+++ b/linux/mips/syscallent-o32.h
@@ -1,6 +1,6 @@
 #if defined LINUX_MIPSO32
 /* For an O32 strace, decode the o32 syscalls.  */
-[4000] = { MA,	0,		printargs,			"syscall"		}, /* start of Linux o32 */
+[4000] = { MA,	0,		sys_syscall,			"syscall"		}, /* start of Linux o32 */
 [4001] = { 1,	TP|SE,		sys_exit,			"exit"			},
 [4002] = { 0,	TP,		sys_fork,			"fork"			},
 [4003] = { 3,	TD,		sys_read,			"read"			},
--- a/syscall.c
+++ b/syscall.c
@@ -602,6 +602,25 @@ decode_ipc_subcall(struct tcb *tcp)
 }
 #endif
 
+#ifdef LINUX_MIPSO32
+static void
+decode_mips_subcall(struct tcb *tcp)
+{
+	if (!SCNO_IS_VALID(tcp->u_arg[0]))
+		return;
+	tcp->scno = tcp->u_arg[0];
+	tcp->qual_flg = qual_flags[tcp->scno];
+	tcp->s_ent = &sysent[tcp->scno];
+	memmove(&tcp->u_arg[0], &tcp->u_arg[1],
+		sizeof(tcp->u_arg) - sizeof(tcp->u_arg[0]));
+}
+
+SYS_FUNC(syscall)
+{
+	return printargs(tcp);
+}
+#endif
+
 int
 printargs(struct tcb *tcp)
 {
@@ -770,6 +789,11 @@ trace_syscall_entering(struct tcb *tcp)
 		goto ret;
 	}
 
+#ifdef LINUX_MIPSO32
+	if (sys_syscall == tcp->s_ent->sys_func)
+		decode_mips_subcall(tcp);
+#endif
+
 	if (   sys_execve == tcp->s_ent->sys_func
 # if defined(SPARC) || defined(SPARC64)
 	    || sys_execv == tcp->s_ent->sys_func

-- 
ldv




More information about the Strace-devel mailing list