strace: update to version 3.8
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> git-svn-id: svn://svn.openwrt.org/openwrt/packages@40632 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
7aa10a3e3d
commit
b50a44af32
@ -10,9 +10,9 @@ include $(INCLUDE_DIR)/kernel.mk
|
|||||||
|
|
||||||
PKG_NAME:=strace
|
PKG_NAME:=strace
|
||||||
|
|
||||||
PKG_VERSION:=4.7
|
PKG_VERSION:=4.8
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
PKG_MD5SUM:=6054c3880a00c6703f83b57f15e04642
|
PKG_MD5SUM:=c575ef43829586801f514fd91bfe7575
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||||
PKG_SOURCE_URL:=@SF/$(PKG_NAME)
|
PKG_SOURCE_URL:=@SF/$(PKG_NAME)
|
||||||
|
@ -1,64 +0,0 @@
|
|||||||
Index: strace-4.5.16/linux/syscallent.h
|
|
||||||
===================================================================
|
|
||||||
--- strace-4.5.16.orig/linux/syscallent.h 2007-08-02 03:37:55.000000000 +0200
|
|
||||||
+++ strace-4.5.16/linux/syscallent.h 2008-05-11 15:35:45.000000000 +0200
|
|
||||||
@@ -130,7 +130,10 @@
|
|
||||||
{ 2, TF, sys_statfs, "statfs" }, /* 99 */
|
|
||||||
{ 2, TD, sys_fstatfs, "fstatfs" }, /* 100 */
|
|
||||||
{ 3, 0, sys_ioperm, "ioperm" }, /* 101 */
|
|
||||||
- { 2, TD, sys_socketcall, "socketcall", SYS_socketcall }, /* 102 */
|
|
||||||
+ { 2, TD, sys_socketcall, "socketcall",
|
|
||||||
+#ifdef __NR_socketcall
|
|
||||||
+ SYS_socketcall }, /* 102 */
|
|
||||||
+#endif
|
|
||||||
{ 3, 0, sys_syslog, "syslog" }, /* 103 */
|
|
||||||
{ 3, 0, sys_setitimer, "setitimer" }, /* 104 */
|
|
||||||
{ 2, 0, sys_getitimer, "getitimer" }, /* 105 */
|
|
||||||
@@ -145,7 +148,10 @@
|
|
||||||
{ 4, TP, sys_wait4, "wait4", SYS_wait4 }, /* 114 */
|
|
||||||
{ 1, 0, sys_swapoff, "swapoff" }, /* 115 */
|
|
||||||
{ 1, 0, sys_sysinfo, "sysinfo" }, /* 116 */
|
|
||||||
- { 6, 0, sys_ipc, "ipc", SYS_ipc }, /* 117 */
|
|
||||||
+ { 6, 0, sys_ipc, "ipc",
|
|
||||||
+#ifdef __NR_ipc
|
|
||||||
+ SYS_ipc }, /* 117 */
|
|
||||||
+#endif
|
|
||||||
{ 1, TD, sys_fsync, "fsync" }, /* 118 */
|
|
||||||
{ 1, TS, sys_sigreturn, "sigreturn" }, /* 119 */
|
|
||||||
{ 5, TP, sys_clone, "clone", SYS_clone }, /* 120 */
|
|
||||||
@@ -282,7 +288,11 @@
|
|
||||||
{ 3, 0, sys_io_cancel, "io_cancel" }, /* 249 */
|
|
||||||
{ 5, 0, sys_fadvise64, "fadvise64" }, /* 250 */
|
|
||||||
{ 5, 0, printargs, "SYS_251" }, /* 251 */
|
|
||||||
- { 1, TP, sys_exit, "exit_group", __NR_exit_group }, /* 252 */
|
|
||||||
+ { 1, TP, sys_exit, "exit_group"
|
|
||||||
+#ifdef __NR_exit_group
|
|
||||||
+ , __NR_exit_group
|
|
||||||
+#endif
|
|
||||||
+ }, /* 252 */
|
|
||||||
{ 4, 0, printargs, "lookup_dcookie"}, /* 253 */
|
|
||||||
{ 1, 0, sys_epoll_create, "epoll_create" }, /* 254 */
|
|
||||||
{ 4, TD, sys_epoll_ctl, "epoll_ctl" }, /* 255 */
|
|
||||||
Index: strace-4.5.16/syscall.c
|
|
||||||
===================================================================
|
|
||||||
--- strace-4.5.16.orig/syscall.c 2006-12-21 23:13:33.000000000 +0100
|
|
||||||
+++ strace-4.5.16/syscall.c 2008-05-11 15:35:45.000000000 +0200
|
|
||||||
@@ -2383,14 +2383,18 @@
|
|
||||||
switch (known_scno(tcp)) {
|
|
||||||
#ifdef LINUX
|
|
||||||
#if !defined (ALPHA) && !defined(SPARC) && !defined(SPARC64) && !defined(MIPS) && !defined(HPPA)
|
|
||||||
+#ifdef __NR_socketcall
|
|
||||||
case SYS_socketcall:
|
|
||||||
decode_subcall(tcp, SYS_socket_subcall,
|
|
||||||
SYS_socket_nsubcalls, deref_style);
|
|
||||||
break;
|
|
||||||
+#endif
|
|
||||||
+#ifdef __NR_ipc
|
|
||||||
case SYS_ipc:
|
|
||||||
decode_subcall(tcp, SYS_ipc_subcall,
|
|
||||||
SYS_ipc_nsubcalls, shift_style);
|
|
||||||
break;
|
|
||||||
+#endif
|
|
||||||
#endif /* !ALPHA && !MIPS && !SPARC && !SPARC64 && !HPPA */
|
|
||||||
#if defined (SPARC) || defined (SPARC64)
|
|
||||||
case SYS_socketcall:
|
|
@ -1,20 +0,0 @@
|
|||||||
Index: strace-4.5.16/syscall.c
|
|
||||||
===================================================================
|
|
||||||
--- strace-4.5.16.orig/syscall.c 2008-05-11 15:35:45.000000000 +0200
|
|
||||||
+++ strace-4.5.16/syscall.c 2008-05-11 15:36:09.000000000 +0200
|
|
||||||
@@ -1045,6 +1045,15 @@
|
|
||||||
/*
|
|
||||||
* Note: we only deal with only 32-bit CPUs here.
|
|
||||||
*/
|
|
||||||
+
|
|
||||||
+ if (!(tcp->flags & TCB_INSYSCALL) &&
|
|
||||||
+ (tcp->flags & TCB_WAITEXECVE)) {
|
|
||||||
+ /* caught a fake syscall from the execve's exit */
|
|
||||||
+ tcp->flags &= ~TCB_WAITEXECVE;
|
|
||||||
+ return 0;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+
|
|
||||||
if (regs.ARM_cpsr & 0x20) {
|
|
||||||
/*
|
|
||||||
* Get the Thumb-mode system call number
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,13 +0,0 @@
|
|||||||
--- a/system.c
|
|
||||||
+++ b/system.c
|
|
||||||
@@ -70,10 +70,6 @@
|
|
||||||
#include <linux/capability.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
-#ifdef SYS_cacheflush
|
|
||||||
-#include <asm/cachectl.h>
|
|
||||||
-#endif
|
|
||||||
-
|
|
||||||
#ifdef HAVE_LINUX_USTNAME_H
|
|
||||||
#include <linux/utsname.h>
|
|
||||||
#endif
|
|
@ -1,345 +0,0 @@
|
|||||||
diff -Naur strace-4.5.16.ori/config.h.in strace-4.5.16/config.h.in
|
|
||||||
--- strace-4.5.16.ori/config.h.in 2008-08-04 20:11:11.000000000 +0200
|
|
||||||
+++ strace-4.5.16/config.h.in 2008-08-04 20:48:28.000000000 +0200
|
|
||||||
@@ -403,6 +403,12 @@
|
|
||||||
/* Define for the AMD x86-64 architecture. */
|
|
||||||
#undef X86_64
|
|
||||||
|
|
||||||
+/* Define for the CRISv10 architecture. */
|
|
||||||
+#undef CRISV10
|
|
||||||
+
|
|
||||||
+/* Define for the CRISv32 architecture. */
|
|
||||||
+#undef CRISV32
|
|
||||||
+
|
|
||||||
/* Enable GNU extensions on systems that have them. */
|
|
||||||
#ifndef _GNU_SOURCE
|
|
||||||
# undef _GNU_SOURCE
|
|
||||||
diff -Naur strace-4.5.16.ori/configure strace-4.5.16/configure
|
|
||||||
--- strace-4.5.16.ori/configure 2008-08-04 20:11:11.000000000 +0200
|
|
||||||
+++ strace-4.5.16/configure 2008-08-04 21:15:39.000000000 +0200
|
|
||||||
@@ -2539,6 +2539,22 @@
|
|
||||||
_ACEOF
|
|
||||||
|
|
||||||
;;
|
|
||||||
+cris|crisv10)
|
|
||||||
+ arch=crisv10
|
|
||||||
+
|
|
||||||
+cat >>confdefs.h <<\_ACEOF
|
|
||||||
+#define CRISV10 1
|
|
||||||
+_ACEOF
|
|
||||||
+
|
|
||||||
+ ;;
|
|
||||||
+crisv32)
|
|
||||||
+ arch=crisv32
|
|
||||||
+
|
|
||||||
+cat >>confdefs.h <<\_ACEOF
|
|
||||||
+#define CRISV32 1
|
|
||||||
+_ACEOF
|
|
||||||
+
|
|
||||||
+ ;;
|
|
||||||
*)
|
|
||||||
{ echo "$as_me:$LINENO: result: NO!" >&5
|
|
||||||
echo "${ECHO_T}NO!" >&6; }
|
|
||||||
diff -Naur strace-4.5.16.ori/configure.ac strace-4.5.16/configure.ac
|
|
||||||
--- strace-4.5.16.ori/configure.ac 2008-08-04 20:11:11.000000000 +0200
|
|
||||||
+++ strace-4.5.16/configure.ac 2008-08-04 20:50:58.000000000 +0200
|
|
||||||
@@ -111,6 +111,14 @@
|
|
||||||
AC_MSG_RESULT([NO!])
|
|
||||||
AC_MSG_ERROR([architecture $host_cpu is not supported by strace])
|
|
||||||
;;
|
|
||||||
+cris|crisv10)
|
|
||||||
+ arch=crisv10
|
|
||||||
+ AC_DEFINE([CRISV10], 1, [Define for the CRISv10 architecture.])
|
|
||||||
+ ;;
|
|
||||||
+crisv32)
|
|
||||||
+ arch=crisv32
|
|
||||||
+ AC_DEFINE([CRISV32], 1, [Define for the CRISv32 architecture.])
|
|
||||||
+ ;;
|
|
||||||
esac
|
|
||||||
AC_MSG_RESULT($arch)
|
|
||||||
|
|
||||||
diff -Naur strace-4.5.16.ori/process.c strace-4.5.16/process.c
|
|
||||||
--- strace-4.5.16.ori/process.c 2008-08-04 20:11:11.000000000 +0200
|
|
||||||
+++ strace-4.5.16/process.c 2008-08-04 21:18:30.000000000 +0200
|
|
||||||
@@ -548,7 +548,7 @@
|
|
||||||
# define ARG_PTID (known_scno(tcp) == SYS_clone2 ? 3 : 2)
|
|
||||||
# define ARG_CTID (known_scno(tcp) == SYS_clone2 ? 4 : 3)
|
|
||||||
# define ARG_TLS (known_scno(tcp) == SYS_clone2 ? 5 : 4)
|
|
||||||
-# elif defined S390 || defined S390X
|
|
||||||
+# elif defined S390 || defined S390X || defined CRISV10 || defined CRISV32
|
|
||||||
# define ARG_STACK 0
|
|
||||||
# define ARG_FLAGS 1
|
|
||||||
# define ARG_PTID 2
|
|
||||||
@@ -704,6 +704,10 @@
|
|
||||||
0x100000 | new) < 0)
|
|
||||||
return -1;
|
|
||||||
return 0;
|
|
||||||
+#elif defined(CRISV10) || defined(CRISV32)
|
|
||||||
+ if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(4*PT_R9), new) < 0)
|
|
||||||
+ return -1;
|
|
||||||
+ return 0;
|
|
||||||
#elif defined(ARM)
|
|
||||||
/* Some kernels support this, some (pre-2.6.16 or so) don't. */
|
|
||||||
# ifndef PTRACE_SET_SYSCALL
|
|
||||||
@@ -2934,6 +2938,77 @@
|
|
||||||
{ uoff(regs.r0), "r0" },
|
|
||||||
{ uoff(regs.r12_orig), "orig_r12" },
|
|
||||||
#endif
|
|
||||||
+#ifdef CRISV10
|
|
||||||
+ { 4*PT_FRAMETYPE, "4*PT_FRAMETYPE" },
|
|
||||||
+ { 4*PT_ORIG_R10, "4*PT_ORIG_R10" },
|
|
||||||
+ { 4*PT_R13, "4*PT_R13" },
|
|
||||||
+ { 4*PT_R12, "4*PT_R12" },
|
|
||||||
+ { 4*PT_R11, "4*PT_R11" },
|
|
||||||
+ { 4*PT_R10, "4*PT_R10" },
|
|
||||||
+ { 4*PT_R9, "4*PT_R9" },
|
|
||||||
+ { 4*PT_R8, "4*PT_R8" },
|
|
||||||
+ { 4*PT_R7, "4*PT_R7" },
|
|
||||||
+ { 4*PT_R6, "4*PT_R6" },
|
|
||||||
+ { 4*PT_R5, "4*PT_R5" },
|
|
||||||
+ { 4*PT_R4, "4*PT_R4" },
|
|
||||||
+ { 4*PT_R3, "4*PT_R3" },
|
|
||||||
+ { 4*PT_R2, "4*PT_R2" },
|
|
||||||
+ { 4*PT_R1, "4*PT_R1" },
|
|
||||||
+ { 4*PT_R0, "4*PT_R0" },
|
|
||||||
+ { 4*PT_MOF, "4*PT_MOF" },
|
|
||||||
+ { 4*PT_DCCR, "4*PT_DCCR" },
|
|
||||||
+ { 4*PT_SRP, "4*PT_SRP" },
|
|
||||||
+ { 4*PT_IRP, "4*PT_IRP" },
|
|
||||||
+ { 4*PT_CSRINSTR, "4*PT_CSRINSTR" },
|
|
||||||
+ { 4*PT_CSRADDR, "4*PT_CSRADDR" },
|
|
||||||
+ { 4*PT_CSRDATA, "4*PT_CSRDATA" },
|
|
||||||
+ { 4*PT_USP, "4*PT_USP" },
|
|
||||||
+#endif
|
|
||||||
+#ifdef CRISV32
|
|
||||||
+ { 4*PT_ORIG_R10, "4*PT_ORIG_R10" },
|
|
||||||
+ { 4*PT_R0, "4*PT_R0" },
|
|
||||||
+ { 4*PT_R1, "4*PT_R1" },
|
|
||||||
+ { 4*PT_R2, "4*PT_R2" },
|
|
||||||
+ { 4*PT_R3, "4*PT_R3" },
|
|
||||||
+ { 4*PT_R4, "4*PT_R4" },
|
|
||||||
+ { 4*PT_R5, "4*PT_R5" },
|
|
||||||
+ { 4*PT_R6, "4*PT_R6" },
|
|
||||||
+ { 4*PT_R7, "4*PT_R7" },
|
|
||||||
+ { 4*PT_R8, "4*PT_R8" },
|
|
||||||
+ { 4*PT_R9, "4*PT_R9" },
|
|
||||||
+ { 4*PT_R10, "4*PT_R10" },
|
|
||||||
+ { 4*PT_R11, "4*PT_R11" },
|
|
||||||
+ { 4*PT_R12, "4*PT_R12" },
|
|
||||||
+ { 4*PT_R13, "4*PT_R13" },
|
|
||||||
+ { 4*PT_ACR, "4*PT_ACR" },
|
|
||||||
+ { 4*PT_SRS, "4*PT_SRS" },
|
|
||||||
+ { 4*PT_MOF, "4*PT_MOF" },
|
|
||||||
+ { 4*PT_SPC, "4*PT_SPC" },
|
|
||||||
+ { 4*PT_CCS, "4*PT_CCS" },
|
|
||||||
+ { 4*PT_SRP, "4*PT_SRP" },
|
|
||||||
+ { 4*PT_ERP, "4*PT_ERP" },
|
|
||||||
+ { 4*PT_EXS, "4*PT_EXS" },
|
|
||||||
+ { 4*PT_EDA, "4*PT_EDA" },
|
|
||||||
+ { 4*PT_USP, "4*PT_USP" },
|
|
||||||
+ { 4*PT_PPC, "4*PT_PPC" },
|
|
||||||
+ { 4*PT_BP_CTRL, "4*PT_BP_CTRL" },
|
|
||||||
+ { 4*PT_BP+4, "4*PT_BP+4" },
|
|
||||||
+ { 4*PT_BP+8, "4*PT_BP+8" },
|
|
||||||
+ { 4*PT_BP+12, "4*PT_BP+12" },
|
|
||||||
+ { 4*PT_BP+16, "4*PT_BP+16" },
|
|
||||||
+ { 4*PT_BP+20, "4*PT_BP+20" },
|
|
||||||
+ { 4*PT_BP+24, "4*PT_BP+24" },
|
|
||||||
+ { 4*PT_BP+28, "4*PT_BP+28" },
|
|
||||||
+ { 4*PT_BP+32, "4*PT_BP+32" },
|
|
||||||
+ { 4*PT_BP+36, "4*PT_BP+36" },
|
|
||||||
+ { 4*PT_BP+40, "4*PT_BP+40" },
|
|
||||||
+ { 4*PT_BP+44, "4*PT_BP+44" },
|
|
||||||
+ { 4*PT_BP+48, "4*PT_BP+48" },
|
|
||||||
+ { 4*PT_BP+52, "4*PT_BP+52" },
|
|
||||||
+ { 4*PT_BP+56, "4*PT_BP+56" },
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
+#if !defined(CRISV10) && !defined(CRISV32)
|
|
||||||
#if !defined(S390) && !defined(S390X) && !defined(MIPS) && !defined(SPARC64) && !defined(AVR32)
|
|
||||||
{ uoff(u_fpvalid), "offsetof(struct user, u_fpvalid)" },
|
|
||||||
#endif
|
|
||||||
@@ -2971,6 +3046,7 @@
|
|
||||||
#if defined(I386) || defined(X86_64)
|
|
||||||
{ uoff(u_debugreg), "offsetof(struct user, u_debugreg)" },
|
|
||||||
#endif /* I386 */
|
|
||||||
+#endif /* !CRISV10/!CRISV32 */
|
|
||||||
#endif /* !IA64 */
|
|
||||||
#endif /* !ALPHA */
|
|
||||||
#endif /* !POWERPC/!SPARC */
|
|
||||||
diff -Naur strace-4.5.16.ori/signal.c strace-4.5.16/signal.c
|
|
||||||
--- strace-4.5.16.ori/signal.c 2007-08-02 03:15:59.000000000 +0200
|
|
||||||
+++ strace-4.5.16/signal.c 2008-08-04 20:57:04.000000000 +0200
|
|
||||||
@@ -1449,9 +1449,38 @@
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
#else
|
|
||||||
+#if defined(CRISV10) || defined(CRISV32)
|
|
||||||
+ struct sigcontext sc;
|
|
||||||
+
|
|
||||||
+ if (entering(tcp)) {
|
|
||||||
+ long regs[PT_MAX+1];
|
|
||||||
+
|
|
||||||
+ tcp->u_arg[0] = 0;
|
|
||||||
+
|
|
||||||
+ if (ptrace(PTRACE_GETREGS, tcp->pid, NULL, (long)regs) < 0) {
|
|
||||||
+ perror("sigreturn: PTRACE_GETREGS");
|
|
||||||
+ return 0;
|
|
||||||
+ }
|
|
||||||
+ if (umove(tcp, regs[PT_USP], &sc) < 0)
|
|
||||||
+ return 0;
|
|
||||||
+ tcp->u_arg[0] = 1;
|
|
||||||
+ tcp->u_arg[1] = sc.oldmask;
|
|
||||||
+ } else {
|
|
||||||
+ sigset_t sigm;
|
|
||||||
+
|
|
||||||
+ long_to_sigset(tcp->u_arg[1], &sigm);
|
|
||||||
+ tcp->u_rval = tcp->u_error = 0;
|
|
||||||
+ if (tcp->u_arg[0] == 0)
|
|
||||||
+ return 0;
|
|
||||||
+ tcp->auxstr = sprintsigmask("mask now ", &sigm, 0);
|
|
||||||
+ return RVAL_NONE | RVAL_STR;
|
|
||||||
+ }
|
|
||||||
+ return 0;
|
|
||||||
+#else
|
|
||||||
#warning No sys_sigreturn() for this architecture
|
|
||||||
#warning (no problem, just a reminder :-)
|
|
||||||
return 0;
|
|
||||||
+#endif /* !CRISV10/!CRISV32 */
|
|
||||||
#endif /* MIPS */
|
|
||||||
#endif /* SPARC || SPARC64 */
|
|
||||||
#endif /* ALPHA */
|
|
||||||
diff -Naur strace-4.5.16.ori/syscall.c strace-4.5.16/syscall.c
|
|
||||||
--- strace-4.5.16.ori/syscall.c 2008-08-04 20:11:11.000000000 +0200
|
|
||||||
+++ strace-4.5.16/syscall.c 2008-08-04 21:02:28.000000000 +0200
|
|
||||||
@@ -809,6 +809,8 @@
|
|
||||||
static long r9;
|
|
||||||
#elif defined(X86_64)
|
|
||||||
static long rax;
|
|
||||||
+#elif defined(CRISV10) || defined(CRISV32)
|
|
||||||
+ static long r10;
|
|
||||||
#elif defined(AVR32)
|
|
||||||
static struct pt_regs regs;
|
|
||||||
#endif
|
|
||||||
@@ -1294,7 +1296,10 @@
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-#endif /* AVR32 */
|
|
||||||
+#elif defined(CRISV10) || defined(CRISV32)
|
|
||||||
+ if (upeek(pid, 4*PT_R9, &scno) < 0)
|
|
||||||
+ return -1;
|
|
||||||
+#endif /* CRISV10/CRISV32 */
|
|
||||||
#endif /* LINUX */
|
|
||||||
#ifdef SUNOS4
|
|
||||||
if (upeek(pid, uoff(u_arg[7]), &scno) < 0)
|
|
||||||
@@ -1489,6 +1494,14 @@
|
|
||||||
fprintf(stderr, "stray syscall exit: r8 = %ld\n", r8);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
+#elif defined(CRISV10) || defined(CRISV32)
|
|
||||||
+ if (upeek(pid, 4*PT_R10, &r10) < 0)
|
|
||||||
+ return -1;
|
|
||||||
+ if (r10 != -ENOSYS && !(tcp->flags & TCB_INSYSCALL)) {
|
|
||||||
+ if (debug)
|
|
||||||
+ fprintf(stderr, "stray syscall exit: r10 = %ld\n", r10);
|
|
||||||
+ return 0;
|
|
||||||
+ }
|
|
||||||
#endif
|
|
||||||
#endif /* LINUX */
|
|
||||||
return 1;
|
|
||||||
@@ -1663,6 +1676,17 @@
|
|
||||||
tcp->u_rval = regs.r12;
|
|
||||||
u_error = 0;
|
|
||||||
}
|
|
||||||
+#else
|
|
||||||
+#if defined(CRISV10) || defined(CRISV32)
|
|
||||||
+ if (r10 && (unsigned) -r10 < nerrnos) {
|
|
||||||
+ tcp->u_rval = -1;
|
|
||||||
+ u_error = -r10;
|
|
||||||
+ }
|
|
||||||
+ else {
|
|
||||||
+ tcp->u_rval = r10;
|
|
||||||
+ u_error = 0;
|
|
||||||
+ }
|
|
||||||
+#endif /* CRISV10/CRISV32 */
|
|
||||||
#endif /* AVR32 */
|
|
||||||
#endif /* SH64 */
|
|
||||||
#endif /* SH */
|
|
||||||
@@ -2175,6 +2199,23 @@
|
|
||||||
tcp->u_arg[3] = regs.r9;
|
|
||||||
tcp->u_arg[4] = regs.r5;
|
|
||||||
tcp->u_arg[5] = regs.r3;
|
|
||||||
+#elif defined(CRISV10) || defined(CRISV32)
|
|
||||||
+ {
|
|
||||||
+ int i;
|
|
||||||
+ static const int crisregs[] = {
|
|
||||||
+ 4*PT_ORIG_R10, 4*PT_R11, 4*PT_R12,
|
|
||||||
+ 4*PT_R13, 4*PT_MOF, 4*PT_SRP
|
|
||||||
+ };
|
|
||||||
+
|
|
||||||
+ if (tcp->scno >= 0 && tcp->scno < nsyscalls)
|
|
||||||
+ tcp->u_nargs = sysent[tcp->scno].nargs;
|
|
||||||
+ else
|
|
||||||
+ tcp->u_nargs = 0;
|
|
||||||
+ for (i = 0; i < tcp->u_nargs; i++) {
|
|
||||||
+ if (upeek(pid, crisregs[i], &tcp->u_arg[i]) < 0)
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
#else /* Other architecture (like i386) (32bits specific) */
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
diff -Naur strace-4.5.16.ori/util.c strace-4.5.16/util.c
|
|
||||||
--- strace-4.5.16.ori/util.c 2008-08-04 20:11:11.000000000 +0200
|
|
||||||
+++ strace-4.5.16/util.c 2008-08-04 21:05:37.000000000 +0200
|
|
||||||
@@ -1079,6 +1079,12 @@
|
|
||||||
#elif defined(AVR32)
|
|
||||||
if (upeek(tcp->pid, REG_PC, &pc) < 0)
|
|
||||||
return -1;
|
|
||||||
+#elif defined(CRISV10)
|
|
||||||
+ if (upeek(tcp->pid, 4*PT_IRP, &pc) < 0)
|
|
||||||
+ return -1;
|
|
||||||
+#elif defined(CRISV32)
|
|
||||||
+ if (upeek(tcp->pid, 4*PT_ERP, &pc) < 0)
|
|
||||||
+ return -1;
|
|
||||||
#endif
|
|
||||||
return pc;
|
|
||||||
#endif /* LINUX */
|
|
||||||
@@ -1235,6 +1241,22 @@
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
tprintf("[%08lx] ", pc);
|
|
||||||
+#elif defined(CRISV10)
|
|
||||||
+ long pc;
|
|
||||||
+
|
|
||||||
+ if (upeek(tcp->pid, 4*PT_IRP, &pc) < 0) {
|
|
||||||
+ PRINTBADPC;
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+ tprintf("[%08lx] ", (unsigned long)pc);
|
|
||||||
+#elif defined(CRISV32)
|
|
||||||
+ long pc;
|
|
||||||
+
|
|
||||||
+ if (upeek(tcp->pid, 4*PT_ERP, &pc) < 0) {
|
|
||||||
+ PRINTBADPC;
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+ tprintf("[%08lx] ", (unsigned long)pc);
|
|
||||||
#endif /* !architecture */
|
|
||||||
#endif /* LINUX */
|
|
||||||
|
|
||||||
@@ -1419,6 +1441,13 @@
|
|
||||||
# elif defined (AVR32)
|
|
||||||
# define arg0_offset (REG_R12)
|
|
||||||
# define arg1_offset (REG_R11)
|
|
||||||
+# elif defined CRISV10 || defined CRISV32
|
|
||||||
+# define arg0_offset (4*PT_R11)
|
|
||||||
+# define arg1_offset (4*PT_ORIG_R10)
|
|
||||||
+# define restore_arg0(tcp, state, val) 0
|
|
||||||
+# define restore_arg1(tcp, state, val) 0
|
|
||||||
+# define arg0_index 1
|
|
||||||
+# define arg1_index 0
|
|
||||||
# else
|
|
||||||
# define arg0_offset 0
|
|
||||||
# define arg1_offset 4
|
|
@ -1,50 +0,0 @@
|
|||||||
Upstream-Status: Backport
|
|
||||||
|
|
||||||
https://bugs.gentoo.org/414637
|
|
||||||
|
|
||||||
From 302e8ec6cd62912a3cd6494ce6702f4ad8dae0e2 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Mike Frysinger <vapier@gentoo.org>
|
|
||||||
Date: Fri, 4 May 2012 19:30:59 -0400
|
|
||||||
Subject: [PATCH] util: fix building when glibc has a stub process_vm_readv
|
|
||||||
|
|
||||||
If you have a newer glibc which provides process_vm_readv, but it is built
|
|
||||||
against older kernel headers which lack __NR_process_vm_readv, the library
|
|
||||||
will contain a stub implementation that just returns ENOSYS. Autoconf
|
|
||||||
checks for this case explicitly and will declare it as unavailable. So we
|
|
||||||
end up in a case where the headers provide the prototype, but autoconf has
|
|
||||||
not defined HAVE_PROCESS_VM_READV, so we hit the same build failure again:
|
|
||||||
|
|
||||||
util.c:738:16: error: static declaration of 'process_vm_readv' follows non-static declaration
|
|
||||||
/usr/include/bits/uio.h:58:16: note: previous declaration of 'process_vm_readv' was here
|
|
||||||
|
|
||||||
So rename our local function to something unique, and add a define so the
|
|
||||||
callers all hit the right place.
|
|
||||||
|
|
||||||
* util.c (strace_process_vm_readv): Rename from process_vm_readv.
|
|
||||||
(process_vm_readv): Define to strace_process_vm_readv.
|
|
||||||
|
|
||||||
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
||||||
---
|
|
||||||
util.c | 4 +++-
|
|
||||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
--- a/util.c
|
|
||||||
+++ b/util.c
|
|
||||||
@@ -735,7 +735,8 @@ static bool process_vm_readv_not_support
|
|
||||||
|
|
||||||
#if defined(__NR_process_vm_readv)
|
|
||||||
static bool process_vm_readv_not_supported = 0;
|
|
||||||
-static ssize_t process_vm_readv(pid_t pid,
|
|
||||||
+/* Have to avoid duplicating with the C library headers. */
|
|
||||||
+static ssize_t strace_process_vm_readv(pid_t pid,
|
|
||||||
const struct iovec *lvec,
|
|
||||||
unsigned long liovcnt,
|
|
||||||
const struct iovec *rvec,
|
|
||||||
@@ -744,6 +745,7 @@ static ssize_t process_vm_readv(pid_t pi
|
|
||||||
{
|
|
||||||
return syscall(__NR_process_vm_readv, (long)pid, lvec, liovcnt, rvec, riovcnt, flags);
|
|
||||||
}
|
|
||||||
+#define process_vm_readv strace_process_vm_readv
|
|
||||||
#else
|
|
||||||
static bool process_vm_readv_not_supported = 1;
|
|
||||||
# define process_vm_readv(...) (errno = ENOSYS, -1)
|
|
Loading…
x
Reference in New Issue
Block a user