Browse Source

another try to fix strace for arm/mips/x86

Waldemar Brodkorb 11 years ago
parent
commit
4d52e4eb41

+ 1 - 1
package/strace/Makefile

@@ -5,7 +5,7 @@ include ${TOPDIR}/rules.mk
 
 PKG_NAME:=		strace
 PKG_VERSION:=		4.8
-PKG_RELEASE:=		3
+PKG_RELEASE:=		4
 PKG_MD5SUM:=		c575ef43829586801f514fd91bfe7575
 PKG_DESCR:=		System call trace program
 PKG_SECTION:=		debug

+ 32 - 3
package/strace/patches/patch-defs_h

@@ -1,6 +1,35 @@
 --- strace-4.8.orig/defs.h	2013-05-14 16:10:42.000000000 +0200
-+++ strace-4.8/defs.h	2013-10-24 18:52:25.000000000 +0200
-@@ -155,14 +155,14 @@ extern char *stpcpy(char *dst, const cha
++++ strace-4.8/defs.h	2013-10-25 13:21:18.000000000 +0200
+@@ -37,6 +37,28 @@
+ # endif
+ #endif
+ 
++#ifdef ARM
++struct pt_regs { long uregs[18]; };
++#define ARM_cpsr uregs[16]
++#define ARM_pc uregs[15]
++#define ARM_lr uregs[14]
++#define ARM_sp uregs[13]
++#define ARM_ip uregs[12]
++#define ARM_fp uregs[11]
++#define ARM_r10 uregs[10]
++#define ARM_r9 uregs[9]
++#define ARM_r8 uregs[8]
++#define ARM_r7 uregs[7]
++#define ARM_r6 uregs[6]
++#define ARM_r5 uregs[5]
++#define ARM_r4 uregs[4]
++#define ARM_r3 uregs[3]
++#define ARM_r2 uregs[2]
++#define ARM_r1 uregs[1]
++#define ARM_r0 uregs[0]
++#define ARM_ORIG_r0 uregs[17]
++#endif
++
+ #ifdef MIPS
+ # include <sgidefs.h>
+ # if _MIPS_SIM == _MIPS_SIM_ABI64
+@@ -155,14 +177,14 @@ extern char *stpcpy(char *dst, const cha
      || defined(METAG) \
      || defined(TILE) \
      || defined(XTENSA) \
@@ -17,7 +46,7 @@
  #  define __KERNEL__
  #  include <asm/ptrace.h>
  #  undef __KERNEL__
-@@ -222,11 +222,6 @@ extern long ptrace(int, int, char *, lon
+@@ -222,11 +244,6 @@ extern long ptrace(int, int, char *, lon
  # define PTRACE_EVENT_EXIT	6
  #endif
  

+ 20 - 15
package/strace/patches/patch-process_c

@@ -1,21 +1,26 @@
 --- strace-4.8.orig/process.c	2013-05-18 00:22:19.000000000 +0200
-+++ strace-4.8/process.c	2013-10-24 18:57:55.000000000 +0200
-@@ -56,14 +56,12 @@
++++ strace-4.8/process.c	2013-10-25 13:17:58.000000000 +0200
+@@ -55,19 +55,6 @@
+ # endif
  #endif
  
- #ifdef HAVE_LINUX_PTRACE_H
+-#ifdef HAVE_LINUX_PTRACE_H
 -# undef PTRACE_SYSCALL
- # ifdef HAVE_STRUCT_IA64_FPREG
- #  define ia64_fpreg XXX_ia64_fpreg
- # endif
- # ifdef HAVE_STRUCT_PT_ALL_USER_REGS
- #  define pt_all_user_regs XXX_pt_all_user_regs
- # endif
+-# ifdef HAVE_STRUCT_IA64_FPREG
+-#  define ia64_fpreg XXX_ia64_fpreg
+-# endif
+-# ifdef HAVE_STRUCT_PT_ALL_USER_REGS
+-#  define pt_all_user_regs XXX_pt_all_user_regs
+-# endif
 -# include <linux/ptrace.h>
- # undef ia64_fpreg
- # undef pt_all_user_regs
- #endif
-@@ -2857,7 +2855,7 @@ sys_sched_setscheduler(struct tcb *tcp)
+-# undef ia64_fpreg
+-# undef pt_all_user_regs
+-#endif
+-
+ #if defined(SPARC64)
+ # define r_pc r_tpc
+ # undef PTRACE_GETREGS
+@@ -2857,7 +2844,7 @@ sys_sched_setscheduler(struct tcb *tcp)
  		if (umove(tcp, tcp->u_arg[2], &p) < 0)
  			tprintf(", %#lx", tcp->u_arg[2]);
  		else
@@ -24,7 +29,7 @@
  	}
  	return 0;
  }
-@@ -2872,7 +2870,7 @@ sys_sched_getparam(struct tcb *tcp)
+@@ -2872,7 +2859,7 @@ sys_sched_getparam(struct tcb *tcp)
  		if (umove(tcp, tcp->u_arg[1], &p) < 0)
  			tprintf("%#lx", tcp->u_arg[1]);
  		else
@@ -33,7 +38,7 @@
  	}
  	return 0;
  }
-@@ -2885,7 +2883,7 @@ sys_sched_setparam(struct tcb *tcp)
+@@ -2885,7 +2872,7 @@ sys_sched_setparam(struct tcb *tcp)
  		if (umove(tcp, tcp->u_arg[1], &p) < 0)
  			tprintf("%d, %#lx", (int) tcp->u_arg[0], tcp->u_arg[1]);
  		else

+ 21 - 3
package/strace/patches/patch-signal_c

@@ -1,6 +1,24 @@
 --- strace-4.8.orig/signal.c	2013-05-23 15:41:23.000000000 +0200
-+++ strace-4.8/signal.c	2013-09-13 16:20:20.000000000 +0200
-@@ -61,6 +61,7 @@
++++ strace-4.8/signal.c	2013-10-25 14:36:47.000000000 +0200
+@@ -43,17 +43,6 @@
+ # ifndef PTRACE_POKEUSR
+ #  define PTRACE_POKEUSR PTRACE_POKEUSER
+ # endif
+-#elif defined(HAVE_LINUX_PTRACE_H)
+-# undef PTRACE_SYSCALL
+-# ifdef HAVE_STRUCT_IA64_FPREG
+-#  define ia64_fpreg XXX_ia64_fpreg
+-# endif
+-# ifdef HAVE_STRUCT_PT_ALL_USER_REGS
+-#  define pt_all_user_regs XXX_pt_all_user_regs
+-# endif
+-# include <linux/ptrace.h>
+-# undef ia64_fpreg
+-# undef pt_all_user_regs
+ #endif
+ 
+ #ifdef IA64
+@@ -61,6 +50,7 @@
  #endif
  
  #if defined(SPARC) || defined(SPARC64) || defined(MIPS)
@@ -8,7 +26,7 @@
  typedef struct {
  	struct pt_regs		si_regs;
  	int			si_mask;
-@@ -815,7 +816,7 @@ sys_sigreturn(struct tcb *tcp)
+@@ -815,7 +805,7 @@ sys_sigreturn(struct tcb *tcp)
  {
  #if defined(ARM)
  	if (entering(tcp)) {

+ 20 - 0
package/strace/patches/patch-syscall_c

@@ -0,0 +1,20 @@
+--- strace-4.8.orig/syscall.c	2013-05-14 16:10:42.000000000 +0200
++++ strace-4.8/syscall.c	2013-10-25 14:52:35.000000000 +0200
+@@ -40,17 +40,6 @@
+ # ifndef PTRACE_PEEKUSR
+ #  define PTRACE_PEEKUSR PTRACE_PEEKUSER
+ # endif
+-#elif defined(HAVE_LINUX_PTRACE_H)
+-# undef PTRACE_SYSCALL
+-# ifdef HAVE_STRUCT_IA64_FPREG
+-#  define ia64_fpreg XXX_ia64_fpreg
+-# endif
+-# ifdef HAVE_STRUCT_PT_ALL_USER_REGS
+-#  define pt_all_user_regs XXX_pt_all_user_regs
+-# endif
+-# include <linux/ptrace.h>
+-# undef ia64_fpreg
+-# undef pt_all_user_regs
+ #endif
+ 
+ #if defined(SPARC64)

+ 20 - 0
package/strace/patches/patch-util_c

@@ -0,0 +1,20 @@
+--- strace-4.8.orig/util.c	2013-05-06 20:23:01.000000000 +0200
++++ strace-4.8/util.c	2013-10-25 14:54:06.000000000 +0200
+@@ -47,17 +47,6 @@
+ #ifdef HAVE_SYS_REG_H
+ # include <sys/reg.h>
+ # define PTRACE_PEEKUSR PTRACE_PEEKUSER
+-#elif defined(HAVE_LINUX_PTRACE_H)
+-# undef PTRACE_SYSCALL
+-# ifdef HAVE_STRUCT_IA64_FPREG
+-#  define ia64_fpreg XXX_ia64_fpreg
+-# endif
+-# ifdef HAVE_STRUCT_PT_ALL_USER_REGS
+-#  define pt_all_user_regs XXX_pt_all_user_regs
+-# endif
+-# include <linux/ptrace.h>
+-# undef ia64_fpreg
+-# undef pt_all_user_regs
+ #endif
+ 
+ int