summaryrefslogtreecommitdiff
path: root/mem.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2008-05-20 01:11:56 +0000
committerRoland McGrath <roland@redhat.com>2008-05-20 01:11:56 +0000
commit542c2c6fe2b93ae73221dd5c5c8ed95a73b676e4 (patch)
tree426ac28d91a945fa8a11a99b8669095191ed8b84 /mem.c
parent9047cfd86dc0efebef543b083e944970c0f96a8d (diff)
downloadstrace-542c2c6fe2b93ae73221dd5c5c8ed95a73b676e4.tar.gz
strace-542c2c6fe2b93ae73221dd5c5c8ed95a73b676e4.tar.bz2
strace-542c2c6fe2b93ae73221dd5c5c8ed95a73b676e4.tar.xz
2007-08-26 Daniel Jacobowitz <dan@codesourcery.com>
* defs.h [MIPS]: Include <sgidefs.h>. (MAX_QUALS): Update for MIPS. (LINUX_MIPSO32, LINUX_MIPSN32, LINUX_MIPSN64, LINUX_MIPS64): Define. (struct tcb): Add ext_arg for MIPS N32. (TCB_WAITEXECVE): Define for MIPS. (ALIGN64): Use LINUX_MIPSO32. * file.c (sys_lseek): Use ext_arg for MIPS N32. (sys_readahead, sys_fadvise64_64): Likewise. * io.c (sys_pread64, sys_pwrite64): Likewise. * mem.c (print_mmap): Take OFFSET argument. (sys_old_mmap): Update call to print_mmap. (sys_mmap): Use ext_arg for MIPS N32. * process.c (struct_user_offsets): Add MIPS registers. * signal.c (sys_sigreturn): Handle MIPS N32 and MIPS N64. Correct MIPS O32 call to sprintsigmask. * syscall.c (internal_syscall): Handle MIPS N32. Check for TCB_WAITEXECVE on MIPS. (force_result): Add a comment about MIPS N32. (syscall_enter): Handle MIPS N32 and MIPS N64. * linux/syscall.h (sys_pread64, sys_pwrite64): Declare. * linux/mips/syscallent.h: Include "dummy.h". Handle alternate MIPS ABIs.
Diffstat (limited to 'mem.c')
-rw-r--r--mem.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/mem.c b/mem.c
index 57b5953..f57dc12 100644
--- a/mem.c
+++ b/mem.c
@@ -191,9 +191,10 @@ static const struct xlat mmap_flags[] = {
#if !HAVE_LONG_LONG_OFF_T
static
int
-print_mmap(tcp,u_arg)
+print_mmap(tcp,u_arg, offset)
struct tcb *tcp;
long *u_arg;
+long long offset;
{
if (entering(tcp)) {
/* addr */
@@ -216,7 +217,7 @@ long *u_arg;
/* fd (is always int, not long) */
tprintf(", %d, ", (int)u_arg[4]);
/* offset */
- tprintf("%#lx", u_arg[5]);
+ tprintf("%#llx", offset);
}
return RVAL_HEX;
}
@@ -265,7 +266,7 @@ struct tcb *tcp;
if (umoven(tcp, tcp->u_arg[0], sizeof u_arg, (char *) u_arg) == -1)
return 0;
#endif // defined(IA64)
- return print_mmap(tcp, u_arg);
+ return print_mmap(tcp, u_arg, u_arg[5]);
}
#endif
@@ -274,6 +275,8 @@ int
sys_mmap(tcp)
struct tcb *tcp;
{
+ long long offset = tcp->u_arg[5];
+
#if defined(LINUX) && defined(SH64)
/*
* Old mmap differs from new mmap in specifying the
@@ -281,9 +284,12 @@ struct tcb *tcp;
* pretend it's in byte units so the user only ever
* sees bytes in the printout.
*/
- tcp->u_arg[5] <<= PAGE_SHIFT;
+ offset <<= PAGE_SHIFT;
+#endif
+#if defined(LINUX_MIPSN32)
+ offset = tcp->ext_arg[5];
#endif
- return print_mmap(tcp, tcp->u_arg);
+ return print_mmap(tcp, tcp->u_arg, offset);
}
#endif /* !HAVE_LONG_LONG_OFF_T */