[PATCH 3/3] avr32: add support for new architecture AVR32

Denys Vlasenko dvlasenk at redhat.com
Wed Feb 25 14:27:59 UTC 2009


On Tue, 2009-02-24 at 14:58 +0100, Hans-Christian Egtvedt wrote:
> This patch adds AVR32 architecture support to strace. Implemented by
> Håvard Skinnemoen (haavard.skinnemoen at atmel.com) and ported to latest
> CVS HEAD by Hans-Christian Egtvedt (hans-christian.egtvedt at atmel.com).
> 
> Tested on AP7000 with some random commands, and behaves nice. I also
> tried going through the test/ directory, but they seem to be a bit
> outdated and a bit x86 specific AFAICT?

I committed your cleanup patches fro test/* and warning
removal for strace.c, but this one has slight problem:

patching file process.c
Hunk #3 FAILED at 3020.
Hunk #4 FAILED at 3114.
Hunk #5 FAILED at 3130.
3 out of 5 hunks FAILED -- saving rejects to file process.c.rej

Care to rediff against current cvs?

> --- a/process.c
> +++ b/process.c
> @@ -728,6 +728,10 @@ change_syscall(struct tcb *tcp, int new)
>  	if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(REG_A3), new)<0)
>  	    	return -1;
>  	return 0;
> +#elif defined(AVR32)
> +       if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(REG_R8), new) < 0)
> +	       return -1;
> +       return 0;
>  #elif defined(BFIN)
>  	if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(REG_P0), new)<0)
>  		return -1;
> @@ -788,7 +792,29 @@ setarg(tcp, argnum)
>  	struct tcb *tcp;
>  	int argnum;
>  {
> -#if defined (IA64)
> +#if defined(AVR32)
> +	{
> +		errno = 0;
> +		if (argnum == 0)
> +			ptrace(PTRACE_POKEUSER, tcp->pid,
> +			       (char *)(REG_R12_ORIG),
> +			       tcp->u_arg[argnum]);
> +		else if (argnum < 4)
> +			/* r11 .. r9 */
> +			ptrace(PTRACE_POKEUSER, tcp->pid,
> +			       (char *)(REG_R12 - 4 * argnum),
> +			       tcp->u_arg[argnum]);
> +		else if (argnum < 6)
> +			/* r6 .. r5 */
> +			ptrace(PTRACE_POKEUSER, tcp->pid,
> +			       (char *)(REG_R10 - 4 * argnum),
> +			       tcp->u_arg[argnum]);


You may want to use do_ptrace() if you want to get
ptrace errors reported here.

--
vda







More information about the Strace-devel mailing list