Add several upstream patches
This commit is contained in:
parent
0039e5654c
commit
1e29979d39
12
ltrace-0.6.0-clone-test.patch
Normal file
12
ltrace-0.6.0-clone-test.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff --git a/testsuite/ltrace.minor/trace-clone.c b/testsuite/ltrace.minor/trace-clone.c
|
||||
index a1ccb22..6e1c809 100644
|
||||
--- a/testsuite/ltrace.minor/trace-clone.c
|
||||
+++ b/testsuite/ltrace.minor/trace-clone.c
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
This file was written by Yao Qi <qiyao@cn.ibm.com>. */
|
||||
|
||||
+#define _GNU_SOURCE
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <stdlib.h>
|
||||
203
ltrace-0.6.0-endian.patch
Normal file
203
ltrace-0.6.0-endian.patch
Normal file
@ -0,0 +1,203 @@
|
||||
diff --git a/sysdeps/linux-gnu/alpha/arch.h b/sysdeps/linux-gnu/alpha/arch.h
|
||||
index 1107b5f..2dfeec7 100644
|
||||
--- a/sysdeps/linux-gnu/alpha/arch.h
|
||||
+++ b/sysdeps/linux-gnu/alpha/arch.h
|
||||
@@ -1,6 +1,7 @@
|
||||
#define BREAKPOINT_VALUE { 0x80, 0x00, 0x00, 0x00 }
|
||||
#define BREAKPOINT_LENGTH 4
|
||||
#define DECR_PC_AFTER_BREAK 4
|
||||
+#define ARCH_ENDIAN_LITTLE
|
||||
|
||||
#define LT_ELFCLASS ELFCLASS64
|
||||
#define LT_ELF_MACHINE EM_ALPHA
|
||||
diff --git a/sysdeps/linux-gnu/arm/arch.h b/sysdeps/linux-gnu/arm/arch.h
|
||||
index 8f2dfb3..e2a62ab 100644
|
||||
--- a/sysdeps/linux-gnu/arm/arch.h
|
||||
+++ b/sysdeps/linux-gnu/arm/arch.h
|
||||
@@ -6,6 +6,7 @@
|
||||
#define THUMB_BREAKPOINT_VALUE { 0x01, 0xde }
|
||||
#define THUMB_BREAKPOINT_LENGTH 2
|
||||
#define DECR_PC_AFTER_BREAK 0
|
||||
+#define ARCH_ENDIAN_LITTLE
|
||||
|
||||
#define LT_ELFCLASS ELFCLASS32
|
||||
#define LT_ELF_MACHINE EM_ARM
|
||||
diff --git a/sysdeps/linux-gnu/i386/arch.h b/sysdeps/linux-gnu/i386/arch.h
|
||||
index dc7383f..15f0d78 100644
|
||||
--- a/sysdeps/linux-gnu/i386/arch.h
|
||||
+++ b/sysdeps/linux-gnu/i386/arch.h
|
||||
@@ -1,6 +1,7 @@
|
||||
#define BREAKPOINT_VALUE {0xcc}
|
||||
#define BREAKPOINT_LENGTH 1
|
||||
#define DECR_PC_AFTER_BREAK 1
|
||||
+#define ARCH_ENDIAN_LITTLE
|
||||
|
||||
#define LT_ELFCLASS ELFCLASS32
|
||||
#define LT_ELF_MACHINE EM_386
|
||||
diff --git a/sysdeps/linux-gnu/ia64/arch.h b/sysdeps/linux-gnu/ia64/arch.h
|
||||
index 673047c..d7e0d23 100644
|
||||
--- a/sysdeps/linux-gnu/ia64/arch.h
|
||||
+++ b/sysdeps/linux-gnu/ia64/arch.h
|
||||
@@ -4,6 +4,7 @@
|
||||
#define BREAKPOINT_LENGTH 16
|
||||
#define BREAKPOINT_VALUE {0}
|
||||
#define DECR_PC_AFTER_BREAK 0
|
||||
+#define ARCH_ENDIAN_LITTLE
|
||||
|
||||
#define LT_ELFCLASS ELFCLASS64
|
||||
#define LT_ELF_MACHINE EM_IA_64
|
||||
diff --git a/sysdeps/linux-gnu/m68k/arch.h b/sysdeps/linux-gnu/m68k/arch.h
|
||||
index 1790d09..44fad89 100644
|
||||
--- a/sysdeps/linux-gnu/m68k/arch.h
|
||||
+++ b/sysdeps/linux-gnu/m68k/arch.h
|
||||
@@ -1,6 +1,7 @@
|
||||
#define BREAKPOINT_VALUE { 0x4e, 0x4f }
|
||||
#define BREAKPOINT_LENGTH 2
|
||||
#define DECR_PC_AFTER_BREAK 2
|
||||
+#define ARCH_ENDIAN_BIG
|
||||
|
||||
#define LT_ELFCLASS ELFCLASS32
|
||||
#define LT_ELF_MACHINE EM_68K
|
||||
diff --git a/sysdeps/linux-gnu/mipsel/arch.h b/sysdeps/linux-gnu/mipsel/arch.h
|
||||
index dd0ca35..45c4598 100644
|
||||
--- a/sysdeps/linux-gnu/mipsel/arch.h
|
||||
+++ b/sysdeps/linux-gnu/mipsel/arch.h
|
||||
@@ -1,6 +1,7 @@
|
||||
#define BREAKPOINT_VALUE { 0x0d, 0x00, 0x00, 0x00 }
|
||||
#define BREAKPOINT_LENGTH 4
|
||||
#define DECR_PC_AFTER_BREAK 0
|
||||
+#define ARCH_ENDIAN_LITTLE
|
||||
|
||||
#define LT_ELFCLASS ELFCLASS32
|
||||
#define LT_ELF_MACHINE EM_MIPS
|
||||
diff --git a/sysdeps/linux-gnu/ppc/arch.h b/sysdeps/linux-gnu/ppc/arch.h
|
||||
index 711b4a3..8b955e8 100644
|
||||
--- a/sysdeps/linux-gnu/ppc/arch.h
|
||||
+++ b/sysdeps/linux-gnu/ppc/arch.h
|
||||
@@ -14,7 +14,7 @@
|
||||
#define PLT_REINITALISATION_BP "_start"
|
||||
|
||||
/* Start of arch-specific functions. */
|
||||
-#define ARCH_HAVE_UMOVELONG
|
||||
+#define ARCH_ENDIAN_BIG
|
||||
|
||||
#define PPC_NOP { 0x60, 0x00, 0x00, 0x00 }
|
||||
#define PPC_NOP_LENGTH 4
|
||||
diff -up ltrace-0.6.0/sysdeps/linux-gnu/ppc/trace.c\~ ltrace-0.6.0/sysdeps/linux-gnu/ppc/trace.c
|
||||
--- ltrace-0.6.0/sysdeps/linux-gnu/ppc/trace.c~ 2011-02-14 16:48:25.000000000 +0100
|
||||
+++ ltrace-0.6.0/sysdeps/linux-gnu/ppc/trace.c 2011-09-03 00:18:14.518317665 +0200
|
||||
@@ -156,34 +156,3 @@ save_register_args(enum tof type, Proces
|
||||
memcpy(&arch->regs_copy, &arch->regs, sizeof(arch->regs));
|
||||
memcpy(&arch->fpregs_copy, &arch->fpregs, sizeof(arch->fpregs));
|
||||
}
|
||||
-
|
||||
-/* Read a single long from the process's memory address 'addr'. */
|
||||
-int
|
||||
-arch_umovelong (Process *proc, void *addr, long *result, arg_type_info *info) {
|
||||
- long pointed_to;
|
||||
-
|
||||
- errno = 0;
|
||||
-
|
||||
- pointed_to = ptrace (PTRACE_PEEKTEXT, proc->pid, addr, 0);
|
||||
-
|
||||
- if (pointed_to == -1 && errno)
|
||||
- return -errno;
|
||||
-
|
||||
- /* Since int's are 4-bytes (long is 8-bytes) in length for ppc64, we
|
||||
- need to shift the long values returned by ptrace to end up with
|
||||
- the correct value. */
|
||||
-
|
||||
- if (info) {
|
||||
- if (info->type == ARGTYPE_INT || (proc->mask_32bit && (info->type == ARGTYPE_POINTER
|
||||
- || info->type == ARGTYPE_STRING))) {
|
||||
- pointed_to = pointed_to >> 32;
|
||||
-
|
||||
- /* Make sure we have nothing in the upper word so we can
|
||||
- do a explicit cast from long to int later in the code. */
|
||||
- pointed_to &= 0x00000000ffffffff;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- *result = pointed_to;
|
||||
- return 0;
|
||||
-}
|
||||
diff --git a/sysdeps/linux-gnu/s390/arch.h b/sysdeps/linux-gnu/s390/arch.h
|
||||
index 5cf168c..c6fed74 100644
|
||||
--- a/sysdeps/linux-gnu/s390/arch.h
|
||||
+++ b/sysdeps/linux-gnu/s390/arch.h
|
||||
@@ -6,6 +6,7 @@
|
||||
#define BREAKPOINT_VALUE { 0x00, 0x01 }
|
||||
#define BREAKPOINT_LENGTH 2
|
||||
#define DECR_PC_AFTER_BREAK 2
|
||||
+#define ARCH_ENDIAN_BIG
|
||||
|
||||
#ifdef __s390x__
|
||||
#define LT_ELFCLASS ELFCLASS64
|
||||
diff --git a/sysdeps/linux-gnu/sparc/arch.h b/sysdeps/linux-gnu/sparc/arch.h
|
||||
index 75251b8..bec22ce 100644
|
||||
--- a/sysdeps/linux-gnu/sparc/arch.h
|
||||
+++ b/sysdeps/linux-gnu/sparc/arch.h
|
||||
@@ -1,6 +1,7 @@
|
||||
#define BREAKPOINT_VALUE {0x91, 0xd0, 0x20, 0x01}
|
||||
#define BREAKPOINT_LENGTH 4
|
||||
#define DECR_PC_AFTER_BREAK 0
|
||||
+#define ARCH_ENDIAN_BIG
|
||||
|
||||
#define LT_ELFCLASS ELFCLASS32
|
||||
#define LT_ELF_MACHINE EM_SPARC
|
||||
diff --git a/sysdeps/linux-gnu/trace.c b/sysdeps/linux-gnu/trace.c
|
||||
index e4be465..9b0b980 100644
|
||||
--- a/sysdeps/linux-gnu/trace.c
|
||||
+++ b/sysdeps/linux-gnu/trace.c
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <assert.h>
|
||||
|
||||
#include "common.h"
|
||||
+#include "config.h"
|
||||
|
||||
/* If the system headers did not provide the constants, hard-code the normal
|
||||
values. */
|
||||
@@ -54,15 +55,23 @@ umovelong (Process *proc, void *addr, long *result, arg_type_info *info) {
|
||||
if (pointed_to == -1 && errno)
|
||||
return -errno;
|
||||
|
||||
- *result = pointed_to;
|
||||
- if (info) {
|
||||
- switch(info->type) {
|
||||
- case ARGTYPE_INT:
|
||||
- *result &= 0x00000000ffffffffUL;
|
||||
- default:
|
||||
- break;
|
||||
- };
|
||||
+#if SIZEOF_LONG == 8
|
||||
+ if (info != NULL
|
||||
+ && (info->type == ARGTYPE_INT
|
||||
+ || (proc->mask_32bit
|
||||
+ && (info->type == ARGTYPE_POINTER
|
||||
+ || info->type == ARGTYPE_STRING)))) {
|
||||
+#if defined (ARCH_ENDIAN_LITTLE)
|
||||
+ pointed_to &= 0x00000000ffffffffUL;
|
||||
+#elif defined (ARCH_ENDIAN_BIG)
|
||||
+ pointed_to = (long)(((unsigned long)pointed_to) >> 32);
|
||||
+#else
|
||||
+# error arch.h has to define endianness
|
||||
+#endif
|
||||
}
|
||||
+#endif
|
||||
+
|
||||
+ *result = pointed_to;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
diff --git a/sysdeps/linux-gnu/x86_64/arch.h b/sysdeps/linux-gnu/x86_64/arch.h
|
||||
index 255395c..34376c4 100644
|
||||
--- a/sysdeps/linux-gnu/x86_64/arch.h
|
||||
+++ b/sysdeps/linux-gnu/x86_64/arch.h
|
||||
@@ -1,6 +1,7 @@
|
||||
#define BREAKPOINT_VALUE {0xcc}
|
||||
#define BREAKPOINT_LENGTH 1
|
||||
#define DECR_PC_AFTER_BREAK 1
|
||||
+#define ARCH_ENDIAN_LITTLE
|
||||
|
||||
#define LT_ELFCLASS ELFCLASS64
|
||||
#define LT_ELF_MACHINE EM_X86_64
|
||||
2797
ltrace-0.6.0-threads.patch
Normal file
2797
ltrace-0.6.0-threads.patch
Normal file
File diff suppressed because it is too large
Load Diff
12
ltrace.spec
12
ltrace.spec
@ -1,7 +1,7 @@
|
||||
Summary: Tracks runtime library calls from dynamically linked executables
|
||||
Name: ltrace
|
||||
Version: 0.6.0
|
||||
Release: 1%{?dist}
|
||||
Release: 2%{?dist}
|
||||
URL: http://ltrace.alioth.debian.org/
|
||||
License: GPLv2+
|
||||
Group: Development/Debuggers
|
||||
@ -20,6 +20,9 @@ Patch2: ltrace-0.6.0-exec-stripped.patch
|
||||
Patch3: ltrace-0.5-demangle.patch
|
||||
Patch4: ltrace-0.5-etc-memmove.patch
|
||||
Patch5: ltrace-0.6.0-return-string-n.patch
|
||||
Patch6: ltrace-0.6.0-threads.patch
|
||||
Patch7: ltrace-0.6.0-endian.patch
|
||||
Patch8: ltrace-0.6.0-clone-test.patch
|
||||
|
||||
%description
|
||||
Ltrace is a debugging program which runs a specified command until the
|
||||
@ -38,6 +41,9 @@ execution of processes.
|
||||
#%patch3 -p1
|
||||
%patch4 -p1
|
||||
%patch5 -p1
|
||||
%patch6 -p1
|
||||
%patch7 -p1
|
||||
%patch8 -p1
|
||||
sed -i -e 's/-o root -g root//' Makefile.in
|
||||
|
||||
%build
|
||||
@ -70,6 +76,10 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%config(noreplace) %{_sysconfdir}/ltrace.conf
|
||||
|
||||
%changelog
|
||||
* Fri Sep 2 2011 Petr Machata <pmachata@redhat.com> - 0.6.0-2
|
||||
- Add upstream patches for tracing multi-threaded processes, endian
|
||||
fixes, and a test suite fixlet
|
||||
|
||||
* Tue Feb 15 2011 Petr Machata <pmachata@redhat.com> - 0.6.0-1
|
||||
- Update to 0.6.0
|
||||
- Drop most patches
|
||||
|
||||
Loading…
Reference in New Issue
Block a user