Subject: port-next68k/16794: kgdb enabled kernel doesn't build
To: None <gnats-bugs@gnats.netbsd.org>
From: None <chris@Pin.LU>
List: netbsd-bugs
Date: 05/14/2002 01:58:39
>Number: 16794
>Category: port-next68k
>Synopsis: kgdb enabled kernel doesn't build
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: port-next68k-maintainer
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon May 13 17:39:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Christian Limpach
>Release: current (as of May 14 2002)
>Organization:
>Environment:
System: NetBSD clapper 1.5ZC NetBSD 1.5ZC (CLAPPER) #46: Mon May 13 20:51:50 CEST 2002 root@marble:/devel/netbsd/src-current/sys/arch/next68k/compile/CLAPPER next68k
>Description:
A kernel with kgdb enabled doesn't build. There have been
some interface changes which have not been made in the
next68k port specific files and the compiler is pickier
about missing prototypes.
>How-To-Repeat:
Try to build a kgdb enabled kernel
>Fix:
The following patch fixes the problems.
The file arch/next68k/next68k/stub.c should be removed from the
source tree, since it's no longer needed.
Index: arch/next68k/dev/zs_kgdb.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/next68k/dev/zs_kgdb.c,v
retrieving revision 1.1
diff -u -r1.1 zs_kgdb.c
--- zs_kgdb.c 1999/03/27 02:59:41 1.1
+++ zs_kgdb.c 2002/05/14 00:29:36
@@ -63,6 +63,9 @@
#include <machine/z8530var.h>
#include <next68k/dev/zs_cons.h>
+void zs_kgdb_init __P((void));
+void zskgdb __P((struct zs_chanstate *));
+
/*
* The NeXT provides a 3.686400 MHz clock to the ZS chips.
*/
Index: arch/next68k/next68k/trap.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/next68k/next68k/trap.c,v
retrieving revision 1.36
diff -u -r1.36 trap.c
--- trap.c 2002/02/14 07:08:12 1.36
+++ trap.c 2002/05/14 00:29:37
@@ -89,6 +89,10 @@
extern struct emul emul_sunos;
#endif
+#ifdef KGDB
+#include <sys/kgdb.h>
+#endif
+
int writeback __P((struct frame *fp, int docachepush));
void trap __P((int type, u_int code, u_int v, struct frame frame));
@@ -321,7 +325,7 @@
s = splhigh();
#ifdef KGDB
/* If connected, step or cont returns 1 */
- if (kgdb_trap(type, &frame))
+ if (kgdb_trap(type, (db_regs_t *)&frame))
goto kgdb_cont;
#endif
#ifdef DDB
Index: arch/next68k/next68k/machdep.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/next68k/next68k/machdep.c,v
retrieving revision 1.47
diff -u -r1.47 machdep.c
--- machdep.c 2002/03/20 17:59:25 1.47
+++ machdep.c 2002/05/14 00:29:37
@@ -85,6 +85,11 @@
#include <ddb/db_extern.h>
#endif
+#ifdef KGDB
+#include <sys/kgdb.h>
+void zs_kgdb_init __P((void));
+#endif
+
#include <sys/sysctl.h>
#include <machine/cpu.h>
Index: arch/next68k/next68k/kgdb_machdep.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/next68k/next68k/kgdb_machdep.c,v
retrieving revision 1.1
diff -u -r1.1 kgdb_machdep.c
--- kgdb_machdep.c 1999/12/14 11:17:26 1.1
+++ kgdb_machdep.c 2002/05/14 00:29:37
@@ -6,6 +6,8 @@
* Darrin B. Jewell <dbj@netbsd.org> 1999-12-14T06:05:22-0500
* original cvs id:
* NetBSD: kgdb_machdep.c,v 1.4 1999/11/22 19:05:32 jdolecek Exp
+ * This file was updated with changes from mac68k (rev. 1.4)
+ * and alpha (rev. 1.12) on 2002-05-14
*/
/*
@@ -60,6 +62,8 @@
#include <sys/systm.h>
#include <sys/kgdb.h>
+#define INVOKE_KGDB() __asm __volatile("trap #15")
+
/*
* Determine if the memory at va..(va+len) is valid.
*/
@@ -88,7 +92,7 @@
if (verbose)
printf("kgdb waiting...");
- Debugger();
+ INVOKE_KGDB();
if (verbose)
printf("connected.\n");
@@ -98,16 +102,12 @@
/*
* Decide what to do on panic.
- *
- * The sun3 implementation of Debugger() arranges to call
- * either kgdb_trap() or kdb_trap() as appropriate, so
- * we can just call Debugger() here.
*/
void
kgdb_panic()
{
if (kgdb_dev >= 0 && kgdb_debug_panic) {
printf("entering kgdb\n");
- Debugger();
+ kgdb_connect(kgdb_active == 0);
}
}
Index: arch/next68k/conf/files.next68k
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/next68k/conf/files.next68k,v
retrieving revision 1.24
diff -u -r1.24 files.next68k
--- files.next68k 2002/01/21 21:57:04 1.24
+++ files.next68k 2002/05/14 00:29:37
@@ -53,7 +53,6 @@
file arch/next68k/next68k/rtc.c
file arch/next68k/next68k/disksubr.c
file arch/next68k/next68k/kgdb_machdep.c kgdb
-file arch/next68k/next68k/stub.c kgdb
#file arch/next68k/dev/dbj_debug.c
file arch/next68k/dev/bus_dma.c
>Release-Note:
>Audit-Trail:
>Unformatted: