Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/alpha Glue in KGDB. Needs some more work -- KGDB c...



details:   https://anonhg.NetBSD.org/src/rev/701c6a288914
branches:  trunk
changeset: 508778:701c6a288914
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Thu Apr 19 17:48:46 2001 +0000

description:
Glue in KGDB.  Needs some more work -- KGDB currently renders
DDB disabled, but it's a start.

diffstat:

 sys/arch/alpha/alpha/debug.s        |  18 +++++++++++++-----
 sys/arch/alpha/alpha/locore.s       |   8 ++++----
 sys/arch/alpha/alpha/machdep.c      |  18 +++++++++++-------
 sys/arch/alpha/conf/files.alpha     |   5 ++++-
 sys/arch/alpha/include/db_machdep.h |   5 ++++-
 5 files changed, 36 insertions(+), 18 deletions(-)

diffs (154 lines):

diff -r c6c0405cc503 -r 701c6a288914 sys/arch/alpha/alpha/debug.s
--- a/sys/arch/alpha/alpha/debug.s      Thu Apr 19 17:48:18 2001 +0000
+++ b/sys/arch/alpha/alpha/debug.s      Thu Apr 19 17:48:46 2001 +0000
@@ -1,7 +1,7 @@
-/* $NetBSD: debug.s,v 1.6 2000/08/21 02:03:12 thorpej Exp $ */
+/* $NetBSD: debug.s,v 1.7 2001/04/19 17:48:46 thorpej Exp $ */
 
 /*-
- * Copyright (c) 1999 The NetBSD Foundation, Inc.
+ * Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -37,7 +37,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-__KERNEL_RCSID(6, "$NetBSD: debug.s,v 1.6 2000/08/21 02:03:12 thorpej Exp $")
+__KERNEL_RCSID(6, "$NetBSD: debug.s,v 1.7 2001/04/19 17:48:46 thorpej Exp $")
 
 /*
  * Debugger glue.
@@ -98,9 +98,17 @@
 2:     lda     sp, debug_stack_top     /* sp <- debug_stack_top */
 
 3:     /* Dispatch to the debugger - arguments are already in place. */
+#if defined(KGDB)
+       mov     a3, a0                  /* a0 == entry (trap type) */
+       mov     a4, a1                  /* a1 == frame pointer */
+       CALL(kgdb_trap)
+       br      9f
+#endif
+#if defined(DDB)
        CALL(ddb_trap)
-
-       /* Debugger return value in v0; switch back to our previous stack. */
+       br      9f
+#endif
+9:     /* Debugger return value in v0; switch back to our previous stack. */
        mov     s0, sp
 
 #if defined(MULTIPROCESSOR)
diff -r c6c0405cc503 -r 701c6a288914 sys/arch/alpha/alpha/locore.s
--- a/sys/arch/alpha/alpha/locore.s     Thu Apr 19 17:48:18 2001 +0000
+++ b/sys/arch/alpha/alpha/locore.s     Thu Apr 19 17:48:46 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.s,v 1.91 2001/04/18 00:38:10 thorpej Exp $ */
+/* $NetBSD: locore.s,v 1.92 2001/04/19 17:48:46 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -72,7 +72,7 @@
 
 #include <machine/asm.h>
 
-__KERNEL_RCSID(0, "$NetBSD: locore.s,v 1.91 2001/04/18 00:38:10 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: locore.s,v 1.92 2001/04/19 17:48:46 thorpej Exp $");
 
 #include "assym.h"
 
@@ -253,12 +253,12 @@
 
 /**************************************************************************/
 
-#if defined(DDB)
+#if defined(DDB) || defined(KGDB)
 /*
  * Pull in debugger glue.
  */
 #include <alpha/alpha/debug.s>
-#endif /* DDB */
+#endif /* DDB || KGDB */
 
 /**************************************************************************/
 
diff -r c6c0405cc503 -r 701c6a288914 sys/arch/alpha/alpha/machdep.c
--- a/sys/arch/alpha/alpha/machdep.c    Thu Apr 19 17:48:18 2001 +0000
+++ b/sys/arch/alpha/alpha/machdep.c    Thu Apr 19 17:48:46 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.233 2001/04/19 00:21:08 thorpej Exp $ */
+/* $NetBSD: machdep.c,v 1.234 2001/04/19 17:48:46 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.233 2001/04/19 00:21:08 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.234 2001/04/19 17:48:46 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -773,13 +773,17 @@
 #ifdef DDB
        ddb_init((int)((u_int64_t)ksym_end - (u_int64_t)ksym_start),
            ksym_start, ksym_end);
-       if (boothowto & RB_KDB)
+#endif
+
+       if (boothowto & RB_KDB) {
+#if defined(KGDB)
+               kgdb_debug_init = 1;
+               kgdb_connect(1);
+#elif defined(DDB)
                Debugger();
 #endif
-#ifdef KGDB
-       if (boothowto & RB_KDB)
-               kgdb_connect(0);
-#endif
+       }
+
        /*
         * Figure out our clock frequency, from RPB fields.
         */
diff -r c6c0405cc503 -r 701c6a288914 sys/arch/alpha/conf/files.alpha
--- a/sys/arch/alpha/conf/files.alpha   Thu Apr 19 17:48:18 2001 +0000
+++ b/sys/arch/alpha/conf/files.alpha   Thu Apr 19 17:48:46 2001 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.alpha,v 1.134 2001/03/04 13:36:19 ad Exp $
+# $NetBSD: files.alpha,v 1.135 2001/04/19 17:48:46 thorpej Exp $
 #
 # alpha-specific configuration info
 
@@ -533,6 +533,9 @@
 file   arch/alpha/alpha/db_interface.c         ddb
 file   arch/alpha/alpha/db_trace.c             ddb
 
+defopt opt_kgdb_machdep.h KGDB_DEVNAME KGDB_DEVADDR KGDB_DEVRATE KGDB_DEVMODE
+file   arch/alpha/alpha/kgdb_machdep.c         kgdb
+
 # Binary compatibility with previous NetBSD releases (COMPAT_XX)
 file   arch/alpha/alpha/compat_13_machdep.c    compat_13
 
diff -r c6c0405cc503 -r 701c6a288914 sys/arch/alpha/include/db_machdep.h
--- a/sys/arch/alpha/include/db_machdep.h       Thu Apr 19 17:48:18 2001 +0000
+++ b/sys/arch/alpha/include/db_machdep.h       Thu Apr 19 17:48:46 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: db_machdep.h,v 1.12 2000/11/22 02:25:52 thorpej Exp $ */
+/* $NetBSD: db_machdep.h,v 1.13 2001/04/19 17:48:47 thorpej Exp $ */
 
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
@@ -93,6 +93,9 @@
 int    alpha_debug(unsigned long, unsigned long, unsigned long,
            unsigned long, struct trapframe *);
 
+struct alpha_bus_space;
+void   alpha_kgdb_init(const char **, struct alpha_bus_space *);
+
 /*
  * We define some of our own commands.
  */



Home | Main Index | Thread Index | Old Index