d42a3d911e0069775456b14fa95bd14a5125e9d9
[packages.git] / utils / strace / patches / 01-linux_sigcontext.patch
1 diff -urN strace-4.5.14/signal.c strace-4.5.14.new/signal.c
2 --- strace-4.5.14/signal.c      2006-01-12 23:34:50.000000000 +0100
3 +++ strace-4.5.14.new/signal.c  2006-12-10 15:14:20.000000000 +0100
4 @@ -66,7 +66,7 @@
5  
6  
7  #ifdef LINUX
8 -
9 +#include <linux/version.h>
10  #ifdef IA64
11  # include <asm/ptrace_offsets.h>
12  #endif /* !IA64 */
13 @@ -1420,7 +1420,11 @@
14                 if (umove(tcp, sp, &sc) < 0)
15                         return 0;
16                 tcp->u_arg[0] = 1;
17 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
18                 tcp->u_arg[1] = sc.sc_sigset;
19 +#else
20 +               tcp->u_arg[1] = sc.sc_hi2;
21 +#endif
22         } else {
23                 tcp->u_rval = tcp->u_error = 0;
24                 if(tcp->u_arg[0] == 0)
25 diff -urN strace-4.5.14/strace.c strace-4.5.14.new/strace.c
26 --- strace-4.5.14/strace.c      2006-01-12 10:50:49.000000000 +0100
27 +++ strace-4.5.14.new/strace.c  2006-12-10 15:15:01.000000000 +0100
28 @@ -2251,7 +2251,7 @@
29                         if (!cflag
30                             && (qual_flags[WSTOPSIG(status)] & QUAL_SIGNAL)) {
31                                 unsigned long addr = 0, pc = 0;
32 -#ifdef PT_GETSIGINFO
33 +#if defined(PT_CR_IPSR) && defined(PT_CR_IIP) && defined(PT_GETSIGINFO)
34  #                              define PSR_RI   41
35                                 struct siginfo si;
36                                 unsigned long psr;
37 diff -urN strace-4.5.14/system.c strace-4.5.14.new/system.c
38 --- strace-4.5.14/system.c      2006-01-12 22:21:06.000000000 +0100
39 +++ strace-4.5.14.new/system.c  2006-12-10 15:14:20.000000000 +0100
40 @@ -78,6 +78,7 @@
41  #endif
42  
43  #include <linux/sysctl.h>
44 +#include <linux/version.h>
45  
46  static const struct xlat mount_flags[] = {
47         { MS_MGC_VAL,   "MS_MGC_VAL"    },
48 @@ -1578,7 +1579,9 @@
49         { CTL_KERN, "CTL_KERN" },
50         { CTL_VM, "CTL_VM" },
51         { CTL_NET, "CTL_NET" },
52 -       { CTL_PROC, "CTL_PROC" },
53 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
54 +        { CTL_PROC, "CTL_PROC" },
55 +#endif
56         { CTL_FS, "CTL_FS" },
57         { CTL_DEBUG, "CTL_DEBUG" },
58         { CTL_DEV, "CTL_DEV" },