Index: qemu/Makefile.target =================================================================== --- qemu.orig/Makefile.target 2007-06-20 16:26:42.000000000 -0400 +++ qemu/Makefile.target 2007-06-20 16:27:36.000000000 -0400 @@ -240,7 +240,7 @@ endif ifdef CONFIG_LINUX_USER -OBJS= main.o syscall.o mmap.o signal.o path.o osdep.o thunk.o \ +OBJS= main.o syscall.o syscall_names.o mmap.o signal.o path.o osdep.o thunk.o \ elfload.o linuxload.o LIBS+= $(AIOLIBS) ifdef TARGET_HAS_BFLT Index: qemu/linux-user/syscall.c =================================================================== --- qemu.orig/linux-user/syscall.c 2007-06-20 16:27:06.000000000 -0400 +++ qemu/linux-user/syscall.c 2007-06-20 16:56:06.000000000 -0400 @@ -2598,6 +2598,9 @@ #ifdef DEBUG gemu_log("syscall %d", num); #endif + if(do_strace) + print_syscall(num, arg1, arg2, arg3, arg4, arg5, arg6); + switch(num) { case TARGET_NR_exit: #ifdef HAVE_GPROF @@ -4771,6 +4774,8 @@ #ifdef DEBUG gemu_log(" = %ld\n", ret); #endif + if(do_strace) + print_syscall_ret(num, ret); return ret; } Index: qemu/linux-user/syscall_names.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ qemu/linux-user/syscall_names.c 2007-06-20 16:42:15.000000000 -0400 @@ -0,0 +1,71 @@ +#include +#include "qemu.h" + +int do_strace=0; + +struct syscallname { + int nr; + char *name; + char *format; + void (*call)(struct syscallname *,long, long, long, long, long, long); + void (*result)(struct syscallname *,long); +}; + +void +print_newselect(struct syscallname *name, long arg1, long arg2, long arg3, + long arg4, long arg5, long arg6) +{ +long rfds=0,wfds=0,efds=0; + +if( arg2 ) + rfds = *(long *)arg2; +if( arg3 ) + wfds = *(long *)arg3; +if( arg4 ) + efds = *(long *)arg4; + +gemu_log("%s(%d,%lX,%lX,%lX,%p)",name->name, arg1,rfds,wfds,efds,arg5); +} + +static struct syscallname scnames[] = { +#include "syscall_names.list" +}; + +static int nsyscalls = sizeof(scnames)/sizeof(struct syscallname); + +void +print_syscall(int num, long arg1, long arg2, long arg3, + long arg4, long arg5, long arg6) +{ +int i; +char *format="%s(%ld,%ld,%ld,%ld,%ld,%ld)"; + +for(i=0;i