diff options
-rw-r--r-- | linux-user/qemu.h | 6 | ||||
-rw-r--r-- | linux-user/strace.c | 70 |
2 files changed, 41 insertions, 35 deletions
diff --git a/linux-user/qemu.h b/linux-user/qemu.h index 68ce12a62d..581ee27fa8 100644 --- a/linux-user/qemu.h +++ b/linux-user/qemu.h @@ -166,9 +166,9 @@ extern FILE *logfile; /* strace.c */ void print_syscall(int num, - target_long arg1, target_long arg2, target_long arg3, - target_long arg4, target_long arg5, target_long arg6); -void print_syscall_ret(int num, target_long arg1); + abi_long arg1, abi_long arg2, abi_long arg3, + abi_long arg4, abi_long arg5, abi_long arg6); +void print_syscall_ret(int num, abi_long arg1); extern int do_strace; /* signal.c */ diff --git a/linux-user/strace.c b/linux-user/strace.c index 315ae5c312..161ca4236b 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -16,9 +16,9 @@ struct syscallname { char *name; char *format; void (*call)(struct syscallname *, - target_long, target_long, target_long, - target_long, target_long, target_long); - void (*result)(struct syscallname *, target_long); + abi_long, abi_long, abi_long, + abi_long, abi_long, abi_long); + void (*result)(struct syscallname *, abi_long); }; /* @@ -74,8 +74,9 @@ if( cmd == val ) { \ gemu_log("%d",cmd); } +#ifdef TARGET_NR__newselect static void -print_fdset(int n, target_ulong target_fds_addr) +print_fdset(int n, abi_ulong target_fds_addr) { int i; @@ -101,7 +102,7 @@ print_fdset(int n, target_ulong target_fds_addr) } static void -print_timeval(target_ulong tv_addr) +print_timeval(abi_ulong tv_addr) { if( tv_addr ) { struct target_timeval *tv; @@ -115,12 +116,14 @@ print_timeval(target_ulong tv_addr) } else gemu_log("NULL"); } +#endif /* * Sysycall specific output functions */ /* select */ +#ifdef TARGET_NR__newselect static long newselect_arg1 = 0; static long newselect_arg2 = 0; static long newselect_arg3 = 0; @@ -129,10 +132,10 @@ static long newselect_arg5 = 0; static void print_newselect(struct syscallname *name, - target_long arg1, target_long arg2, target_long arg3, - target_long arg4, target_long arg5, target_long arg6) + abi_long arg1, abi_long arg2, abi_long arg3, + abi_long arg4, abi_long arg5, abi_long arg6) { - gemu_log("%s(" TARGET_FMT_ld ",", name->name, arg1); + gemu_log("%s(" TARGET_ABI_FMT_ld ",", name->name, arg1); print_fdset(arg1, arg2); gemu_log(","); print_fdset(arg1, arg3); @@ -149,23 +152,24 @@ print_newselect(struct syscallname *name, newselect_arg4=arg4; newselect_arg5=arg5; } +#endif static void print_semctl(struct syscallname *name, - target_long arg1, target_long arg2, target_long arg3, - target_long arg4, target_long arg5, target_long arg6) + abi_long arg1, abi_long arg2, abi_long arg3, + abi_long arg4, abi_long arg5, abi_long arg6) { - gemu_log("%s(" TARGET_FMT_ld "," TARGET_FMT_ld ",", name->name, arg1, arg2); + gemu_log("%s(" TARGET_ABI_FMT_ld "," TARGET_ABI_FMT_ld ",", name->name, arg1, arg2); print_ipc_cmd(arg3); - gemu_log(",0x" TARGET_FMT_lx ")", arg4); + gemu_log(",0x" TARGET_ABI_FMT_lx ")", arg4); } static void print_execve(struct syscallname *name, - target_long arg1, target_long arg2, target_long arg3, - target_long arg4, target_long arg5, target_long arg6) + abi_long arg1, abi_long arg2, abi_long arg3, + abi_long arg4, abi_long arg5, abi_long arg6) { - target_ulong arg_ptr_addr; + abi_ulong arg_ptr_addr; char *s; if (!(s = lock_user_string(arg1))) @@ -173,10 +177,10 @@ print_execve(struct syscallname *name, gemu_log("%s(\"%s\",{", name->name, s); unlock_user(s, arg1, 0); - for (arg_ptr_addr = arg2; ; arg_ptr_addr += sizeof(target_ulong)) { - target_ulong *arg_ptr, arg_addr, s_addr; + for (arg_ptr_addr = arg2; ; arg_ptr_addr += sizeof(abi_ulong)) { + abi_ulong *arg_ptr, arg_addr, s_addr; - arg_ptr = lock_user(VERIFY_READ, arg_ptr_addr, sizeof(target_ulong), 1); + arg_ptr = lock_user(VERIFY_READ, arg_ptr_addr, sizeof(abi_ulong), 1); if (!arg_ptr) return; arg_addr = tswapl(*arg_ptr); @@ -192,10 +196,11 @@ print_execve(struct syscallname *name, gemu_log("NULL})"); } +#ifdef TARGET_NR_ipc static void print_ipc(struct syscallname *name, - target_long arg1, target_long arg2, target_long arg3, - target_long arg4, target_long arg5, target_long arg6) + abi_long arg1, abi_long arg2, abi_long arg3, + abi_long arg4, abi_long arg5, abi_long arg6) { switch(arg1) { case IPCOP_semctl: @@ -203,38 +208,39 @@ print_ipc(struct syscallname *name, print_semctl(name,arg2,arg3,arg4,arg5,arg6,0); break; default: - gemu_log("%s(" TARGET_FMT_ld "," TARGET_FMT_ld "," TARGET_FMT_ld "," TARGET_FMT_ld ")", + gemu_log("%s(" TARGET_ABI_FMT_ld "," TARGET_ABI_FMT_ld "," TARGET_ABI_FMT_ld "," TARGET_ABI_FMT_ld ")", name->name, arg1, arg2, arg3, arg4); } } +#endif /* * Variants for the return value output function */ static void -print_syscall_ret_addr(struct syscallname *name, target_long ret) +print_syscall_ret_addr(struct syscallname *name, abi_long ret) { if( ret == -1 ) { gemu_log(" = -1 errno=%d (%s)\n", errno, target_strerror(errno)); } else { - gemu_log(" = " TARGET_FMT_lx "\n", ret); + gemu_log(" = " TARGET_ABI_FMT_lx "\n", ret); } } #if 0 /* currently unused */ static void -print_syscall_ret_raw(struct syscallname *name, target_long ret) +print_syscall_ret_raw(struct syscallname *name, abi_long ret) { - gemu_log(" = " TARGET_FMT_lx "\n", ret); + gemu_log(" = " TARGET_ABI_FMT_lx "\n", ret); } #endif #ifdef TARGET_NR__newselect static void -print_syscall_ret_newselect(struct syscallname *name, target_long ret) +print_syscall_ret_newselect(struct syscallname *name, abi_long ret) { - gemu_log(" = " TARGET_FMT_lx " (", ret); + gemu_log(" = " TARGET_ABI_FMT_lx " (", ret); print_fdset(newselect_arg1,newselect_arg2); gemu_log(","); print_fdset(newselect_arg1,newselect_arg3); @@ -261,8 +267,8 @@ static int nsyscalls = sizeof(scnames)/sizeof(struct syscallname); */ void print_syscall(int num, - target_long arg1, target_long arg2, target_long arg3, - target_long arg4, target_long arg5, target_long arg6) + abi_long arg1, abi_long arg2, abi_long arg3, + abi_long arg4, abi_long arg5, abi_long arg6) { int i; char *format="%s(%ld,%ld,%ld,%ld,%ld,%ld)"; @@ -284,7 +290,7 @@ print_syscall(int num, void -print_syscall_ret(int num, target_long ret) +print_syscall_ret(int num, abi_long ret) { int i; @@ -294,9 +300,9 @@ print_syscall_ret(int num, target_long ret) scnames[i].result(&scnames[i],ret); } else { if( ret < 0 ) { - gemu_log(" = -1 errno=%d (%s)\n", -ret, target_strerror(-ret)); + gemu_log(" = -1 errno=" TARGET_ABI_FMT_ld " (%s)\n", -ret, target_strerror(-ret)); } else { - gemu_log(" = %d\n", ret); + gemu_log(" = " TARGET_ABI_FMT_ld "\n", ret); } } break; |