Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Nov 2005 15:48:39 +1000
From:      Peter Grehan <grehan@freebsd.org>
To:        Arun Sharma <arun@sharma-home.net>
Cc:        alex@rinet.ru, freebsd-ppc@freebsd.org
Subject:   Re: strace for powerpc
Message-ID:  <438D3D37.60007@freebsd.org>
In-Reply-To: <438C7502.8050401@sharma-home.net>
References:  <4389EB8A.9070200@sharma-home.net> <438C7502.8050401@sharma-home.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Arun,

> Couple of things that I noticed aren't working well:
> 
> - when a system call fails, the return value and the error code are wrong.

  You may want to test for the presence of the high bit in the CR rather 
than equality

i.e.

+#elif defined(POWERPC)
+		if ((regs.cr & 0x10000000) == 0x10000000) {
+ 		        tcp->u_rval = -1;
+		        u_error = regs.fixreg[FIRSTARG];

  Also, the value should be OR'd to the CR instead of assigned:

+	if (error) {
+		regs.cr |= 0x10000000;
+		regs.fixreg[FIRSTARG] = error;

> - I'm not sure if frame.lr is the equivalent of regs.r_eip on i386. From 
> the powerpc manuals, it looks like SRR0 contains the address where the 
> syscall would return to.

  Yep, that's correct for the syscall exception.

later,

Peter.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?438D3D37.60007>