Glue in KGDB. Needs some more work -- KGDB currently renders

DDB disabled, but it's a start.
This commit is contained in:
thorpej 2001-04-19 17:48:46 +00:00
parent 2acdce8cfd
commit f2f0a680e3
5 changed files with 36 additions and 18 deletions

View File

@ -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 @@ NESTED_NOPROFILE(alpha_debug, 5, 32, ra, IM_RA|IM_S0, 0)
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)

View File

@ -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 @@ NESTED_NOPROFILE(locorestart,1,0,ra,0,0)
/**************************************************************************/
#if defined(DDB)
#if defined(DDB) || defined(KGDB)
/*
* Pull in debugger glue.
*/
#include <alpha/alpha/debug.s>
#endif /* DDB */
#endif /* DDB || KGDB */
/**************************************************************************/

View File

@ -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 @@ nobootinfo:
#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.
*/

View File

@ -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_disasm.c ddb
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

View File

@ -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 ddb_trap(unsigned long, unsigned long, unsigned long,
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.
*/