[PATCH] Fix sys_ptrace on ia64

Andreas Schwab schwab at suse.de
Mon Nov 19 16:34:22 UTC 2007


On ia64 the PTRACE_PEEK{TEXT,DATA,USER} operations of ptrace return the
data directly instead of storing it through a supplied pointer.

Andreas.

2007-11-19  Andreas Schwab  <schwab at suse.de>

	* process.c (sys_ptrace) [IA64]: For PTRACE_PEEKDATA,
	PTRACE_PEEKTEXT and PTRACE_PEEKUSER the data is returned directly.

--- process.c	19 Nov 2007 16:45:57 +0100	1.108
+++ process.c	19 Nov 2007 17:24:37 +0100	
@@ -3058,10 +3058,12 @@ struct tcb *tcp;
 			tprintf("%#lx, ", tcp->u_arg[2]);
 #ifdef LINUX
 		switch (tcp->u_arg[0]) {
+#ifndef IA64
 		case PTRACE_PEEKDATA:
 		case PTRACE_PEEKTEXT:
 		case PTRACE_PEEKUSER:
 			break;
+#endif
 		case PTRACE_CONT:
 		case PTRACE_SINGLESTEP:
 		case PTRACE_SYSCALL:
@@ -3077,8 +3079,12 @@ struct tcb *tcp;
 		case PTRACE_PEEKDATA:
 		case PTRACE_PEEKTEXT:
 		case PTRACE_PEEKUSER:
+#ifdef IA64
+			return RVAL_HEX;
+#else
 			printnum(tcp, tcp->u_arg[3], "%#lx");
 			break;
+#endif
 		}
 	}
 #endif /* LINUX */

-- 
Andreas Schwab, SuSE Labs, schwab at suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




More information about the Strace-devel mailing list