File ltrace.s390-more-arguments.patch of Package ltrace

https://bugzilla.novell.com/show_bug.cgi?id=349987

ltrace is not getting values of arguments with arg_num greater than 4 in s390.
ltrace is exiting in s390 when getnameinfo() syscall is called which has got 7 arguments.

---
 sysdeps/linux-gnu/s390/trace.c |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

--- a/sysdeps/linux-gnu/s390/trace.c
+++ b/sysdeps/linux-gnu/s390/trace.c
@@ -185,8 +185,18 @@ long gimme_arg(enum tof type, struct pro
 		ret = ptrace(PTRACE_PEEKUSER, proc->pid, PT_GPR6, 0);
 		break;
 	default:
-		fprintf(stderr, "gimme_arg called with wrong arguments\n");
-		exit(2);
+		if(arg_num >= 5){
+#ifdef __s390x__
+			ret = ptrace(PTRACE_PEEKUSER, proc->pid,
+					proc->stack_pointer + 160 +
+					8 * (arg_num - 5), 0);
+#else
+			ret = ptrace(PTRACE_PEEKUSER, proc->pid,
+					proc->stack_pointer + 96 +
+					4 * (arg_num - 5), 0);
+#endif
+                }
+
 	}
 #ifdef __s390x__
 	if (proc->mask_32bit)
openSUSE Build Service is sponsored by