Subject: bin/4293: kdump doesn't know about FreeBSD emulation
To: None <gnats-bugs@gnats.netbsd.org>
From: Dave Huang <khym@bga.com>
List: netbsd-bugs
Date: 10/19/1997 00:08:23
>Number:         4293
>Category:       bin
>Synopsis:       kdump doesn't know about FreeBSD emulation
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Oct 18 22:20:04 1997
>Last-Modified:
>Originator:     Dave Huang
>Organization:
	
>Release:        NetBSD-current as of October 18, 1997
>Environment:
	
System: NetBSD dahan.metonymy.com 1.2G NetBSD 1.2G (SPIFF) #142: Sat Oct 18 17:18:07 CDT 1997 khym@dahan.metonymy.com:/usr/src.local/sys/arch/i386/compile/SPIFF i386


>Description:
	kdump doesn't know about FreeBSD emulations and its syscalls.
>How-To-Repeat:
	ktrace a FreeBSD executable, then run kdump on the output.
kdump will complain "kdump: Emulation `freebsd' unknown"
>Fix:
--- /usr/src/usr.bin/kdump/kdump.c	Wed Jul 23 06:23:44 1997
+++ kdump.c	Sun Oct 19 00:06:04 1997
@@ -75,6 +75,7 @@
 
 #include <sys/syscall.h>
 
+#include "../../sys/compat/freebsd/freebsd_syscall.h"
 #include "../../sys/compat/hpux/hpux_syscall.h"
 #include "../../sys/compat/ibcs2/ibcs2_syscall.h"
 #include "../../sys/compat/linux/linux_syscall.h"
@@ -86,6 +87,7 @@
 #define KTRACE
 #include "../../sys/kern/syscalls.c"
 
+#include "../../sys/compat/freebsd/freebsd_syscalls.c"
 #include "../../sys/compat/hpux/hpux_syscalls.c"
 #include "../../sys/compat/ibcs2/ibcs2_syscalls.c"
 #include "../../sys/compat/linux/linux_syscalls.c"
@@ -102,15 +104,16 @@
 };
 
 static struct emulation emulations[] = {
-	{ "netbsd",	     syscallnames,        SYS_MAXSYSCALL },
-	{ "hpux",	hpux_syscallnames,   HPUX_SYS_MAXSYSCALL },
-	{ "ibcs2",     ibcs2_syscallnames,  IBCS2_SYS_MAXSYSCALL },
-	{ "linux",     linux_syscallnames,  LINUX_SYS_MAXSYSCALL },
-	{ "osf1",       osf1_syscallnames,   OSF1_SYS_MAXSYSCALL },
-	{ "sunos",     sunos_syscallnames,  SUNOS_SYS_MAXSYSCALL },
-	{ "svr4",       svr4_syscallnames,   SVR4_SYS_MAXSYSCALL },
-	{ "ultrix",   ultrix_syscallnames, ULTRIX_SYS_MAXSYSCALL },
-	{ NULL,			     NULL,		    0    }
+	{ "netbsd",	     syscallnames,         SYS_MAXSYSCALL },
+	{ "freebsd", freebsd_syscallnames, FREEBSD_SYS_MAXSYSCALL },
+	{ "hpux",	hpux_syscallnames,    HPUX_SYS_MAXSYSCALL },
+	{ "ibcs2",     ibcs2_syscallnames,   IBCS2_SYS_MAXSYSCALL },
+	{ "linux",     linux_syscallnames,   LINUX_SYS_MAXSYSCALL },
+	{ "osf1",       osf1_syscallnames,    OSF1_SYS_MAXSYSCALL },
+	{ "sunos",     sunos_syscallnames,   SUNOS_SYS_MAXSYSCALL },
+	{ "svr4",       svr4_syscallnames,    SVR4_SYS_MAXSYSCALL },
+	{ "ultrix",   ultrix_syscallnames,  ULTRIX_SYS_MAXSYSCALL },
+	{ NULL,			     NULL,		     0    }
 };
 
 struct emulation *current;

>Audit-Trail:
>Unformatted: