use correct types
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3596 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
8a4ed7ef48
commit
c16f9ed3ad
@ -166,9 +166,9 @@ extern FILE *logfile;
|
|||||||
|
|
||||||
/* strace.c */
|
/* strace.c */
|
||||||
void print_syscall(int num,
|
void print_syscall(int num,
|
||||||
target_long arg1, target_long arg2, target_long arg3,
|
abi_long arg1, abi_long arg2, abi_long arg3,
|
||||||
target_long arg4, target_long arg5, target_long arg6);
|
abi_long arg4, abi_long arg5, abi_long arg6);
|
||||||
void print_syscall_ret(int num, target_long arg1);
|
void print_syscall_ret(int num, abi_long arg1);
|
||||||
extern int do_strace;
|
extern int do_strace;
|
||||||
|
|
||||||
/* signal.c */
|
/* signal.c */
|
||||||
|
@ -16,9 +16,9 @@ struct syscallname {
|
|||||||
char *name;
|
char *name;
|
||||||
char *format;
|
char *format;
|
||||||
void (*call)(struct syscallname *,
|
void (*call)(struct syscallname *,
|
||||||
target_long, target_long, target_long,
|
abi_long, abi_long, abi_long,
|
||||||
target_long, target_long, target_long);
|
abi_long, abi_long, abi_long);
|
||||||
void (*result)(struct syscallname *, target_long);
|
void (*result)(struct syscallname *, abi_long);
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -74,8 +74,9 @@ if( cmd == val ) { \
|
|||||||
gemu_log("%d",cmd);
|
gemu_log("%d",cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef TARGET_NR__newselect
|
||||||
static void
|
static void
|
||||||
print_fdset(int n, target_ulong target_fds_addr)
|
print_fdset(int n, abi_ulong target_fds_addr)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -101,7 +102,7 @@ print_fdset(int n, target_ulong target_fds_addr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
print_timeval(target_ulong tv_addr)
|
print_timeval(abi_ulong tv_addr)
|
||||||
{
|
{
|
||||||
if( tv_addr ) {
|
if( tv_addr ) {
|
||||||
struct target_timeval *tv;
|
struct target_timeval *tv;
|
||||||
@ -115,12 +116,14 @@ print_timeval(target_ulong tv_addr)
|
|||||||
} else
|
} else
|
||||||
gemu_log("NULL");
|
gemu_log("NULL");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Sysycall specific output functions
|
* Sysycall specific output functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* select */
|
/* select */
|
||||||
|
#ifdef TARGET_NR__newselect
|
||||||
static long newselect_arg1 = 0;
|
static long newselect_arg1 = 0;
|
||||||
static long newselect_arg2 = 0;
|
static long newselect_arg2 = 0;
|
||||||
static long newselect_arg3 = 0;
|
static long newselect_arg3 = 0;
|
||||||
@ -129,10 +132,10 @@ static long newselect_arg5 = 0;
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
print_newselect(struct syscallname *name,
|
print_newselect(struct syscallname *name,
|
||||||
target_long arg1, target_long arg2, target_long arg3,
|
abi_long arg1, abi_long arg2, abi_long arg3,
|
||||||
target_long arg4, target_long arg5, target_long arg6)
|
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);
|
print_fdset(arg1, arg2);
|
||||||
gemu_log(",");
|
gemu_log(",");
|
||||||
print_fdset(arg1, arg3);
|
print_fdset(arg1, arg3);
|
||||||
@ -149,23 +152,24 @@ print_newselect(struct syscallname *name,
|
|||||||
newselect_arg4=arg4;
|
newselect_arg4=arg4;
|
||||||
newselect_arg5=arg5;
|
newselect_arg5=arg5;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
print_semctl(struct syscallname *name,
|
print_semctl(struct syscallname *name,
|
||||||
target_long arg1, target_long arg2, target_long arg3,
|
abi_long arg1, abi_long arg2, abi_long arg3,
|
||||||
target_long arg4, target_long arg5, target_long arg6)
|
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);
|
print_ipc_cmd(arg3);
|
||||||
gemu_log(",0x" TARGET_FMT_lx ")", arg4);
|
gemu_log(",0x" TARGET_ABI_FMT_lx ")", arg4);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
print_execve(struct syscallname *name,
|
print_execve(struct syscallname *name,
|
||||||
target_long arg1, target_long arg2, target_long arg3,
|
abi_long arg1, abi_long arg2, abi_long arg3,
|
||||||
target_long arg4, target_long arg5, target_long arg6)
|
abi_long arg4, abi_long arg5, abi_long arg6)
|
||||||
{
|
{
|
||||||
target_ulong arg_ptr_addr;
|
abi_ulong arg_ptr_addr;
|
||||||
char *s;
|
char *s;
|
||||||
|
|
||||||
if (!(s = lock_user_string(arg1)))
|
if (!(s = lock_user_string(arg1)))
|
||||||
@ -173,10 +177,10 @@ print_execve(struct syscallname *name,
|
|||||||
gemu_log("%s(\"%s\",{", name->name, s);
|
gemu_log("%s(\"%s\",{", name->name, s);
|
||||||
unlock_user(s, arg1, 0);
|
unlock_user(s, arg1, 0);
|
||||||
|
|
||||||
for (arg_ptr_addr = arg2; ; arg_ptr_addr += sizeof(target_ulong)) {
|
for (arg_ptr_addr = arg2; ; arg_ptr_addr += sizeof(abi_ulong)) {
|
||||||
target_ulong *arg_ptr, arg_addr, s_addr;
|
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)
|
if (!arg_ptr)
|
||||||
return;
|
return;
|
||||||
arg_addr = tswapl(*arg_ptr);
|
arg_addr = tswapl(*arg_ptr);
|
||||||
@ -192,10 +196,11 @@ print_execve(struct syscallname *name,
|
|||||||
gemu_log("NULL})");
|
gemu_log("NULL})");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef TARGET_NR_ipc
|
||||||
static void
|
static void
|
||||||
print_ipc(struct syscallname *name,
|
print_ipc(struct syscallname *name,
|
||||||
target_long arg1, target_long arg2, target_long arg3,
|
abi_long arg1, abi_long arg2, abi_long arg3,
|
||||||
target_long arg4, target_long arg5, target_long arg6)
|
abi_long arg4, abi_long arg5, abi_long arg6)
|
||||||
{
|
{
|
||||||
switch(arg1) {
|
switch(arg1) {
|
||||||
case IPCOP_semctl:
|
case IPCOP_semctl:
|
||||||
@ -203,38 +208,39 @@ print_ipc(struct syscallname *name,
|
|||||||
print_semctl(name,arg2,arg3,arg4,arg5,arg6,0);
|
print_semctl(name,arg2,arg3,arg4,arg5,arg6,0);
|
||||||
break;
|
break;
|
||||||
default:
|
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);
|
name->name, arg1, arg2, arg3, arg4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Variants for the return value output function
|
* Variants for the return value output function
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void
|
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 ) {
|
if( ret == -1 ) {
|
||||||
gemu_log(" = -1 errno=%d (%s)\n", errno, target_strerror(errno));
|
gemu_log(" = -1 errno=%d (%s)\n", errno, target_strerror(errno));
|
||||||
} else {
|
} else {
|
||||||
gemu_log(" = " TARGET_FMT_lx "\n", ret);
|
gemu_log(" = " TARGET_ABI_FMT_lx "\n", ret);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0 /* currently unused */
|
#if 0 /* currently unused */
|
||||||
static void
|
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
|
#endif
|
||||||
|
|
||||||
#ifdef TARGET_NR__newselect
|
#ifdef TARGET_NR__newselect
|
||||||
static void
|
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);
|
print_fdset(newselect_arg1,newselect_arg2);
|
||||||
gemu_log(",");
|
gemu_log(",");
|
||||||
print_fdset(newselect_arg1,newselect_arg3);
|
print_fdset(newselect_arg1,newselect_arg3);
|
||||||
@ -261,8 +267,8 @@ static int nsyscalls = sizeof(scnames)/sizeof(struct syscallname);
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
print_syscall(int num,
|
print_syscall(int num,
|
||||||
target_long arg1, target_long arg2, target_long arg3,
|
abi_long arg1, abi_long arg2, abi_long arg3,
|
||||||
target_long arg4, target_long arg5, target_long arg6)
|
abi_long arg4, abi_long arg5, abi_long arg6)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char *format="%s(%ld,%ld,%ld,%ld,%ld,%ld)";
|
char *format="%s(%ld,%ld,%ld,%ld,%ld,%ld)";
|
||||||
@ -284,7 +290,7 @@ print_syscall(int num,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
print_syscall_ret(int num, target_long ret)
|
print_syscall_ret(int num, abi_long ret)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -294,9 +300,9 @@ print_syscall_ret(int num, target_long ret)
|
|||||||
scnames[i].result(&scnames[i],ret);
|
scnames[i].result(&scnames[i],ret);
|
||||||
} else {
|
} else {
|
||||||
if( ret < 0 ) {
|
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 {
|
} else {
|
||||||
gemu_log(" = %d\n", ret);
|
gemu_log(" = " TARGET_ABI_FMT_ld "\n", ret);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user