MIPS64 support for strace

Daniel Jacobowitz drow at false.org
Fri Aug 31 21:17:46 UTC 2007

A long time ago (around 2003 - 2004) I ported strace to mips64 for
MontaVista.  This covered all three supported ABIs - o32, n32, n64.

At the time, the N32 ptrace interface was unique: on most platforms it
takes and returns longs, but on N32 it took and returned "long long".
This was a serious hassle.  Since then, we've changed N32 ptrace to be
more traditional.  It takes and returns longs.  If you access general
registers using PTRACE_PEEKUSR / PTRACE_POKEUSR you fetch the low half
of the register and set the register to a sign-extended 32-bit value.
This simplified the strace port considerably.

We still need to fetch 64-bit registers sometimes.  For instance,
sys_lseek takes a 64-bit offset in a single register.  Too many things
assume that u_arg is an array of longs for me to change it, so I
added an ext_arg array containing the full values and used it where

I also corrected several bugs relating to execve and signals for the
existing 32-bit MIPS port.

This patch works fine.  The syscall lists for N32 and N64 are a bit
out of date, but accurate as far as they go.  I hope it can be merged.

The patch was too big for the mailing list and was held for
moderation.  Meanwhile, you can find it here:


Daniel Jacobowitz

More information about the Strace-devel mailing list