Add glue for remote KGDB.

This commit is contained in:
thorpej 1997-07-05 20:48:12 +00:00
parent 9ae7db0945
commit bc831d9a96
2 changed files with 34 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.234 1997/06/12 23:57:26 thorpej Exp $ */ /* $NetBSD: machdep.c,v 1.235 1997/07/05 20:48:12 thorpej Exp $ */
/*- /*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc. * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@ -109,6 +109,10 @@
#include <sys/shm.h> #include <sys/shm.h>
#endif #endif
#ifdef KGDB
#include <sys/kgdb.h>
#endif
#include <dev/cons.h> #include <dev/cons.h>
#include <vm/vm.h> #include <vm/vm.h>
@ -1478,8 +1482,10 @@ init386(first_avail)
Debugger(); Debugger();
#endif #endif
#ifdef KGDB #ifdef KGDB
if (boothowto & RB_KDB) if (boothowto & RB_KDB) {
kgdb_debug_init = 1;
kgdb_connect(0); kgdb_connect(0);
}
#endif #endif
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.101 1997/04/09 23:35:07 mycroft Exp $ */ /* $NetBSD: trap.c,v 1.102 1997/07/05 20:48:14 thorpej Exp $ */
/*- /*-
* Copyright (c) 1995 Charles M. Hannum. All rights reserved. * Copyright (c) 1995 Charles M. Hannum. All rights reserved.
@ -68,6 +68,10 @@
#include <machine/db_machdep.h> #include <machine/db_machdep.h>
#endif #endif
#ifdef KGDB
#include <sys/kgdb.h>
#endif
#ifdef COMPAT_IBCS2 #ifdef COMPAT_IBCS2
#include <compat/ibcs2/ibcs2_errno.h> #include <compat/ibcs2/ibcs2_errno.h>
#include <compat/ibcs2/ibcs2_exec.h> #include <compat/ibcs2/ibcs2_exec.h>
@ -207,6 +211,20 @@ trap(frame)
default: default:
we_re_toast: we_re_toast:
#ifdef KGDB
if (kgdb_trap(type, &frame))
return;
else {
/*
* If this is a breakpoint, don't panic
* if we're not connected.
*/
if (type == T_BPTFLT) {
printf("kgdb: ignored %s\n", trap_type[type]);
return;
}
}
#endif
#ifdef DDB #ifdef DDB
if (kdb_trap(type, 0, &frame)) if (kdb_trap(type, 0, &frame))
return; return;
@ -436,12 +454,18 @@ trap(frame)
#if NISA > 0 #if NISA > 0
case T_NMI: case T_NMI:
case T_NMI|T_USER: case T_NMI|T_USER:
#ifdef DDB #if defined(KGDB) || defined(DDB)
/* NMI can be hooked up to a pushbutton for debugging */ /* NMI can be hooked up to a pushbutton for debugging */
printf ("NMI ... going to debugger\n"); printf ("NMI ... going to debugger\n");
#ifdef KGDB
if (kgdb_trap(type, &frame))
return;
#endif
#ifdef DDB
if (kdb_trap (type, 0, &frame)) if (kdb_trap (type, 0, &frame))
return; return;
#endif #endif
#endif /* KGDB || DDB */
/* machine/parity/power fail/"kitchen sink" faults */ /* machine/parity/power fail/"kitchen sink" faults */
if (isa_nmi() == 0) if (isa_nmi() == 0)
return; return;