Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@oss.sgi.com>
To: Jun Sun <jsun@mvista.com>,
	Keith M Wesolowski <wesolows@chem.unr.edu>,
	linux-mips@fnet.fr, linux@cthulhu.engr.sgi.com
Subject: Re: strace on Linux/MIPS?
Date: Fri, 28 Jul 2000 23:46:04 +0200	[thread overview]
Message-ID: <20000728234604.A8874@bacchus.dhis.org> (raw)
In-Reply-To: <20000728135139.A4903@cistron.nl>; from wichert@cistron.nl on Fri, Jul 28, 2000 at 01:51:39PM +0200

On Fri, Jul 28, 2000 at 01:51:39PM +0200, Wichert Akkerman wrote:

> Previously Ralf Baechle wrote:
> > Looks like strace is still tryping to copy mmap_arg_struct like on Intel
> > but on MIPS we don't use that?
> 
> Could be, I think MIPS and i386 use the same codepath there. Patches
> are appreciated so I can include them in strace 4.3 (eta 3 weeks from
> now)

Here's the second strace patch, please apply.

I noticed that process.c:change_syscall() can't work as is - the all kernels
would change the v0 register - and happily use the old value that is take
the wrong syscall.  A kernel buglet which also hits the usermode kernel
and which I'll fix asap.

  Ralf

--- strace/process.c.orig	Fri Jul 28 23:37:14 2000
+++ strace/process.c	Fri Jul 28 23:33:43 2000
@@ -502,6 +502,24 @@
 		if (errno)
 			return -1;
 	}
+#elif defined(MIPS)
+	{
+		errno = 0;
+		if (argnum < 4)
+			ptrace(PTRACE_POKEUSER, tcp->pid,
+			       (char*)(REG_A0 + argnum), tcp->u_arg[argnum]);
+		else {
+			unsigned long *sp;
+
+			if (upeek(tcp->pid, REG_SP, (long *) &sp) , 0)
+				return -1;
+
+			ptrace(PTRACE_POKEDATA, tcp->pid,
+			       (char*)(sp + argnum - 4), tcp->u_arg[argnum]);
+		}
+		if (errno)
+			return -1;
+	}
 #else
 # warning Sorry, setargs not implemented for this architecture.
 #endif

  parent reply	other threads:[~2000-07-31  0:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-07-27 23:05 strace on Linux/MIPS? Jun Sun
2000-07-27 23:12 ` Keith M Wesolowski
2000-07-27 23:46   ` Jun Sun
2000-07-28  0:11     ` Ralf Baechle
2000-07-28  2:12       ` Jun Sun
2000-07-28  2:21         ` Ralf Baechle
2000-07-28 11:51           ` Wichert Akkerman
2000-07-28 17:52             ` Ralf Baechle
2000-07-28 21:46             ` Ralf Baechle [this message]
2000-07-28 10:22     ` Maciej W. Rozycki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20000728234604.A8874@bacchus.dhis.org \
    --to=ralf@oss.sgi.com \
    --cc=jsun@mvista.com \
    --cc=linux-mips@fnet.fr \
    --cc=linux@cthulhu.engr.sgi.com \
    --cc=wesolows@chem.unr.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox