pkgsrc/sysutils/strace/patches/patch-ao
spz dda134763b compile fixes for a leaf package for non-x86 NetBSD
(note that there are no claims of making it actually work)
2009-12-29 22:03:41 +00:00

184 lines
3.7 KiB
Text

$NetBSD: patch-ao,v 1.4 2009/12/29 22:03:41 spz Exp $
--- process.c.orig 2007-01-11 23:08:38.000000000 +0100
+++ process.c 2009-12-29 21:57:56.000000000 +0100
@@ -40,6 +40,7 @@
#include "defs.h"
#include <fcntl.h>
+#include <sys/param.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/wait.h>
@@ -52,7 +53,7 @@
#include <machine/reg.h>
#endif /* SUNOS4 */
-#ifdef FREEBSD
+#ifdef ALLBSD
#include <sys/ptrace.h>
#endif
@@ -305,7 +306,7 @@
#endif /* HAVE_PRCTL */
-#if defined(FREEBSD) || defined(SUNOS4) || defined(SVR4)
+#if defined(ALLBSD) || defined(SUNOS4) || defined(SVR4)
int
sys_gethostid(tcp)
struct tcb *tcp;
@@ -314,7 +315,7 @@
return RVAL_HEX;
return 0;
}
-#endif /* FREEBSD || SUNOS4 || SVR4 */
+#endif /* ALLBSD || SUNOS4 || SVR4 */
int
sys_sethostname(tcp)
@@ -327,7 +328,7 @@
return 0;
}
-#if defined(ALPHA) || defined(FREEBSD) || defined(SUNOS4) || defined(SVR4)
+#if defined(ALPHA) || defined(ALLBSD) || defined(SUNOS4) || defined(SVR4)
int
sys_gethostname(tcp)
struct tcb *tcp;
@@ -341,7 +342,7 @@
}
return 0;
}
-#endif /* ALPHA || FREEBSD || SUNOS4 || SVR4 */
+#endif /* ALPHA || ALLBSD || SUNOS4 || SVR4 */
int
sys_setdomainname(tcp)
@@ -1058,7 +1059,7 @@
#endif /* !USE_PROCFS */
-#if defined(SUNOS4) || defined(LINUX) || defined(FREEBSD)
+#if defined(SUNOS4) || defined(LINUX) || defined(ALLBSD)
int
sys_vfork(tcp)
@@ -1069,7 +1070,7 @@
return 0;
}
-#endif /* SUNOS4 || LINUX || FREEBSD */
+#endif /* SUNOS4 || LINUX || ALLBSD */
#ifndef LINUX
@@ -2051,7 +2052,7 @@
#endif /* SVR4 */
-#ifdef FREEBSD
+#ifdef ALLBSD
int
sys_wait(tcp)
struct tcb *tcp;
@@ -2070,12 +2071,14 @@
}
#endif
+#ifndef NETBSD
int
sys_waitpid(tcp)
struct tcb *tcp;
{
return printwaitn(tcp, 3, 0);
}
+#endif
int
sys_wait4(tcp)
@@ -2205,7 +2208,7 @@
#ifndef SVR4
static const struct xlat ptrace_cmds[] = {
-#ifndef FREEBSD
+#ifndef ALLBSD
{ PTRACE_TRACEME, "PTRACE_TRACEME" },
{ PTRACE_PEEKTEXT, "PTRACE_PEEKTEXT", },
{ PTRACE_PEEKDATA, "PTRACE_PEEKDATA", },
@@ -2271,7 +2274,7 @@
#endif /* !I386 */
{ PTRACE_GETUCODE, "PTRACE_GETUCODE" },
#endif /* SUNOS4 */
-#else /* FREEBSD */
+#else /* ALLBSD */
{ PT_TRACE_ME, "PT_TRACE_ME" },
{ PT_READ_I, "PT_READ_I" },
{ PT_READ_D, "PT_READ_D" },
@@ -2282,20 +2285,26 @@
#endif
{ PT_CONTINUE, "PT_CONTINUE" },
{ PT_KILL, "PT_KILL" },
+#if !(defined(NETBSD) && (defined(ALPHA) || defined(SPARC) || defined(SPARC64)))
{ PT_STEP, "PT_STEP" },
+#endif
{ PT_ATTACH, "PT_ATTACH" },
{ PT_DETACH, "PT_DETACH" },
{ PT_GETREGS, "PT_GETREGS" },
{ PT_SETREGS, "PT_SETREGS" },
{ PT_GETFPREGS, "PT_GETFPREGS" },
{ PT_SETFPREGS, "PT_SETFPREGS" },
+#ifdef PT_GETDBREGS
{ PT_GETDBREGS, "PT_GETDBREGS" },
+#endif
+#ifdef PT_SETDBREGS
{ PT_SETDBREGS, "PT_SETDBREGS" },
-#endif /* FREEBSD */
+#endif
+#endif /* ALLBSD */
{ 0, NULL },
};
-#ifndef FREEBSD
+#ifndef ALLBSD
#ifndef SUNOS4_KERNEL_ARCH_KLUDGE
static
#endif /* !SUNOS4_KERNEL_ARCH_KLUDGE */
@@ -2982,12 +2991,14 @@
sys_ptrace(tcp)
struct tcb *tcp;
{
+#ifndef NETBSD
const struct xlat *x;
+#endif
long addr;
if (entering(tcp)) {
printxval(ptrace_cmds, tcp->u_arg[0],
-#ifndef FREEBSD
+#ifndef ALLBSD
"PTRACE_???"
#else
"PT_???"
@@ -2995,7 +3006,7 @@
);
tprintf(", %lu, ", tcp->u_arg[1]);
addr = tcp->u_arg[2];
-#ifndef FREEBSD
+#ifndef ALLBSD
if (tcp->u_arg[0] == PTRACE_PEEKUSER
|| tcp->u_arg[0] == PTRACE_POKEUSER) {
for (x = struct_user_offsets; x->str; x++) {
@@ -3057,10 +3068,10 @@
}
}
#endif /* SUNOS4 */
-#ifdef FREEBSD
+#ifdef ALLBSD
tprintf("%lu", tcp->u_arg[3]);
}
-#endif /* FREEBSD */
+#endif /* ALLBSD */
return 0;
}